Condividi tramite


RetrieveEntityRibbonResponse.CompressedEntityXml Property

 

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Gets a compressed file that contains the ribbon definitions.

Namespace:   Microsoft.Crm.Sdk.Messages
Assembly:  Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)

Syntax

public byte[] CompressedEntityXml { get; }
Public ReadOnly Property CompressedEntityXml As Byte()

Property Value

Type: System.Byte[]

Type: Byte[]
A compressed file that contains the ribbon definitions..

Remarks

To extract the XML data from the compressed file, you have to use the System.IO.Packaging.ZipPackage class.

Examples

The following example is a helper method that is included in the SDK sample that is found at SampleCode\CS\Client\Ribbon\ExportRibbonXml.


/// <summary>
/// A helper method that decompresses the the Ribbon data returned
/// </summary>
/// <param name="data">The compressed ribbon data</param>
/// <returns></returns>
public byte[] unzipRibbon(byte[] data)
{
 System.IO.Packaging.ZipPackage package = null;
 MemoryStream memStream = null;

 memStream = new MemoryStream();
 memStream.Write(data, 0, data.Length);
 package = (ZipPackage)ZipPackage.Open(memStream, FileMode.Open);

 ZipPackagePart part = (ZipPackagePart)package.GetPart(new Uri("/RibbonXml.xml", UriKind.Relative));
 using (Stream strm = part.GetStream())
 {
  long len = strm.Length;
  byte[] buff = new byte[len];
  strm.Read(buff, 0, (int)len);
  return buff;
 }
}

See Also

RetrieveEntityRibbonResponse Class
Microsoft.Crm.Sdk.Messages Namespace

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright