Пример #1
0
 public static void LoadLayerFromStream(ILayer paramLayer, byte[] paramLayerContent)
 {
     if (((paramLayer != null) && (paramLayerContent != null)) && (paramLayerContent.Length != 0))
     {
         IPersistStream stream = paramLayer as IPersistStream;
         XMLStreamClass class2 = new XMLStreamClass();
         class2.LoadFromBytes(ref paramLayerContent);
         stream.Load(class2);
     }
 }
Пример #2
0
 /// <summary>
 /// Gets an object serialized using ArcObjects xml serialization from a BSON Element
 /// Used by the CatalogDataset to extract metadata
 /// </summary>
 /// <param name="byteStuff">The BSON element containing the bytes</param>
 /// <returns>The object deserialized</returns>
 internal static System.Object BsonToObject(BsonElement byteStuff)
 {
     try
     {
         byte[]     bytes       = byteStuff.Value.AsByteArray;
         IXMLStream ipXmlStream = new XMLStreamClass();
         ipXmlStream.LoadFromBytes(ref bytes);
         IXMLReader ipXmlReader = new XMLReaderClass();
         ipXmlReader.ReadFrom((IStream)ipXmlStream);
         IXMLSerializer ipXmlSer = new XMLSerializerClass();
         return(ipXmlSer.ReadObject(ipXmlReader, null, null));
     }
     catch (Exception)
     {
         throw new COMException("Value expected as byte array isn't");
     }
 }
Пример #3
0
 public static void LoadLayerFromStream(ILayer paramLayer, byte[] paramLayerContent)
 {
     if (((paramLayer != null) && (paramLayerContent != null)) && (paramLayerContent.Length != 0))
     {
         IPersistStream stream = paramLayer as IPersistStream;
         XMLStreamClass class2 = new XMLStreamClass();
         class2.LoadFromBytes(ref paramLayerContent);
         stream.Load(class2);
     }
 }