當前位置: 首頁>>代碼示例>>C#>>正文


C# SerializationInfo.GetUInt16方法代碼示例

本文整理匯總了C#中System.Runtime.Serialization.SerializationInfo.GetUInt16方法的典型用法代碼示例。如果您正苦於以下問題:C# SerializationInfo.GetUInt16方法的具體用法?C# SerializationInfo.GetUInt16怎麽用?C# SerializationInfo.GetUInt16使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Runtime.Serialization.SerializationInfo的用法示例。


在下文中一共展示了SerializationInfo.GetUInt16方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Key

        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);
            }

        }
開發者ID:thitiboy,項目名稱:low-level-sendkeys,代碼行數:34,代碼來源:Key.cs

示例2: Block

        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);
            }
        }
開發者ID:renezaal,項目名稱:dfLike,代碼行數:28,代碼來源:Block.cs

示例3: DigitalDefinition

 /// <summary>
 /// Creates a new <see cref="DigitalDefinition"/> 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 DigitalDefinition(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize digital definition
     m_normalStatus = info.GetUInt16("normalStatus");
     m_validInputs = info.GetUInt16("validInputs");
     m_label = info.GetString("digitalLabels");
 }
開發者ID:avs009,項目名稱:gsf,代碼行數:13,代碼來源:DigitalDefinition.cs

示例4: struct1

 public struct1(SerializationInfo info, StreamingContext context)
 {
     str1 = info.GetString("str1");
     str2 = info.GetString("str2");
     ulong1 = info.GetUInt64("ulong1");
     ushort1 = info.GetUInt16("ushort1");
     ushort2 = info.GetUInt16("ushort2");
 }
開發者ID:ehershey,項目名稱:development,代碼行數:8,代碼來源:IService1.cs

示例5: BaseSettings

        protected BaseSettings(SerializationInfo info, StreamingContext context)
        {
            SerializationInfoEnumerator infoEnum = info.GetEnumerator();
            while (infoEnum.MoveNext())
            {
                switch (infoEnum.Name)
                {
                    case "Name":
                        _name = info.GetString("Name");
                        break;

                    case "ContentType":
                        _contentType = (ContentType)info.GetValue("ContentType", typeof(ContentType));
                        break;

                    case "Order":
                        _order = info.GetUInt16("Order");
                        break;

                    case "Activated":
                        _activated = info.GetBoolean("Activated");
                        break;
                }
            }
        }
開發者ID:jordymeow,項目名稱:rincevent,代碼行數:25,代碼來源:BaseSettings.cs

示例6: struct2

        public struct2(SerializationInfo info, StreamingContext context)
        {
            data_len = info.GetInt32("data_len");
            ushort3 = info.GetUInt16("ushort3");
            data = (byte []) info.GetValue("data", typeof(byte[]));

        }
開發者ID:ehershey,項目名稱:development,代碼行數:7,代碼來源:IService1.cs

示例7: ConfigurationCell

 /// <summary>
 /// Creates a new <see cref="ConfigurationCell"/> 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 ConfigurationCell(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize configuration cell
     m_coordinateFormat = (CoordinateFormat)info.GetValue("coordinateFormat", typeof(CoordinateFormat));
     m_statusFlags = info.GetUInt16("statusFlags");
 }
開發者ID:avs009,項目名稱:gsf,代碼行數:12,代碼來源:ConfigurationCell.cs

示例8: Airplane

 public Airplane(SerializationInfo info, StreamingContext context)
 {
     Model = info.GetString("Model");
     Manufacturer = info.GetString("Manufacturer");
     Color = info.GetString("Color");
     Route = info.GetString("Route");
     ManufactureYear = info.GetUInt16("Year");
 }
開發者ID:Rafael-Miceli,項目名稱:ProjectStudiesCert70-536,代碼行數:8,代碼來源:Airplane.cs

示例9: ConnectionParameters

 /// <summary>
 /// Creates a new <see cref="ConnectionParameters"/> 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 ConnectionParameters(SerializationInfo info, StreamingContext context)
 {
     // Deserialize connection parameters
     m_timeOffset = info.GetInt64("timeOffset");
     m_frameRate = info.GetUInt16("frameRate");
     m_nominalFrequency = (LineFrequency)info.GetValue("nominalFrequency", typeof(LineFrequency));
     m_stationName = info.GetString("stationName");
 }
開發者ID:avs009,項目名稱:gsf,代碼行數:13,代碼來源:ConnectionParameters.cs

示例10: ConfigurationCellBase

 /// <summary>
 /// Creates a new <see cref="ConfigurationCellBase"/> 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 ConfigurationCellBase(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize configuration cell values
     StationName = info.GetString("stationName");
     IDLabel = info.GetString("idLabel");
     m_phasorDefinitions = (PhasorDefinitionCollection)info.GetValue("phasorDefinitions", typeof(PhasorDefinitionCollection));
     m_frequencyDefinition = (IFrequencyDefinition)info.GetValue("frequencyDefinition", typeof(IFrequencyDefinition));
     m_analogDefinitions = (AnalogDefinitionCollection)info.GetValue("analogDefinitions", typeof(AnalogDefinitionCollection));
     m_digitalDefinitions = (DigitalDefinitionCollection)info.GetValue("digitalDefinitions", typeof(DigitalDefinitionCollection));
     m_nominalFrequency = (LineFrequency)info.GetValue("nominalFrequency", typeof(LineFrequency));
     m_revisionCount = info.GetUInt16("revisionCount");
 }
開發者ID:avs009,項目名稱:gsf,代碼行數:18,代碼來源:ConfigurationCellBase.cs

示例11: Cpu

 protected Cpu(SerializationInfo info, StreamingContext ctx) : this()
 {
     A = info.GetByte("A");
     B = info.GetByte("B");
     C = info.GetByte("C");
     D = info.GetByte("D");
     E = info.GetByte("E");
     F = info.GetByte("F");
     H = info.GetByte("H");
     L = info.GetByte("L");
     SP = info.GetUInt16("SP");
     PC = info.GetUInt16("PC");
     IME = info.GetBoolean("IME");
 }
開發者ID:justinricheson,項目名稱:GameBoyEm,代碼行數:14,代碼來源:Cpu.cs

示例12: DigitalDefinition

 /// <summary>
 /// Creates a new <see cref="DigitalDefinition"/> 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 DigitalDefinition(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize digital definition
     m_statusFlags = info.GetUInt16("statusFlags");
 }
開發者ID:GridProtectionAlliance,項目名稱:gsf,代碼行數:11,代碼來源:DigitalDefinition.cs

示例13: MyKey

 public MyKey(SerializationInfo info, StreamingContext context)
 {
     try { m_value = info.GetUInt16("Value"); }
     catch { m_value = 0; }
     try { m_keyName = info.GetString("Key"); }
     catch { m_keyName = string.Empty; }
     try { m_action = (Action)info.GetValue("KeyAction", typeof(Action)); }
     catch { m_action = Action.KeyClick; }
     base.Text = m_keyName;
     base.SubItems.Add(m_value.ToString());
     base.SubItems.Add(((int)m_action).ToString());
 }
開發者ID:schultzisaiah,項目名稱:just-gestures,代碼行數:12,代碼來源:MyKey.cs

示例14: ChannelCellBase

 /// <summary>
 /// Creates a new <see cref="ChannelCellBase"/> 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 ChannelCellBase(SerializationInfo info, StreamingContext context)
 {
     // Deserialize basic channel cell values
     m_parent = (IChannelFrame)info.GetValue("parent", typeof(IChannelFrame));
     m_idCode = info.GetUInt16("id");
 }
開發者ID:rmc00,項目名稱:gsf,代碼行數:11,代碼來源:ChannelCellBase.cs

示例15: DataCellBase

 /// <summary>
 /// Creates a new <see cref="DataCellBase"/> 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 DataCellBase(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize data cell values
     m_configurationCell = (IConfigurationCell)info.GetValue("configurationCell", typeof(IConfigurationCell));
     m_statusFlags = info.GetUInt16("statusFlags");
     m_phasorValues = (PhasorValueCollection)info.GetValue("phasorValues", typeof(PhasorValueCollection));
     m_frequencyValue = (IFrequencyValue)info.GetValue("frequencyValue", typeof(IFrequencyValue));
     m_analogValues = (AnalogValueCollection)info.GetValue("analogValues", typeof(AnalogValueCollection));
     m_digitalValues = (DigitalValueCollection)info.GetValue("digitalValues", typeof(DigitalValueCollection));
     m_statusAssigned = true;
 }
開發者ID:GridProtectionAlliance,項目名稱:gsf,代碼行數:17,代碼來源:DataCellBase.cs


注:本文中的System.Runtime.Serialization.SerializationInfo.GetUInt16方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。