Exemplo n.º 1
0
        public Block(SerializationInfo info, StreamingContext context)
        {
            // built-in value
            _bits = info.GetUInt32("built-int");
            // cutom bits
            _customBits = new uint[info.GetUInt16("cBitCount")];
            int length = _customBits.Length;
            for (int i = 0; i < length; i++)
            {
                _customBits[i] = info.GetUInt32("cBit" + i);
            }

            // custom floats
            length = info.GetUInt16("cFloatCount");
            _customFloats = new ConcurrentDictionary<int, float>(3, length * 2);
            for (int i = 0; i < length; i++)
            {
                _customFloats[info.GetInt32("cFloatKey" + i)] = info.GetSingle("cFloatValue" + i);
            }

            // custom strings
            length = info.GetUInt16("cStringCount");
            _customStrings = new ConcurrentDictionary<int, string>(3, length * 2);
            for (int i = 0; i < length; i++)
            {
                _customStrings[info.GetInt32("cStringKey" + i)] = info.GetString("cStringValue" + i);
            }
        }
Exemplo n.º 2
0
        private Key(SerializationInfo info, StreamingContext context)
        {
            KeyDownStrokes = new List<KeyStroke>();
            KeyUpStrokes = new List<KeyStroke>();

            //int version = info.GetInt32("Version");

            Name = info.GetString("keyName");

            InfoWindowsKeys = info.GetString("InfoWindowsKeys");

            int totalKeyDown = info.GetInt32("TotalKeyDown");
            for (int i = 0; i < totalKeyDown; i++)
            {
                var ks = new KeyStroke();
                ks.code = info.GetUInt16("kd_c_" + i);
                ks.information = info.GetUInt32("kd_i_" + i);
                ks.state = (Keyboard.States)info.GetUInt16("kd_s_" + i);

                KeyDownStrokes.Add(ks);
            }

            int totalKeyUp = info.GetInt32("TotalKeyUp");
            for (int i = 0; i < totalKeyUp; i++)
            {
                var ks = new KeyStroke();
                ks.code = info.GetUInt16("ku_c_" + i);
                ks.information = info.GetUInt32("ku_i_" + i);
                ks.state = (Keyboard.States)info.GetUInt16("ku_s_" + i);

                KeyUpStrokes.Add(ks);
            }

        }
Exemplo n.º 3
0
        public StarMapFeature(SerializationInfo info, StreamingContext context)
        {
            //m_Stride = info.GetInt32("m_Stride");
            //m_BytesPerPixel = info.GetInt32("m_BytesPerPixel");
            m_MaxBrightness = info.GetByte("m_MaxBrightness");

            m_MaxBrightnessFirstKey = info.GetUInt64("m_MaxBrightnessFirstKey");
            m_MaxBrightnessPixels = info.GetInt32("m_MaxBrightnessPixels");
            m_Generation = info.GetInt32("m_Generation");
            m_Merges = info.GetInt32("m_Merges");

            m_FeatureId = info.GetInt32("FeatureId");
            m_Intencity = info.GetUInt32("m_Intencity");

            int count = info.GetInt32("m_Pixels.Count");
            int idx = -1;
            m_Pixels = new SortedDictionary<ulong, uint>();
            for (int i = 0; i < count; i++)
            {
                idx++;
                ulong key = info.GetUInt64(string.Format("m_Pixels.{0}.Key", idx));
                uint val = info.GetUInt32(string.Format("m_Pixels.{0}.Value", idx));
                m_Pixels.Add(key, val);
            }
        }
Exemplo n.º 4
0
            public Credentials(SerializationInfo info, StreamingContext context)
            {
                int version = 0;

                try
                {
                    version = info.GetInt32("version");
                }

                catch { }

                if (version == 0)
                {
                    Host = info.GetString("m_Host");
                    Port = info.GetInt32("m_Port");
                    WorkspaceID = info.GetUInt64("m_ID");
                    WorkspaceName = info.GetString("m_Name");
                    UserName = info.GetString("m_UserName");
                    UserSmtp = info.GetString("m_UserSmtp");
                    Nonce = (byte[])info.GetValue("m_Nonce", (new byte[] { }).GetType());
                    Type = (Credentials.CredType)Enum.Parse(typeof(CredType), info.GetString("m_type"));
                    Password = info.GetString("m_pwd");
                    Ticket = (byte[])info.GetValue("m_ticket", (new byte[] { }).GetType());
                    IsAdmin = info.GetBoolean("m_IsAdmin");
                    UserID = info.GetUInt32("m_UserId");
                }

                else
                {
                    Host = info.GetString("Host");
                    Port = info.GetInt32("Port");
                    WorkspaceID = info.GetUInt64("ID");
                    WorkspaceName = info.GetString("Name");
                    UserName = info.GetString("UserName");
                    UserSmtp = info.GetString("UserSmtp");
                    Nonce = (byte[])info.GetValue("Nonce", (new byte[] { }).GetType());
                    Type = (Credentials.CredType)Enum.Parse(typeof(CredType), info.GetString("Type"));
                    Password = info.GetString("Password");
                    Ticket = (byte[])info.GetValue("Ticket", (new byte[] { }).GetType());
                    IsAdmin = info.GetBoolean("IsAdmin");
                    UserID = info.GetUInt32("UserID");
                    if (version == 2) IsPublic = info.GetBoolean("IsPublic");
                }

                newCreds.KasID = new KasIdentifier(Host, (UInt16)Port);
                newCreds.ExternalID = WorkspaceID;
                newCreds.KwsName = WorkspaceName;
                newCreds.UserName = UserName;
                newCreds.UserEmailAddress = UserSmtp;
                newCreds.AdminFlag = IsAdmin;
                newCreds.PublicFlag = IsPublic;
                newCreds.UserID = UserID;
                newCreds.Ticket = Ticket;
                newCreds.Pwd = Password;
            }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new <see cref="FrequencyDefinitionBase"/> from serialization parameters.
 /// </summary>
 /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
 /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
 protected FrequencyDefinitionBase(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize frequency definition
     m_dfdtScale = info.GetUInt32("dfdtScale");
     m_dfdtOffset = info.GetDouble("dfdtOffset");
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="JsException"/> class with serialized data
		/// </summary>
		/// <param name="info">The object that holds the serialized data</param>
		/// <param name="context">The contextual information about the source or destination</param>
		protected JsException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
			if (info != null)
			{
				_errorCode = (JsErrorCode)info.GetUInt32("ErrorCode");
			}
		}
Exemplo n.º 7
0
 protected Gpu(SerializationInfo info, StreamingContext ctx)
 {
     _isEnabled = info.GetBoolean("IsEnabled");
     _isLineRendered = info.GetBoolean("IsLineRendered");
     _clocks = info.GetUInt32("Clocks");
     _currentLine = info.GetUInt32("CurrentLine");
     _delay = info.GetInt32("Delay");
     _mode = (Mode)info.GetValue("Mode", typeof(Mode));
     _frameBuffer = ((List<int>)info.GetValue("FrameBuffer", typeof(List<int>)))
         .Select(i => i.FromArgb()).ToList();
     _defaultPalette = ((List<int>)info.GetValue("DefaultPalette", typeof(List<int>)))
         .Select(i => i.FromArgb()).ToList();
     _bgPalette = ((List<int>)info.GetValue("BackgroundPalette", typeof(List<int>)))
         .Select(i => i.FromArgb()).ToList();
     _spritePalette = ((List<int>)info.GetValue("SpritePalette", typeof(List<int>)))
         .Select(i => i.FromArgb()).ToList();
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="JavaScriptException"/> class. 
 /// </summary>
 /// <param name="info">The serialization info.</param>
 /// <param name="context">The streaming context.</param>
 protected JavaScriptException(SerializationInfo info, StreamingContext context) :
     base(info, context)
 {
     if (info != null)
     {
         code = (JavaScriptErrorCode) info.GetUInt32("code");
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes new instance of Pkcs11Exception class with serialized data
 /// </summary>
 /// <param name="info">SerializationInfo that holds the serialized object data about the exception being thrown</param>
 /// <param name="context">StreamingContext that contains contextual information about the source or destination</param>
 protected Pkcs11Exception(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if (info != null)
     {
         _method = info.GetString("Method");
         _rv = (CKR)info.GetUInt32("RV");
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// Creates a new <see cref="ChannelDefinitionBase"/> from serialization parameters.
 /// </summary>
 /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
 /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
 protected ChannelDefinitionBase(SerializationInfo info, StreamingContext context)
 {
     // Deserialize channel definition
     m_parent = (IConfigurationCell)info.GetValue("parent", typeof(IConfigurationCell));
     m_index = info.GetInt32("index");
     Label = info.GetString("label");
     m_scale = info.GetUInt32("scale");
     m_offset = info.GetDouble("offset");
 }
Exemplo n.º 11
0
 protected Url(SerializationInfo info,StreamingContext context)
 {
     this.uri = info.GetValue("uri", typeof(Uri)) as Uri;
     this.uriEscape = info.GetBoolean("escape");
     this.checkSum = info.GetUInt32("checkSum");
     this.hostCheckSum = info.GetUInt32("hostCheckSum");
     this.checkSumAlgorith = info.GetValue("checkSumAlgorith", typeof(IUrlCheckSum)) as IUrlCheckSum;
     this.httpMethod = info.GetString("httpMethod");
     this.appendParams = info.GetValue("appendParams", typeof(NameValueCollection)) as NameValueCollection;
     this.ignoreParams = info.GetValue("ignoreParams", typeof(NameValueCollection)) as NameValueCollection;
     this.maxTryTimes = info.GetInt32("maxTryTimes");
     this.hasTriedTimes = info.GetInt32("hasTriedTimes");
     this.hasError = info.GetBoolean("hasError");
     this.errorMsg = info.GetString("errorMsg");
     this.contentHandlers = info.GetValue("contentHandlers", typeof(ContentHandlerCollection)) as ContentHandlerCollection;
     this.text = info.GetString("text");
     this.domainSuffixProvider = info.GetValue("domainSuffixProvider", typeof(IDomainSuffixPrivoder)) as IDomainSuffixPrivoder;
     this.allowExtractUrl = info.GetBoolean("allowExtractUrl");
 }
Exemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeBackend.DPin"/> class.
 /// </summary>
 /// <param name="info">Info.</param>
 /// <param name="context">Context.</param>
 public DPin(SerializationInfo info, StreamingContext context)
 {
     Type = (PinType)info.GetByte ("Type");
     Mode = (PinMode)info.GetByte ("Mode");
     Name = info.GetString ("Name");
     Number = info.GetUInt32 ("Number");
     AnalogNumber = info.GetInt32 ("AnalogNumber");
     SDA = info.GetBoolean ("SDA");
     SCL = info.GetBoolean ("SCL");
     RX = info.GetBoolean ("RX");
     TX = info.GetBoolean ("TX");
     PlotColor = new Gdk.Color (info.GetByte ("RED"), info.GetByte ("GREEN"), info.GetByte ("BLUE"));
 }
Exemplo n.º 13
0
 public Item(SerializationInfo info, StreamingContext context)
 {
     Path = info.GetString("Path");
     _tags = (List<Tag>) info.GetValue("_tags", typeof (List<Tag>));
     _filesize = (long) info.GetValue("_filesize", typeof (long));
     _hash = info.GetUInt32("_hash");
     _dimensions = (Size) info.GetValue("_dimensions", typeof (Size));
     _links = (HashSet<string>) info.GetValue("_links", typeof (HashSet<string>));
     _invalidated = info.GetBoolean("_invalidated");
     _externalUrl = info.GetString("_externalUrl");
     _uploaded = info.GetBoolean("_uploaded");
     _tagRenameStateChanged = info.GetBoolean("_tagRenameStateChanged");
 }
Exemplo n.º 14
0
        /// <summary>
        /// Construct from a stream of serialized data
        /// </summary>
        /// <param name="info"></param>
        /// <param name="con"></param>
        public DataOperation(SerializationInfo info, StreamingContext con)
        {
            m_ClassId = info.GetUInt32("_ClassId");
            m_ClassName = info.GetString("_ClassName");
            // WARNING:: enum deserialize causes an exception
            // serialization of an enum prints the string
            // representation of the enum value, so we need to
            // deserialize to a string and convert to the relvant
            // enum value.
            // ENUM Deserialization - read as string and convert string to ENUM value
            String s = info.GetString("_OperationType");
            m_OperationType = (OperationType)Enum.Parse(typeof(OperationType), s, true);
            m_InstanceId = info.GetUInt64("_OperationUID");
            m_ExecuteId = info.GetUInt64("_ExecuteUID");

            String dt = info.GetString("_Created");
            DateTime.TryParse(dt, null
                , System.Globalization.DateTimeStyles.AssumeLocal
                , out m_InstanceCreated);
            dt = info.GetString("_Executed");
            DateTime.TryParse(dt, null
                , System.Globalization.DateTimeStyles.AssumeLocal
                , out m_OperationExecuted);
            dt = info.GetString("_Completed");
            DateTime.TryParse(dt, null
                , System.Globalization.DateTimeStyles.AssumeLocal
                , out m_OperationCompleted);
            // deserialization resets the static instance count
            // from the input stream, all previous data is overwritten
            lock (myMutex)
            {
                if (s_InstanceId < m_InstanceId)
                {
                    s_InstanceId = m_InstanceId;
                }
            }
        }
Exemplo n.º 15
0
 protected  ClassicFactoryException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     idxdatInfo = info.GetString("IdxdatInfo");
     muldatInfo = info.GetString("MuldatInfo");
     dataidInfo = info.GetUInt32("DataidInfo");
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of <see cref="DnsException"/> for <see cref="ISerializable"/>
 /// </summary>
 /// <param name="info">the serialization information</param>
 /// <param name="context">the context</param>
 /// <remarks>
 /// Used by the <see cref="ISerializable"/> interface.
 /// </remarks>
 public DnsException(SerializationInfo info, StreamingContext context): base(info, context)
 {
     errcode = info.GetUInt32("errcode");
 }
Exemplo n.º 17
0
        /// <summary>
        /// Deserializes the service result.
        /// </summary>
        /// <param name="info">The info.</param>
        /// <param name="prefix">The prefix.</param>
        /// <returns></returns>
        private static ServiceResult DeserializeServiceResult(SerializationInfo info, string prefix)
        {
            uint statusCode = info.GetUInt32(prefix + "StatusCode");
            string namespaceUri = info.GetString(prefix + "NamespaceUri");
            string symbolicId = info.GetString(prefix + "SymbolicId");
            string additionalInfo = info.GetString(prefix + "AdditionalInfo");

            bool isLocalizedTextNull = false;
            string localizedTextText = null;
            LocalizedText localizedText = null;

            try
            {
                localizedTextText = info.GetString(prefix + "LocalizedTextText");
            }
            catch (SerializationException ex)
            {
                isLocalizedTextNull = true;
                Utils.Trace("Deserialization - localized text is null." + ex.Message);
            }

            if (!isLocalizedTextNull)
            {
                string localizedTextKey = info.GetString(prefix + "LocalizedTextKey");
                string localizedTextLocale = info.GetString(prefix + "LocalizedTextLocale");
                if (localizedTextText != null || localizedTextLocale != null || localizedTextKey != null)
                {
                    localizedText = new LocalizedText(localizedTextKey, localizedTextLocale, localizedTextText);
                }
            }

            bool isInnerResultNull = false;
            ServiceResult innerServiceResult = null;
            uint innerResultStatusCode;
            try
            {
                innerResultStatusCode = info.GetUInt32(prefix + "InnerResultStatusCode");
            }
            catch (SerializationException ex)
            {
                isInnerResultNull = true;
                Utils.Trace("Deserialization - inner result is null." + ex.Message);
            }

            if (!isInnerResultNull)
            {
                innerServiceResult = DeserializeServiceResult(info, prefix + "InnerResult");
            }

            return new ServiceResult(statusCode, symbolicId, namespaceUri, localizedText, additionalInfo, innerServiceResult);
        }
Exemplo n.º 18
0
 public Star(SerializationInfo info, StreamingContext context)
 {
     m_StarNo = info.GetUInt32("m_StarNo");
     m_RADeg = info.GetDouble("m_RADeg");
     m_DEDeg = info.GetDouble("m_DEDeg");
     m_Mag = info.GetDouble("m_Mag");
 }
Exemplo n.º 19
0
 /// <summary>
 /// Creates a new <see cref="ConfigurationFrame"/> from serialization parameters.
 /// </summary>
 /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
 /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
 protected ConfigurationFrame(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize configuration frame
     m_frameSize = (FrameSize)info.GetValue("frameSize", typeof(FrameSize));
     m_messagePeriod = (MessagePeriod)info.GetValue("messagePeriod", typeof(MessagePeriod));
     m_idCode = info.GetUInt32("idCode32Bit");
 }
Exemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NTStatusException"/> class
 /// for deserialization.
 /// </summary>
 /// <param name="info">Serialization information.</param>
 /// <param name="context">Streaming context.</param>
 protected NTStatusException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     this.NativeErrorCode = info.GetUInt32(nameof(this.NativeErrorCode));
 }
Exemplo n.º 21
0
 /// <summary>
 /// Try to get the desired serialized UInt32 element. If not present, use
 /// defVal instead.
 /// </summary>
 public static void TryGetUInt32(SerializationInfo info, ref UInt32 var, String name, UInt32 defVal)
 {
     try
     {
         var = defVal;
         var = info.GetUInt32(name);
     }
     catch (Exception) { }
 }
Exemplo n.º 22
0
        /// <summary>
        /// Called when deserializing
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected TerrainShape(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            _terrainConfig = (TerrainConfig)info.GetValue("_terrainConfig", typeof(TerrainConfig));
              _decorationModels = (ArrayList)info.GetValue("_decorationModels",typeof(ArrayList));
              _iDecorationID = info.GetInt32("_iDecorationID");
              if (SerializationHelper.HasElement(info, "_iVisibleBitmask"))
            _iVisibleBitmask = info.GetUInt32("_iVisibleBitmask");
              if (SerializationHelper.HasElement(info, "_bVisibleInsideVisZones"))
            _bVisibleInsideVisZones = info.GetBoolean("_bVisibleInsideVisZones");
              if (SerializationHelper.HasElement(info, "_fLODScaling"))
            _fLODScaling = info.GetSingle("_fLODScaling");
              if (SerializationHelper.HasElement(info, "_fMirrorLODBias"))
            _fMirrorLODBias = info.GetSingle("_fMirrorLODBias");
              if (SerializationHelper.HasElement(info, "_lodMetric"))
            _lodMetric = (TerrainLODMetric_e)info.GetValue("_lodMetric", typeof(TerrainLODMetric_e));

              if (SerializationHelper.HasElement(info,"_iDetailTextureID"))
            _iDetailTextureID = info.GetInt32("_iDetailTextureID");
              if (SerializationHelper.HasElement(info, "_detailTextures"))
            _detailTextures = (ArrayList)info.GetValue("_detailTextures", typeof(ArrayList));
              if (SerializationHelper.HasElement(info, "_eLightmapSize"))
            _eLightmapSize = (LightmapSize_e)info.GetValue("_eLightmapSize", typeof(LightmapSize_e));
              if (SerializationHelper.HasElement(info, "_bCastStaticShadows"))
            _bCastStaticShadows = info.GetBoolean("_bCastStaticShadows");
              if (SerializationHelper.HasElement(info, "_iLightInfluenceBitmask"))
            _iLightInfluenceBitmask = info.GetUInt16("_iLightInfluenceBitmask");
              if (SerializationHelper.HasElement(info, "_shaderFX"))
            _pendingConfig = (ShaderEffectConfig)info.GetValue("_shaderFX", typeof(ShaderEffectConfig));
              if (SerializationHelper.HasElement(info, "_minimapTexture"))
            _minimapTexture = info.GetString("_minimapTexture");
              if (SerializationHelper.HasElement(info, "_heightmapExport"))
            _heightmapExport = info.GetString("_heightmapExport");
              if (SerializationHelper.HasElement(info, "_bNormalizeHeightmapExport"))
            _bNormalizeHeightmapExport = info.GetBoolean("_bNormalizeHeightmapExport");
              if (SerializationHelper.HasElement(info, "_bExportAsEditable"))
            _bExportAsEditable = info.GetBoolean("_bExportAsEditable");
              if (SerializationHelper.HasElement(info, "_bFastUpdate"))
            _bFastUpdate = info.GetBoolean("_bFastUpdate");

              if (SerializationHelper.HasElement(info, "_cachedDectorIDs"))
            _cachedSectorIDs = (uint[])info.GetValue("_cachedDectorIDs", typeof(uint[]));
              else
            _cachedSectorIDs = null;
              if (SerializationHelper.HasElement(info, "_savedZoneBoxes"))
            _savedZoneBoxes = (BoundingBox[])info.GetValue("_savedZoneBoxes", typeof(BoundingBox[]));
              else
            _savedZoneBoxes = null;

              if (SerializationHelper.HasElement(info, "_bSortDetailTextures"))
            _bSortDetailTextures = info.GetBoolean("_bSortDetailTextures");

              if (SerializationHelper.HasElement(info, "_meshExportSettings"))
            _meshExportSettings = (TerrainMeshExport)info.GetValue("_meshExportSettings", typeof(TerrainMeshExport));

              _bBakeMode = TerrainEditor.TextureBakedView; // fall back to editor setting
              if (SerializationHelper.HasElement(info, "_bBakeMode"))
            _bBakeMode = info.GetBoolean("_bBakeMode");
              if (SerializationHelper.HasElement(info, "_bIsReference"))
            _bIsReference = info.GetBoolean("_bIsReference");
              if (SerializationHelper.HasElement(info, "_bSceneSpecificLightmaps"))
            _bSceneSpecificLightmaps = info.GetBoolean("_bSceneSpecificLightmaps");

              // Make sure detail texture resources contain valid sector index information
              // (just in case an older vForge version wrote out wrong values after the terrain was resized)
              this.ClampDetailTextureSectorsToValidRange();
        }
Exemplo n.º 23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PrototypeBackend.Board"/> class.
        /// </summary>
        /// <param name="info">Info.</param>
        /// <param name="context">Context.</param>
        public Board(SerializationInfo info, StreamingContext context)
        {
            NumberOfAnalogPins = info.GetUInt32 ("NumberOfAnalogPins");
            NumberOfDigitalPins = info.GetUInt32 ("NumberOfDigitalPins");
            HardwareAnalogPins = ((List<uint>)info.GetValue ("HardwareAnalogPins", new List<uint> ().GetType ())).ToArray ();
            SDA = ((List<uint>)info.GetValue ("SDA", new List<uint> ().GetType ())).ToArray ();
            SCL = ((List<uint>)info.GetValue ("SCL", new List<uint> ().GetType ())).ToArray ();
            RX = ((List<uint>)info.GetValue ("RX", new List<uint> ().GetType ())).ToArray ();
            TX = ((List<uint>)info.GetValue ("TX", new List<uint> ().GetType ())).ToArray ();
            AnalogReferences = (Dictionary<string,double>)info.GetValue ("AnalogReferences", AnalogReferences.GetType ());
            AnalogReferenceVoltage = info.GetDouble ("AnalogReferenceVoltage");
            this.AnalogReferenceVoltageType = "";
            this.AnalogReferenceVoltageType = info.GetString ("AnalogReferenceVoltageType");
            MCU = info.GetString ("MCU");
            PinLayout = new Dictionary<string, List<int>> ();
            PinLayout.Add ("LEFT", ((List<int>)info.GetValue ("PinLayoutLeft", new List<int> ().GetType ())));
            PinLayout.Add ("RIGHT", ((List<int>)info.GetValue ("PinLayoutRight", new List<int> ().GetType ())));
            PinLayout.Add ("BOTTOM", ((List<int>)info.GetValue ("PinLayoutBottom", new List<int> ().GetType ())));
            PinLocation = (Dictionary<int,Point>)info.GetValue ("PinLocation", PinLocation.GetType ());

            ImageFilePath = info.GetString ("ImageFilePath");
        }
Exemplo n.º 24
0
 public PropNotSetException(
     SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     pa = (PropertyAccessor) info.GetValue("pa", typeof(PropertyAccessor));
     dwPropId = info.GetUInt32("dwPropId");
 }
Exemplo n.º 25
0
        /// <summary>デシリアライズ用Constructor</summary>
        /// <param name="sInfo"></param>
        /// <param name="context"></param>
        protected WallMaterial(SerializationInfo sInfo, StreamingContext context)
        {
            //バージョン情報
            uint version = sInfo.GetUInt32("S_Version");

            //素材ID
            id = sInfo.GetInt32("id");
            //素材名称
            name = sInfo.GetString("name");
            //熱伝導率[W/mK]
            thermalConductivity = sInfo.GetDouble("thermalConductivity");
            //容積比熱[kJ/m3K]
            volumetricSpecificHeat = sInfo.GetDouble("volumetricSpecificHeat");
            //素材タイプ
            pMaterial = (PredefinedMaterials)sInfo.GetValue("mType", typeof(PredefinedMaterials));
        }
 protected InvalidPaddingException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _measured = info.GetUInt32("measured");
     _specified = info.GetUInt32("specified");
 }
 /// <summary>
 /// Constructor with serialization information and streaming context.
 /// </summary>
 /// <param name="info">Serialization information</param>
 /// <param name="context">Streaming context</param>
 /// <exception cref="ArgumentNullException">If info is null, this exception will be thrown.</exception>
 protected SspiException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     this.errorCode = info.GetUInt32("errorCode");
 }
Exemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of the SSPIException class from serialization data.
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected SSPIException( SerializationInfo info, StreamingContext context )
     : base(info, context)
 {
     this.message = info.GetString( "messsage" );
     this.errorCode = (SecurityStatus)info.GetUInt32( "errorCode" );
 }
Exemplo n.º 29
0
        /// <summary>
        /// Deserializing constructor.
        /// </summary>
        public KwsUser(SerializationInfo info, StreamingContext context)
        {
            Int32 version = Misc.GetSerializationVersion(info);

            UserID = info.GetUInt32("UserID");
            Misc.TryGetUInt64(info, ref InvitationDate, "InvitationDate", 0);
            Misc.TryGetUInt32(info, ref InvitedBy, "InvitedBy", 0);
            AdminName = info.GetString("AdminName");
            UserName = info.GetString("UserName");
            EmailAddress = info.GetString("EmailAddress");
            OrgName = info.GetString("OrgName");

            if (version < 7)
            {
                if (info.GetUInt32("Power") > 0)
                {
                    AdminFlag = true;
                    ManagerFlag = true;
                }

                if (UserName != "")
                {
                    RegisterFlag = true;
                }
            }

            if (version >= 7)
            {
                Flags = info.GetUInt32("Flags");
            }
        }
    /// <summary>
    /// Called when deserializing
    /// </summary>
    /// <param name="info"></param>
    /// <param name="context"></param>
    protected VisibilityObjectShape(SerializationInfo info, StreamingContext context) : base(info, context)
    {
      _vBoxSize = (Vector3F)info.GetValue( "_vBoxSize", typeof(Vector3F) );
      _bFrustumTest = info.GetBoolean("_bFrustumTest");
      _bPortalTest = info.GetBoolean("_bPortalTest");
      _bHOCQTest = info.GetBoolean("_bHOCQTest");
      _bActive = info.GetBoolean("_bActive");
      _fFarClipDist = info.GetSingle("_fFarClipDist");
      if (SerializationHelper.HasElement(info, "_fNearClipDist"))
        _fNearClipDist = info.GetSingle("_fNearClipDist");
      _iContextBitMask = info.GetUInt32("_iContextBitMask");
			AddHint(HintFlags_e.NoRotation);

      // backwards compatibility
      if (!SerializationHelper.HasElement(info, "SupportScaling"))
        SetScaling_Internal(1.0f, 1.0f, 1.0f);
    }