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


C# IniFile.ReadInt方法代码示例

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


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

示例1: LoadRules

		public override void LoadRules(IniFile.IniSection rules) {
			base.LoadRules(rules);

			Normalized = rules.ReadBool("Normalized");
			Translucent = rules.ReadBool("Translucent");
			IsTiberium = rules.ReadBool("IsTiberium");
			IsMeteor = rules.ReadBool("IsMeteor");
			Elasticity = rules.ReadFloat("Elasticity", 0.8f);
			MinAngularVelocity = rules.ReadFloat("MinAngularVelocity");
			MaxAngularVelocity = rules.ReadFloat("MaxAngularVelocity", 0.174528f);
			Duration = rules.ReadInt("Duration", 30);
			MinZVel = rules.ReadFloat("MinZVel", 3.5f);
			MaxZVel = rules.ReadFloat("MaxZVel", 5f);
			MaxXYVel = rules.ReadFloat("MaxXYVel", 15f);
			Spawns = Get<VoxelAnimation>(rules.ReadString("Spawns"));
			SpawnCount = rules.ReadInt("SpawnCount");
			ShareBodyData = rules.ReadBool("ShareBodyData");
			ShareTurretData = rules.ReadBool("ShareTurretData");
			ShareBarrelData = rules.ReadBool("ShareBarrelData");
			VoxelIndex = rules.ReadInt("VoxelIndex");
			StartSound = Get<Sound>(rules.ReadString("StartSound"));
			StopSound = Get<Sound>(rules.ReadString("StopSound"));
			BounceAnim = Get<Animation>(rules.ReadString("BounceAnim"));
			ExpireAnim = Get<Animation>(rules.ReadString("ExpireAnim"));
			TrailerAnim = Get<Animation>(rules.ReadString("TrailerAnim"));
			Damage = rules.ReadInt("Damage");
			DamageRadius = rules.ReadInt("DamageRadius");
			Warhead = Get<WarheadType>(rules.ReadString("Warhead"));
			AttachedSystem = Get<ParticleSystem>(rules.ReadString("AttachedSystem"));
			ShareSource = Get<TechnoType>(rules.ReadString("ShareSource"));
		}
开发者ID:dkeetonx,项目名称:ccmaps-net,代码行数:31,代码来源:VoxelAnimation.cs

示例2: LoadRules

		public override void LoadRules(IniFile.IniSection rules) {
			base.LoadRules(rules);

            WeaponType = rules.ReadEnum<WeaponType>("WeaponType", null);
			Action = rules.ReadEnum<Action>("Action", Action.MultiMissile);
			IsPowered = rules.ReadBool("IsPowered", true);
			DisableableFromShell = rules.ReadBool("DisableableFromShell");
			SidebarFlashTabFrames = rules.ReadInt("SidebarFlashTabFrames", -1);
			AIDefendAgainst = rules.ReadBool("AIDefendAgainst");
			PreClick = rules.ReadBool("PreClick");
			PostClick = rules.ReadBool("PostClick");
			ShowTimer = rules.ReadBool("ShowTimer");
			SpecialSound = Get<Sound>(rules.ReadString("SpecialSound"));
			StartSound = Get<Sound>(rules.ReadString("StartSound"));
			Range = rules.ReadFloat("Range", 0);
			LineMultiplier = rules.ReadInt("LineMultiplier", 0);
			Type = rules.ReadEnum<AbstractType>("Type", null);
			PreDependent = rules.ReadEnum<WeaponType>("PreDependent", null);
			AuxBuilding = Get<BuildingType>(rules.ReadString("AuxBuilding"));
			UseChargeDrain = rules.ReadBool("UseChargeDrain");
			ManualControl = rules.ReadBool("ManualControl");
			RechargeTime = rules.ReadFloat("RechargeTime", 5.0f);
			SidebarImage = rules.ReadString("SidebarImage", "");

		}
开发者ID:dkeetonx,项目名称:ccmaps-net,代码行数:25,代码来源:SuperWeaponType.cs

示例3: ReadIndices

        private IEnumerable<int> ReadIndices(IniFile.Section section, string key)
        {
            int index = 1;

            string currentKey = key + "#" + index.ToString();
            while (section.Entries.ContainsKey(currentKey))
            {
                yield return section.ReadInt(currentKey);
                index++;
                currentKey = key + "#" + index.ToString();
            }
        }
开发者ID:ondrej11,项目名称:o106,代码行数:12,代码来源:DGFReader.cs

示例4: 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

示例5: ProcessSG

        void ProcessSG(IniFile.Section section)
        {
            var type = section.ReadInt("Type");

            switch (type)
            {
                case 0: // Polygon
                    ReadPolygon(section);
                    break;
                case 1: // Bezier
                    ReadBezier(section);
                    break;
                case 2: // Vector
                    ReadVector(section);
                    break;
                default:
                    break;
            }
        }
开发者ID:ondrej11,项目名称:o106,代码行数:19,代码来源:DGFReader.cs

示例6: ReadAnalyticPoint

        void ReadAnalyticPoint(IniFile.Section section)
        {
            int numberOfPoints = section.ReadInt("NumberOfPoints");
            for (int i = 1; i < numberOfPoints; i++)
            {
                GetPoint(section, i);
            }

            string x = section["XS"];
            string y = section["YS"];

            var point = Factory.CreatePointByCoordinates(drawing, x, y);
            AddFigure(section, point);
            AddFigurePoint(section, point, 0);
        }
开发者ID:ondrej11,项目名称:o106,代码行数:15,代码来源:DGFReader.cs

示例7: ProcessGeneral

        void ProcessGeneral(IniFile.Section section)
        {
            var workArea = section["WorkArea"];
            if (workArea != null)
            {
                workArea = workArea.Trim('(', ')');
                var values = workArea.Split(',');
                var left = values[0];
                var bottom = values[1];
                var right = values[2];
                var top = values[3];
                var minX = double.Parse(left);
                var minY = double.Parse(bottom);
                var maxX = double.Parse(right);
                var maxY = double.Parse(top);
                drawing.CoordinateSystem.SetViewport(minX, maxX, minY, maxY);
            }

            var showAxes = section.ReadBool("ShowAxes", Settings.Instance.ShowGrid);
            var showGrid = section.ReadBool("ShowGrid", Settings.Instance.ShowGrid);

            drawing.CoordinateGrid.Visible = showAxes || showGrid;

            var pointCount = section.ReadInt("PointCount");
            points = new PointBase[pointCount + 1];

            var figureCount = section.ReadInt("FigureCount");
            figures = new IFigure[figureCount];

            var labelCount = section.ReadInt("LabelCount");
            labels = new LabelBase[labelCount + 1];

            var buttonCount = section.ReadInt("ButtonCount");
            buttons = new ShowHideControl[buttonCount + 1];

            var staticGraphicCount = section.ReadInt("StaticGraphicCount");
            staticGraphics = new IFigure[staticGraphicCount + 1];
        }
开发者ID:ondrej11,项目名称:o106,代码行数:38,代码来源:DGFReader.cs

示例8: 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

示例9: ProcessFigure

        void ProcessFigure(IniFile.Section section)
        {
            var figureType = section.ReadInt("FigureType");

            switch (figureType)
            {
                case 1: // Segment
                    ReadSegment(section);
                    break;
                case 2: // Ray
                    ReadRay(section);
                    break;
                case 3: // Line
                    ReadLine2Points(section);
                    break;
                case 4: // ParallelLine
                    ReadParallelLine(section);
                    break;
                case 5: // PerpendicularLine
                    ReadPerpendicularLine(section);
                    break;
                case 6: // Circle
                    ReadCircle(section);
                    break;
                case 7: // CircleByRadius
                    ReadCircleByRadius(section);
                    break;
                case 8: // Arc
                    ReadArc(section);
                    break;
                case 9: // MidPoint
                    ReadMidPoint(section);
                    break;
                case 10: // SymmPoint
                    ReadSymmPoint(section);
                    break;
                case 11: // SymmPointByLine
                    ReadSymmPointByLine(section);
                    break;
                case 12: // InvertedPoint
                    ReadInvertedPoint(section);
                    break;
                case 13: // IntersectionPoint
                    ReadIntersectionPoint(section);
                    break;
                case 14: // PointOnFigure
                    ReadPointOnFigure(section);
                    break;
                case 15: // MeasureDistance
                    ReadMeasureDistance(section);
                    break;
                case 16: // MeasureAngle
                    ReadMeasureAngle(section);
                    break;
                case 17: // AnLineGeneral
                    ReadAnalyticLineGeneral(section);
                    break;
                case 21: // AnCircle
                    ReadAnalyticCircle(section);
                    break;
                case 22: // AnalyticPoint
                    ReadAnalyticPoint(section);
                    break;
                case 23: // Locus
                    ReadLocus(section);
                    break;
                case 24: // AngleBisector
                    ReadAngleBisector(section);
                    break;
                default:
                    break;
            }
        }
开发者ID:ondrej11,项目名称:o106,代码行数:73,代码来源:DGFReader.cs

示例10: 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

示例11: GetPointList

        IList<IFigure> GetPointList(IniFile.Section section)
        {
            int numberOfPoints = section.ReadInt("NumberOfPoints");
            var result = new List<IFigure>();
            for (int i = 1; i <= numberOfPoints; i++)
            {
                var point = GetPoint(section, i);
                result.Add(point);
            }

            return result;
        }
开发者ID:ondrej11,项目名称:o106,代码行数:12,代码来源:DGFReader.cs

示例12: GetPointIndex

 int GetPointIndex(IniFile.Section section, int index)
 {
     if (section["Points" + index.ToString()] != null)
     {
         return section.ReadInt("Points" + index.ToString());
     }
     return section.ReadInt("Point" + index.ToString());
 }
开发者ID:ondrej11,项目名称:o106,代码行数:8,代码来源:DGFReader.cs

示例13: GetParent

 IFigure GetParent(IniFile.Section section, int index)
 {
     var parentIndex = section.ReadInt("Parents" + index.ToString());
     var pointSectionTitle = "Figure" + parentIndex.ToString();
     EnsureSectionProcessed(pointSectionTitle);
     return figures[parentIndex];
 }
开发者ID:ondrej11,项目名称:o106,代码行数:7,代码来源:DGFReader.cs


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