Example #1
0
        public SettingsPage(Feature[] features)
        {
            InitializeComponent();

            int i = 0;

            foreach (Feature feature in features)
            {
                FeatureSettings settings = feature.GetSettings();
                if (settings != null)
                {
                    settings.Settings = this;
                    _featuresDirty.Add(settings, false);

                    // Wrap in a group box
                    GroupBox wrapper = new GroupBox();
                    wrapper.Text = feature.DisplayName;
                    wrapper.Controls.Add(settings);
                    wrapper.Anchor    = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Right;
                    wrapper.AutoSize  = true;
                    wrapper.Margin    = new Padding(5);
                    wrapper.Padding   = new Padding(5);
                    settings.Location = Point.Empty;
                    settings.Dock     = DockStyle.Fill;

                    tableMain.RowStyles.Insert(i, new RowStyle(SizeType.AutoSize));
                    tableMain.SetRow(wrapper, i);
                    tableMain.Controls.Add(wrapper, 0, i);
                    ++i;
                    tableMain.RowCount = i + 1;
                }
            }
            CheckDirty();
        }
Example #2
0
 internal void SetFeatureDirty(FeatureSettings feature, bool dirty)
 {
     _featuresDirty[feature] = dirty;
     CheckDirty();
 }