Пример #1
0
        void IPersistVariant.Load(IVariantStream Stream)
        {
            int version;

            version  = (int)Stream.Read();
            m_dAngle = (double)Stream.Read();
        }
Пример #2
0
        void IPersistVariant.Load(IVariantStream Stream)
        {
            int version;

            version  = (int)Stream.Read();
            m_Radius = (double)Stream.Read();
            m_Number = (int)Stream.Read();
        }
Пример #3
0
        /// <summary>
        /// Load the object from the stream provided
        /// </summary>
        /// <param name="Stream">Stream that represents the serialized Raster Type</param>
        void IPersistVariant.Load(IVariantStream Stream)
        {
            string name = (string)Stream.Read();

            //if (innerRasterBuilder is IPersistVariant)
            //    ((IPersistVariant)innerRasterBuilder).Load(Stream);
            innerRasterBuilder = (IRasterBuilder)Stream.Read(); // Load the innerRasterBuilder from the stream.
        }
        void IPersistVariant.Load(IVariantStream Stream)
        {
            int version;

            version    = (int)Stream.Read();
            m_dOffsetX = (double)Stream.Read();
            m_dOffsetY = (double)Stream.Read();
        }
Пример #5
0
        void IPersistVariant.Load(IVariantStream Stream)
        {
            int version;

            version    = (int)Stream.Read();
            m_dFactorX = (double)Stream.Read();
            m_dFactorY = (double)Stream.Read();
        }
Пример #6
0
        public void Load(IVariantStream Stream)
        {
            int version = (int)Stream.Read();

            if (version > m_httpBasicGPValueVersion)
            {
                return;
            }

            m_username = Stream.Read() as string;
            m_password = Stream.Read() as string;
        }
 /// <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());
             }
         }
     }
 }
        /// <summary>
        /// Loads the object properties from the stream.
        /// </summary>
        /// <param name="Stream"></param>
        /// <remarks>The Load method must read the data from the stream in the same order the data was
        /// written to the stream in the Save method.
        /// Streams are sequential; you must ensure that your data is saved and loaded in the correct order,
        /// so that the correct data is written to the correct member.
        /// </remarks>
        virtual public void Load(IVariantStream Stream)
        {
            m_sName       = (string)Stream.Read();
            m_bValid      = (bool)Stream.Read();
            m_bCached     = (bool)Stream.Read();
            m_dblMinScale = (double)Stream.Read();
            m_dblMaxScale = (double)Stream.Read();
            m_bDrawDirty  = (bool)Stream.Read();

            m_spRef  = (ISpatialReference)Stream.Read();
            m_extent = (IEnvelope)Stream.Read();

            m_extensions = (ArrayList)Stream.Read();
        }
Пример #9
0
        public object Deserialize(object data)
        {
            IMemoryBlobStreamVariant str = new MemoryBlobStreamClass();

            str.ImportFromVariant(data);
            ((IVariantStreamIO)vs).Stream = (IMemoryBlobStream)str;
            object o = vs.Read();

            return(o);
        }
		public void Load(IVariantStream Stream)
		{
			//load the persisted parameters of the renderer

			m_eColorCombinationMethod = (EColorCombinationType)Stream.Read();
			m_pShapePatternRend = Stream.Read() as IFeatureRenderer;
			m_pColorRend1 = Stream.Read() as IFeatureRenderer;
			m_pColorRend2 = Stream.Read() as IFeatureRenderer;
			m_pSizeRend = Stream.Read() as IFeatureRenderer;
			//m_pLegendGroups = = Stream.Read
			m_sRotationField = (string)Stream.Read();
            m_eRotationType = (esriSymbolRotationType)Stream.Read();
			m_sTransparencyField = (String)Stream.Read();
			m_pMainRend = Stream.Read() as IFeatureRenderer;

			//CreateLegend() ' not needed now
		}
Пример #11
0
        public void Load(IVariantStream stream)
        {
            try
            {
                Name              = (string)stream.Read();
                _visible          = (bool)stream.Read();
                _enumBruTileLayer = (EnumBruTileLayer)stream.Read();

                Logger.Debug("Load layer " + Name + ", type: " + _enumBruTileLayer.ToString());

                switch (_enumBruTileLayer)
                {
                case EnumBruTileLayer.TMS:
                    var url = (string)stream.Read();
                    _config = ConfigHelper.GetTmsConfig(url, true);
                    Logger.Debug("Url: " + url);
                    break;

                case EnumBruTileLayer.InvertedTMS:
                    var urlInverted = (string)stream.Read();
                    Logger.Debug("Url: " + urlInverted);
                    _config = ConfigHelper.GetConfig(EnumBruTileLayer.InvertedTMS, urlInverted, true);
                    break;

                default:
                    _config = ConfigHelper.GetConfig(_enumBruTileLayer);
                    break;
                }

                InitializeLayer();
                // get the active map later when
                _map = null;
            }
            catch (Exception ex)
            {
                Logger.Debug("Error loading custom layer: " + ex.Message);
            }
        }
Пример #12
0
        /// <summary>
        /// Deserializes a COM object from a byte array created using <see cref="SerializeComObject"></see>.
        /// </summary>
        /// <param name="bytes">The bytes array.</param>
        /// <returns></returns>
        public static object DeserializeComObject([NotNull] byte[] bytes)
        {
            Assert.ArgumentNotNull(bytes, nameof(bytes));
            Assert.ArgumentCondition(bytes.Length > 0, "byte array is empty");

            IMemoryBlobStream2 memoryBlobStream = new MemoryBlobStreamClass();
            IVariantStream     variantStream    = CreateVariantStream(memoryBlobStream);

            var memoryBlobStreamVariant = (IMemoryBlobStreamVariant)memoryBlobStream;

            memoryBlobStreamVariant.ImportFromVariant(bytes);

            return(variantStream.Read());
        }
Пример #13
0
        /// <summary>
        /// Reads from the specified stream.
        /// </summary>
        /// <param name="stream">The stream to read from.</param>
        /// <param name="currentVersion">The current version of the calling component
        /// (used to validate the stream version). Must be a non-negative integer.</param>
        /// <param name="versionedRead">Delegate to do the actual reading, based on the version of the stream.</param>
        /// <param name="releaseStream">if set to <c>true</c> the stream is released using Marshal.ReleaseComObject. This
        /// should only be done in calls from direct com interface implementations.</param>
        public static void Load([NotNull] IVariantStream stream,
                                int currentVersion,
                                [NotNull] Action <int> versionedRead,
                                bool releaseStream = false)
        {
            try
            {
                // assert inside try block to make sure assertion violations are visible
                Assert.ArgumentNotNull(stream, nameof(stream));
                Assert.ArgumentNotNull(versionedRead, nameof(versionedRead));
                Assert.True(currentVersion >= 0, "Invalid current version: {0}",
                            currentVersion);

                object versionObject = stream.Read();
                Assert.NotNull(versionObject, "Unable to read version from stream");

                var version = (int)versionObject;
                Assert.True(version >= 0 && version <= currentVersion,
                            "Unexpected version: {0}", version);

                versionedRead(version);
            }
            catch (Exception e)
            {
                var    comEx   = e as COMException;
                string message =
                    comEx == null
                                                ? $"Error reading from stream: {e.Message}"
                                                : $"Error reading from stream: {comEx.Message}; ErrorCode: {comEx.ErrorCode}";
                _msg.Error(message, e);
                throw;
            }
            finally
            {
                // ReSharper disable once ConditionIsAlwaysTrueOrFalse
                if (releaseStream && stream != null)
                {
                    Marshal.ReleaseComObject(stream);
                }
            }
        }
Пример #14
0
        void ESRI.ArcGIS.esriSystem.IPersistVariant.Load(IVariantStream Stream)
        {
            int num = 0;

            num = Convert.ToInt32(Stream.Read());
            if (num > 1 | num <= 0)
            {
                throw new Exception("Failed to read from stream");
            }
            this.InitializeMembers();
            if (num == 1)
            {
                this.m_lROP2         = (esriRasterOpCode)Stream.Read();
                this.m_widht         = Convert.ToDouble(Stream.Read());
                this.m_pColor        = Stream.Read() as IColor;
                this.m_bRotWithTrans = Convert.ToBoolean(Stream.Read());
                this.m_lMapLevel     = Convert.ToInt32(Stream.Read());
            }
        }
 void IPersistVariant.Load(IVariantStream Stream)
 {
     int version ;
     version = (int)Stream.Read();
     m_dAngle = (double)Stream.Read();
 }
 void IPersistVariant.Load(IVariantStream Stream)
 {
     int version;
     version = (int)Stream.Read();
     m_dOffsetX = (double)Stream.Read();
     m_dOffsetY = (double)Stream.Read();
 }
Пример #17
0
        public void Load(IVariantStream Stream)
        {
            int num = (int)Stream.Read();

            if ((num > 2 ? true : num <= 0))
            {
                throw new Exception("Wrong version!");
            }
            this.InitMembers();
            this.m_size            = (double)Stream.Read();
            this.m_scaleRef        = (double)Stream.Read();
            this.m_anchorPointType = (esriAnchorPointEnum)Stream.Read();
            this.m_autoTrans       = (bool)Stream.Read();
            this.m_elementType     = (string)Stream.Read();
            this.m_elementName     = (string)Stream.Read();
            this.m_nativeSR        = Stream.Read() as ISpatialReference;
            this.m_fillSymbol      = Stream.Read() as ISimpleFillSymbol;
            this.m_pointGeometry   = Stream.Read() as IPoint;
            this.m_triangle        = Stream.Read() as IPolygon;
            if (num == 2)
            {
                this.m_rotation = (double)Stream.Read();
            }
        }
 void IPersistVariant.Load(IVariantStream Stream)
 {
     int version; 
     version = (int)Stream.Read(); 
     m_dFactorX = (double)Stream.Read(); 
     m_dFactorY = (double)Stream.Read();
 }
Пример #19
0
 /// <summary>
 /// </summary>
 /// <param name="Stream"></param>
 public void Load(IVariantStream Stream)
 {
     this.m_pGeometry       = Stream.Read() as IEnvelope;
     this.m_pLineSymbol     = Stream.Read() as ILineSymbol;
     this.m_pTextSym        = Stream.Read() as ITextSymbol;
     this.m_LeftBottomName  = Stream.Read() as string;
     this.m_RightBottomName = Stream.Read() as string;
     this.m_BottomName      = Stream.Read() as string;
     this.m_LeftTopName     = Stream.Read() as string;
     this.m_RightTopName    = Stream.Read() as string;
     this.m_TopName         = Stream.Read() as string;
     this.m_LeftName        = Stream.Read() as string;
     this.m_RightName       = Stream.Read() as string;
     this.m_sElementName    = Stream.Read() as string;
     this.m_sElementType    = Stream.Read() as string;
     this.m_bLocked         = (bool)Stream.Read();
     this.m_vCustomProperty = Stream.Read();
 }
        public void Load(IVariantStream Stream)
        {
            int version = (int)Stream.Read();

            if (version > m_httpBasicGPValueVersion)
                return;

            m_username = Stream.Read() as string;
            m_password = Stream.Read() as string;
        }
Пример #21
0
        public void Load(IVariantStream stream)
        {
            try
            {
                Name = (string)stream.Read();
                _visible = (bool)stream.Read();
                _enumBruTileLayer = (EnumBruTileLayer)stream.Read();

                Logger.Debug("Load layer " + Name + ", type: " + _enumBruTileLayer.ToString());

                switch (_enumBruTileLayer)
                {
                    case EnumBruTileLayer.TMS:
                        var url = (string)stream.Read();
                        _config = ConfigHelper.GetTmsConfig(url, true);
                        Logger.Debug("Url: " + url);
                        break;
                    case EnumBruTileLayer.InvertedTMS:
                        var urlInverted = (string)stream.Read();
                        Logger.Debug("Url: " + urlInverted);
                        _config = ConfigHelper.GetConfig(EnumBruTileLayer.InvertedTMS, urlInverted, true);
                        break;

                    default:
                        _config = ConfigHelper.GetConfig(_enumBruTileLayer);
                        break;
                }

                InitializeLayer();
                // get the active map later when
                _map = null;
            }
            catch (Exception ex)
            {
                Logger.Debug("Error loading custom layer: " + ex.Message);
            }
        }
Пример #22
0
        void ESRI.ArcGIS.esriSystem.IPersistVariant.Load(IVariantStream Stream)
        {
            int num = 0;

            num = Convert.ToInt32(Stream.Read());
            if (num > 1 | num <= 0)
            {
                throw new Exception("Failed to read from stream");
            }
            this.InitializeMembers();
            if (num == 1)
            {
                this.m_lROP2 = (esriRasterOpCode)Stream.Read();
                this.m_Size  = Convert.ToDouble(Stream.Read());
                this.m_Angle = Convert.ToDouble(Stream.Read());
                this.m_HorizontalAlignment = (esriTextHorizontalAlignment)Stream.Read();
                this.m_VerticalAlignment   = (esriTextVerticalAlignment)Stream.Read();
                this.m_RightToLeft         = Convert.ToBoolean(Stream.Read());
                this.m_Text                  = Convert.ToString(Stream.Read());
                this.m_bRotWithTrans         = Convert.ToBoolean(Stream.Read());
                this.m_lMapLevel             = Convert.ToInt32(Stream.Read());
                this.m_NumeratorText         = Convert.ToString(Stream.Read());
                this.m_DenominatorText       = Convert.ToString(Stream.Read());
                this.m_LineSymbol            = Stream.Read() as ILineSymbol;
                this.m_NumeratorTextSymbol   = Stream.Read() as ITextSymbol;
                this.m_DenominatorTextSymbol = Stream.Read() as ITextSymbol;
            }
        }
 /// <summary>
 /// Load the properties of the argument object from the stream provided
 /// </summary>
 /// <param name="Stream">Stream that contains the serialized form of the argument object</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();
                 myProperties = (IPropertySet)Stream.Read();
             }
         }
     }
 }
        void IPersistVariant.Load(IVariantStream Stream)
        {

            int version;
            version = (int)Stream.Read();
            m_Radius = (double)Stream.Read();
            m_Number = (int)Stream.Read();
        }
 /// <summary>
 /// Load the object from the stream provided
 /// </summary>
 /// <param name="Stream">Stream that represents the serialized Raster Type</param>
 public void Load(IVariantStream Stream)
 {
     string name = (string)Stream.Read();
     //if (innerRasterBuilder is IPersistVariant)
     //    ((IPersistVariant)innerRasterBuilder).Load(Stream);
     //innerRasterBuilder = (IRasterBuilder)Stream.Read(); // Load the innerRasterBuilder from the stream.
 }
    public void Load(IVariantStream Stream)
    {
      int ver = (int)Stream.Read();
      if (ver > c_Version || ver <= 0)
        throw new Exception("Wrong version!");

      InitMembers();

      m_size = (double)Stream.Read();
      m_scaleRef = (double)Stream.Read();
      m_anchorPointType = (esriAnchorPointEnum)Stream.Read();
      m_autoTrans = (bool)Stream.Read();
      m_elementType = (string)Stream.Read();
      m_elementName = (string)Stream.Read();
      m_nativeSR = Stream.Read() as ISpatialReference;
      m_fillSymbol = Stream.Read() as ISimpleFillSymbol;
      m_pointGeometry = Stream.Read() as IPoint;
      m_triangle = Stream.Read() as IPolygon;

      if (ver == 2)
      {
        m_rotation = (double)Stream.Read();
      }
    }
    /// <summary>
    /// Loads the object properties from the stream.
    /// </summary>
    /// <param name="Stream"></param>
    /// <remarks>The Load method must read the data from the stream in the same order the data was 
    /// written to the stream in the Save method. 
    /// Streams are sequential; you must ensure that your data is saved and loaded in the correct order, 
    /// so that the correct data is written to the correct member.
    /// </remarks>
    virtual public void Load(IVariantStream Stream)
    {
      m_sName = (string)Stream.Read();
      m_bValid = (bool)Stream.Read();
      m_bCached = (bool)Stream.Read();
      m_dblMinScale = (double)Stream.Read();
      m_dblMaxScale = (double)Stream.Read();
      m_bDrawDirty = (bool)Stream.Read();

      m_spRef = (ISpatialReference)Stream.Read();
      m_extent = (IEnvelope)Stream.Read();

      m_extensions = (ArrayList)Stream.Read();
    }