本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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
}
示例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;
}
示例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;
}
示例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);
}
示例8: GetAuxInfo
double GetAuxInfo(IniFile.Section section, int index)
{
return section.ReadDouble("AuxInfo(" + index.ToString() + ")");
}
示例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));
}
}
示例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")));
}
}