Ejemplo n.º 1
0
        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");
            var point = Factory.CreateFreePoint(drawing, new Point(x, y));

            point.Name = section["Name"];
            SetPointStyle(section, point);
            Actions.Actions.Add(drawing, point);
            var pointIndex = section.GetTitleNumber("Point");

            points[pointIndex] = point;
        }
Ejemplo n.º 2
0
        void ProcessButton(IniFile.Section section)
        {
            var type = section.ReadInt("Type");

            if (type != 0)
            {
                return;
            }

            var 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.Actions.Add(drawing, button);

            var 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;
        }
Ejemplo n.º 3
0
        void ReadPolygon(IniFile.Section section)
        {
            var polygon = Factory.CreatePolygon(
                drawing, GetPointList(section));

            Actions.Actions.Add(drawing, polygon);
            SetFigureStyle(section, polygon);
            staticGraphics[section.GetTitleNumber("SG")] = polygon;
        }
Ejemplo n.º 4
0
        void ReadBezier(IniFile.Section section)
        {
            var bezier = Factory.CreateBezier(
                drawing, GetPointList(section));

            Actions.Actions.Add(drawing, bezier);
            SetFigureStyle(section, bezier);
            staticGraphics[section.GetTitleNumber("SG")] = bezier;
        }
Ejemplo n.º 5
0
        void ReadVector(IniFile.Section section)
        {
            var vector = Factory.CreateVector(
                drawing, GetPointList(section));

            Actions.Actions.Add(drawing, vector);
            SetFigureStyle(section, vector);
            staticGraphics[section.GetTitleNumber("SG")] = vector;
        }
Ejemplo n.º 6
0
        void ProcessLabel(IniFile.Section section)
        {
            var label = Factory.CreateLabel(drawing);

            label.MoveTo(section.ReadDouble("X"), section.ReadDouble("Y"));
            SetLabelStyle(section, label);
            Actions.Actions.Add(drawing, label);
            labels[section.GetTitleNumber("Label")] = label;
            var 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
        }
Ejemplo n.º 7
0
 void AddLabelFigure(IniFile.Section section, IFigure figure)
 {
     //SetLabelStyle(section, figure);
     Actions.Actions.Add(drawing, figure);
     figures[section.GetTitleNumber("Figure")] = figure;
 }
Ejemplo n.º 8
0
 void AddFigure(IniFile.Section section, IFigure figure)
 {
     Actions.Actions.Add(drawing, figure);
     figures[section.GetTitleNumber("Figure")] = figure;
 }