RetrieveApplicationRibbonResponse.CompressedApplicationRibbonXml Property

 

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

Gets a compressed file that defines the ribbon.

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

Syntax

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

Property Value

Type: System.Byte[]

Type: Byte[]
a compressed file that defines the ribbon.

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 you can find 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

RetrieveApplicationRibbonResponse Class
Microsoft.Crm.Sdk.Messages Namespace

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright