Example #1
0
        private void Populate()
        {
            _options = PieGraphOptions.Load(_optionsName);

            NameLabel.Text = _optionsName;

            HeightInput.Value = _options.Height;
            WidthInput.Value  = _options.Width;

            MarginTop.Value    = _options.MarginTop;
            MarginBottom.Value = _options.MarginBottom;
            MarginLeft.Value   = _options.MarginLeft;
            MarginRight.Value  = _options.MarginRight;

            ChromaKey.BackColor = _options.ChromaKey;
            TransparentBackground.CheckState = _options.TransparentBackground
                ? CheckState.Checked
                : CheckState.Unchecked;
            Option1Color.BackColor = _options.Option1Color;
            Option2Color.BackColor = _options.Option2Color;
            Option3Color.BackColor = _options.Option3Color;
            Option4Color.BackColor = _options.Option4Color;

            _optionLabelFont          = _options.OptionFont;
            OptionFontColor.BackColor = _options.OptionFontColor;

            _countFont = _options.CountFont;
            CountFontColor.BackColor = _options.CountFontColor;

            _totalFont = _options.TitleFont;
            TotalFontColor.BackColor = _options.TitleFontColor;

            TotalPosition.SelectedItem = _options.TotalPosition;
        }
Example #2
0
        private void CopyButton_Click(object sender, EventArgs e)
        {
            InputBoxResult result;

            switch (_options[List.SelectedIndex].Type)
            {
            case "Bar":
                result = InputBox.Show("Copy To:", "Copy Bar Graph", "", BarGraphOptions.ValidateNameHandler);
                if (result.Ok)
                {
                    var o = BarGraphOptions.Load(_options[List.SelectedIndex].Name);
                    o.Save(result.Text);
                }
                break;

            case "Pie":
                result = InputBox.Show("Copy To:", "Copy Pie Graph", "", BarGraphOptions.ValidateNameHandler);
                if (result.Ok)
                {
                    var o = PieGraphOptions.Load(_options[List.SelectedIndex].Name);
                    o.Save(result.Text);
                }
                break;

            default:
                throw new Exception("Unknown Type: " + _options[List.SelectedIndex].Type);
            }
            PopulateList();
        }
Example #3
0
 private void ReadOptions()
 {
     _options = PieGraphOptions.Load(_optionsName);
 }