当前位置: 首页>>代码示例>>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;未经允许,请勿转载。