Example #1
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;
        }
Example #2
0
        private void ReadButtonDependencies(IniFile.Section section, ShowHideControl button)
        {
            var dependencies = new List <IFigure>();

            AddButtonDependencies(section, dependencies, "Button", buttons);
            AddButtonDependencies(section, dependencies, "Figure", figures);
            AddButtonDependencies(section, dependencies, "Label", labels);
            AddButtonDependencies(section, dependencies, "Point", points);
            AddButtonDependencies(section, dependencies, "SG", staticGraphics);

            button.AddDependencies(dependencies);
        }