RetrieveApplicationRibbonResponse.CompressedApplicationRibbonXml Property

 

Applies To: Dynamics CRM 2015

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:
property array<unsigned char>^ CompressedApplicationRibbonXml {
    array<unsigned char>^ get();
}
member CompressedApplicationRibbonXml : byte[] with 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

© 2016 Microsoft. All rights reserved. Copyright