Share via


RetrieveEntityRibbonResponse.CompressedEntityXml Property

Applies To: Microsoft Dynamics CRM 2013, Microsoft 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

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

Property Value

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

Example

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;
 }
}

Remarks

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

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2008, Windows Server 2012, Windows 7 (All Versions), Windows 8 (All Versions)

Target Platforms

Windows Server 2008, ,Windows Server 2012, ,Windows 7 (All Versions),

Change History

See Also

Reference

RetrieveEntityRibbonResponse Class
RetrieveEntityRibbonResponse Members
Microsoft.Crm.Sdk.Messages Namespace

Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.