当前位置: 首页>>代码示例>>C#>>正文


C# SerializationInfo.GetDouble方法代码示例

本文整理汇总了C#中SerializationInfo.GetDouble方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetDouble方法的具体用法?C# SerializationInfo.GetDouble怎么用?C# SerializationInfo.GetDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SerializationInfo的用法示例。


在下文中一共展示了SerializationInfo.GetDouble方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Dot

 public Dot(SerializationInfo info, StreamingContext ctxt)
 {
     x = info.GetDouble("X");
     y = info.GetDouble("Y");
     byte[] colorBytes = (byte[])info.GetValue("Color", typeof(byte[]));
     colorA = colorBytes[0];
     colorR = colorBytes[1];
     colorG = colorBytes[2];
     colorB = colorBytes[3];
     radius = info.GetDouble("Radius");
 }
开发者ID:TheAaltoWindrawTeam,项目名称:AaltoWindraw,代码行数:11,代码来源:Dot.cs

示例2: BehaviorTreeEditorSettings

    public BehaviorTreeEditorSettings(SerializationInfo info, StreamingContext context)
    {
        LabelWidth = (float)info.GetDouble(_prefix + _labelWidthPrefs);
        EditableFieldsWidth = (float)info.GetDouble(_prefix + _editableWidthPrefs);
        ButtonWidth = (float)info.GetDouble(_prefix + _buttonWidthPrefs);

        ElementHeight = (float)info.GetDouble(_prefix + _elementHeightPrefs);
        ElementWidth = (float)info.GetDouble(_prefix + _elementWidthPrefs);
        HorizontalSpaceBetweenElements = (float)info.GetDouble(_prefix + _horizontalSpacePrefs);
        VerticalSpaceBetweenElements = (float)info.GetDouble(_prefix + _verticalSpacePrefs);

        SequenceBackgroundColor = new Color();
        SequenceBackgroundColor.r = (float)info.GetDouble(_prefix + _sequenceColorRPrefs);
        SequenceBackgroundColor.b = (float)info.GetDouble(_prefix + _sequenceColorBPrefs);
        SequenceBackgroundColor.g = (float)info.GetDouble(_prefix + _sequenceColorGPrefs);
        SequenceBackgroundColor.a = 1.0f;

        SelectorBackgroundColor = new Color();
        SelectorBackgroundColor.r = (float)info.GetDouble(_prefix + _selectorColorRPrefs);
        SelectorBackgroundColor.b = (float)info.GetDouble(_prefix + _selectorColorBPrefs);
        SelectorBackgroundColor.g = (float)info.GetDouble(_prefix + _selectorColorGPrefs);
        SelectorBackgroundColor.a = 1.0f;

        DecoratorBackgroundColor = new Color();
        DecoratorBackgroundColor.r = (float)info.GetDouble(_prefix + _decoratorColorRPrefs);
        DecoratorBackgroundColor.b = (float)info.GetDouble(_prefix + _decoratorColorBPrefs);
        DecoratorBackgroundColor.g = (float)info.GetDouble(_prefix + _decoratorColorGPrefs);
        DecoratorBackgroundColor.a = 1.0f;

        TaskBackgroundColor = new Color();
        TaskBackgroundColor.r = (float)info.GetDouble(_prefix + _taskColorRPrefs);
        TaskBackgroundColor.b = (float)info.GetDouble(_prefix + _taskColorBPrefs);
        TaskBackgroundColor.g = (float)info.GetDouble(_prefix + _taskColorGPrefs);
        TaskBackgroundColor.a = 1.0f;

        AddButtonBackgroundColor = new Color();
        AddButtonBackgroundColor.r = (float)info.GetDouble(_prefix + _addButtonColorRPrefs);
        AddButtonBackgroundColor.b = (float)info.GetDouble(_prefix + _addButtonColorBPrefs);
        AddButtonBackgroundColor.g = (float)info.GetDouble(_prefix + _addButtonColorGPrefs);
        AddButtonBackgroundColor.a = 1.0f;

        RemoveButtonBackgroundColor = new Color();
        RemoveButtonBackgroundColor.r = (float)info.GetDouble(_prefix + _removeButtonColorRPrefs);
        RemoveButtonBackgroundColor.b = (float)info.GetDouble(_prefix + _removeButtonColorBPrefs);
        RemoveButtonBackgroundColor.g = (float)info.GetDouble(_prefix + _removeButtonColorGPrefs);
        RemoveButtonBackgroundColor.a = 1.0f;

        SideMenuRect = new Rect(0, 0, 0, 0);
        SideMenuRect.width = (float)info.GetDouble(_prefix + _sideMenuWidth);
        SideMenuRect.height = (float)info.GetDouble(_prefix + _sideMenuHeight);

        Init();
    }
开发者ID:vansten,项目名称:Diploma,代码行数:53,代码来源:BehaviorTreeEditorSettings.cs

示例3: runTest


//.........这里部分代码省略.........
					strLoc="Loc_7573cd_" + i;
					ui32Value = (uint)(UInt32.MaxValue * rnd1.NextDouble());
					strValue = "UInt32_" + i;
					serinfo1.AddValue(strValue, ui32Value);
					iCountTestcases++;
					if(serinfo1.GetUInt32(strValue)!= ui32Value)
					{
						iCountErrors++;
						Console.WriteLine("Err_4738cd_" + i + "! Wrong value returned, " + serinfo1.GetUInt32(strValue));
					}
				}
				Console.WriteLine("UInt64 ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_63dc_" + i;
					ui64Value = (ulong)(UInt64.MaxValue * rnd1.NextDouble());
					strValue = "UInt64_" + i;
					serinfo1.AddValue(strValue, ui64Value);
					iCountTestcases++;
					if(serinfo1.GetUInt64(strValue)!= ui64Value)
					{
						iCountErrors++;
						Console.WriteLine("Err_6583fd_" + i + "! Wrong value returned, " + serinfo1.GetUInt64(strValue));
					}
				}
				Console.WriteLine("Double ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_7539cd_" + i;
					dblValue = Double.MaxValue * rnd1.NextDouble();
					if(rnd1.NextDouble()<0.5)
					dblValue = (-1 * dblValue);
					strValue = "Double_" + i;
					serinfo1.AddValue(strValue, dblValue);
					iCountTestcases++;
					if(serinfo1.GetDouble(strValue)!= dblValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_653cfd_" + i + "! Wrong value returned, " + serinfo1.GetDouble(strValue));
					}
				}
				Console.WriteLine("Single ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_0247fd_" + i;
					sglValue = (float)(Single.MaxValue * rnd1.NextDouble());
					if(rnd1.NextDouble()<0.5)
					sglValue = (-1 * sglValue);
					strValue = "Single_" + i;
					serinfo1.AddValue(strValue, sglValue);
					iCountTestcases++;
					if(serinfo1.GetSingle(strValue)!= sglValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_0468fd_" + i + "! Wrong value returned, " + serinfo1.GetSingle(strValue));
					}
				}
				strValue = "This is a String";
				serinfo1.AddValue("String_1", strValue);
				iCountTestcases++;
				if(!serinfo1.GetString("String_1").Equals(strValue))
				{
					iCountErrors++;
					Console.WriteLine("Err_0945csd! wrong value returned, " + serinfo1.GetString("String_1"));
				}
				strValue = "";
				serinfo1.AddValue("String_2", strValue);
				iCountTestcases++;
				if(!serinfo1.GetString("String_2").Equals(String.Empty))
开发者ID:ArildF,项目名称:masters,代码行数:67,代码来源:co3888get_most.cs


注:本文中的SerializationInfo.GetDouble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。