Exemplo n.º 1
0
 void AddFigure(IniFile.Section section, IFigure figure)
 {
     Actions.Add(drawing, figure);
     figures[section.GetTitleNumber("Figure")] = figure;
 }
Exemplo n.º 2
0
 void ReadPolygon(IniFile.Section section)
 {
     var polygon = Factory.CreatePolygon(
         drawing, GetPointList(section));
     Actions.Add(drawing, polygon);
     SetFigureStyle(section, polygon);
     staticGraphics[section.GetTitleNumber("SG")] = polygon;
 }
Exemplo n.º 3
0
 void ReadVector(IniFile.Section section)
 {
     var vector = Factory.CreateVector(
         drawing, GetPointList(section));
     Actions.Add(drawing, vector);
     SetFigureStyle(section, vector);
     staticGraphics[section.GetTitleNumber("SG")] = vector;
 }
Exemplo n.º 4
0
 void ReadBezier(IniFile.Section section)
 {
     var bezier = Factory.CreateBezier(
         drawing, GetPointList(section));
     Actions.Add(drawing, bezier);
     SetFigureStyle(section, bezier);
     staticGraphics[section.GetTitleNumber("SG")] = bezier;
 }
Exemplo n.º 5
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");
            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;
        }
Exemplo 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.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
 }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
 void AddLabelFigure(IniFile.Section section, IFigure figure)
 {
     //SetLabelStyle(section, figure);
     Actions.Add(drawing, figure);
     figures[section.GetTitleNumber("Figure")] = figure;
 }