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


C# IniFile.ReadDouble方法代码示例

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


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

示例1: Lighting

		public Lighting(IniFile.IniSection iniSection) {
			Level = iniSection.ReadDouble("Level", 0.032);
			Ambient = iniSection.ReadDouble("Ambient", 1.0);
			Red = iniSection.ReadDouble("Red", 1.0);
			Green = iniSection.ReadDouble("Green", 1.0);
			Blue = iniSection.ReadDouble("Blue", 1.0);
			Ground = iniSection.ReadDouble("Ground", 0.0);

			logger.Trace("Lighting loaded: level: {0}, ambient: {1}, red: {2}, green: {3}, blue: {4}, ground: {5}",
				Level, Ambient, Red, Green, Blue, Ground);
		}
开发者ID:dkeetonx,项目名称:ccmaps-net,代码行数:11,代码来源:Lighting.cs

示例2: ReadAnalyticCircle

        void ReadAnalyticCircle(IniFile.Section section)
        {
            double a = section.ReadDouble("AuxInfo(1)");
            double b = section.ReadDouble("AuxInfo(2)");
            double c = section.ReadDouble("AuxInfo(3)");

            double x = -a / 2;
            double y = -b / 2;
            double r = (a * a / 4 + b * b / 4 - c).SquareRoot();

            var figure = Factory.CreateCircleByEquation(
                drawing,
                x.ToStringInvariant(),
                y.ToStringInvariant(),
                r.ToStringInvariant());
            SetFigureStyle(section, figure);
            AddFigure(section, figure);
        }
开发者ID:ondrej11,项目名称:o106,代码行数:18,代码来源:DGFReader.cs

示例3: SetPointStyle

        void SetPointStyle(IniFile.Section section, IFigure figure)
        {
            figure.Visible = !section.ReadBool("Hide", false) && section.ReadBool("Visible", true);

            var fillColor = section.ReadColor("FillColor");
            var fillStyle = section.ReadInt("FillStyle");
            var foreColor = section.ReadColor("ForeColor");
            var physicalWidth = section.ReadDouble("PhysicalWidth");
            if (fillStyle == 1)
            {
                fillColor = Colors.Transparent;
            }

            PointStyle pointStyle = new PointStyle()
            {
                Fill = new SolidColorBrush(fillColor),
                Color = foreColor,
                Size = physicalWidth,
                StrokeWidth = 0.7
            };

            figure.Style = drawing.StyleManager.FindExistingOrAddNew(pointStyle);
        }
开发者ID:ondrej11,项目名称:o106,代码行数:23,代码来源:DGFReader.cs

示例4: ProcessLabel

 void ProcessLabel(IniFile.Section section)
 {
     var label = Factory.CreateLabel(drawing);
     label.MoveTo(section.ReadDouble("X"), section.ReadDouble("Y"));
     SetLabelStyle(section, label);
     Actions.Add(drawing, label);
     labels[section.GetTitleNumber("Label")] = label;
     string text = section["Caption"].Replace("~~", Environment.NewLine);
     if (section["Charset"] == "0")
     {
         text = text.Replace('І', '²');
     }
     #if !PLAYER
     drawing.ActionManager.SetProperty(label, "Text", text);
     #else
     label.Text = text;
     #endif
 }
开发者ID:ondrej11,项目名称:o106,代码行数:18,代码来源:DGFReader.cs

示例5: ProcessPoint

        void ProcessPoint(IniFile.Section section)
        {
            var type = section.ReadInt("Type");
            var parentFigure = section["ParentFigure"];
            if (!parentFigure.IsEmpty())
            {
                EnsureSectionProcessed("Figure" + parentFigure);
                return;
            }

            if (type == 8)
            {
                FindAndProcessArcWithPoint(section.GetTitleNumber("Point"));
                return;
            }

            if (type == 9)
            {
                FindAndProcessMidPoint(section.GetTitleNumber("Point"));
                return;
            }

            var x = section.ReadDouble("X");
            var y = section.ReadDouble("Y");
            FreePoint point = Factory.CreateFreePoint(drawing, new Point(x, y));

            point.Name = section["Name"];
            SetPointStyle(section, point);
            Actions.Add(drawing, point);
            int pointIndex = section.GetTitleNumber("Point");
            points[pointIndex] = point;
        }
开发者ID:ondrej11,项目名称:o106,代码行数:32,代码来源:DGFReader.cs

示例6: ProcessButton

        void ProcessButton(IniFile.Section section)
        {
            int type = section.ReadInt("Type");
            if (type != 0)
            {
                return;
            }

            ShowHideControl button = new ShowHideControl();
            button.Drawing = drawing;
            button.Checkbox.IsChecked = section.ReadBool("InitiallyVisible", false);
            button.AddDependencies(GetPointList(section));
            button.MoveTo(section.ReadDouble("X"), section.ReadDouble("Y"));
            SetButtonStyle(section, button);
            Actions.Add(drawing, button);

            string text = section["Caption"].Replace("~~", Environment.NewLine);
            if (section["Charset"] == "0")
            {
                text = text.Replace('I', '²');
            }

            button.Checkbox.Content = text;

            ReadButtonDependencies(section, button);

            button.UpdateFigureVisibility();
            buttons[section.GetTitleNumber("Button")] = button;
        }
开发者ID:ondrej11,项目名称:o106,代码行数:29,代码来源:DGFReader.cs

示例7: GetAuxPoint

 Point GetAuxPoint(IniFile.Section section, int index)
 {
     double x = section.ReadDouble("AuxPoints(" + index.ToString() + ").X");
     double y = section.ReadDouble("AuxPoints(" + index.ToString() + ").Y");
     return new Point(x, y);
 }
开发者ID:ondrej11,项目名称:o106,代码行数:6,代码来源:DGFReader.cs

示例8: GetAuxInfo

 double GetAuxInfo(IniFile.Section section, int index)
 {
     return section.ReadDouble("AuxInfo(" + index.ToString() + ")");
 }
开发者ID:ondrej11,项目名称:o106,代码行数:4,代码来源:DGFReader.cs

示例9: WriteDouble

 public void WriteDouble()
 {
     using (IniFile ini = new IniFile(fileName)) {
         Assert.AreNotEqual(23.42, ini.ReadDouble("Section1",
                                                  "doesnotexist", 0));
         ini.WriteDouble("Section1", "doesnotexist", 23.42);
         Assert.AreEqual(23.42, ini.ReadDouble("Section1",
                                               "doesnotexist", 0));
     }
 }
开发者ID:d0k,项目名称:ninifile,代码行数:10,代码来源:IniTest.cs

示例10: ReadDouble

 public void ReadDouble()
 {
     using (IniFile ini = new IniFile(fileName)) {
         Assert.AreEqual(1.23, ini.ReadDoubleInvariant("Test", "d", 0));
         Assert.AreEqual(1.23, ini.ReadDouble("Test", "d2", 0,
                         CultureInfo.GetCultureInfo("de-DE")));
     }
 }
开发者ID:d0k,项目名称:ninifile,代码行数:8,代码来源:IniTest.cs


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