/// <summary> /// Save the properties of the argument object to the stream provided /// </summary> /// <param name="Stream">Stream to which to serialize the argument object into</param> public void Save(IVariantStream Stream) { if (Stream is IDocumentVersion) { IDocumentVersion docVersion = (IDocumentVersion)Stream; if (docVersion.DocumentVersion >= esriArcGISVersion.esriArcGISVersion10) { object names = null, values = null; myProperties.GetAllProperties(out names, out values); string[] nameArray = (string[])names; object[] valArray = (object[])values; for (int i = 0; i < nameArray.GetLength(0); ++i) { if (valArray[i] is IDataset) { IName myDatasetName = ((IDataset)valArray[i]).FullName; myProperties.SetProperty(nameArray[i], myDatasetName); } } Stream.Write((int)esriArcGISVersion.esriArcGISVersion10); Stream.Write(myName); Stream.Write(myDescription); Stream.Write(myProperties); } } }
/// <summary> /// Save the properties of the function to the stream provided /// </summary> /// <param name="Stream">Stream to which to serialize the function into</param> public void Save(IVariantStream Stream) { if (Stream is IDocumentVersion) { IDocumentVersion docVersion = (IDocumentVersion)Stream; if (docVersion.DocumentVersion >= esriArcGISVersion.esriArcGISVersion10) { Stream.Write((int)esriArcGISVersion.esriArcGISVersion10); Stream.Write(myName); Stream.Write(myDescription); Stream.Write((int)myPixeltype); } } }
/// <summary> /// Load the properties of the function from the stream provided /// </summary> /// <param name="Stream">Stream that contains the serialized form of the function</param> public void Load(IVariantStream Stream) { if (Stream is IDocumentVersion) { IDocumentVersion docVersion = (IDocumentVersion)Stream; if (docVersion.DocumentVersion >= esriArcGISVersion.esriArcGISVersion10) { esriArcGISVersion streamVersion = (esriArcGISVersion)((int)Stream.Read()); if (streamVersion >= esriArcGISVersion.esriArcGISVersion10) { myName = (string)Stream.Read(); myDescription = (string)Stream.Read(); myPixeltype = (rstPixelType)((int)Stream.Read()); } } } }