示例#1
0
        public SettingsForm(DataProvider aData)
        {
            InitializeComponent();
            this.MinimizeBox   = false;
            this.ShowInTaskbar = false;
            fData          = aData;
            StartPosition  = FormStartPosition.CenterParent;
            DoubleBuffered = true;
            fMenuSettings  = new DataView();
            DataViewParams c = new DataViewParams();

            c.dataProvider = aData;
            controlContainer1.AutoScroll = true;
            c.container            = controlContainer1;
            c.descriptionContainer = controlContainer2;

            c.placement.TitleMaxWidth   = 250;
            c.placement.ControlMaxWidth = 150;
            fMenuSettings.Create(c);
            this.MouseWheel            += SettingsForm_MouseWheel;
            c.dataProvider.ItemChanged += root_ItemChanged;
        }
示例#2
0
        private void Initialize()
        {
            fView              = new DataView();
            fData              = new DataProvider(ItemTree.FromFile(SettingsFilePath));
            fData.ItemChanged += fData_ItemChanged;


            //Create manually view[1]
            fDataViewParams = new DataViewParams
            {
                container            = userControl11,
                descriptionContainer = controlContainer1,
                dataProvider         = fData
            };

            LoadSettings();
            fData.DataBinding = fUserSettings;
            fView.Create(fDataViewParams);

            //Create view[2] with predefined 'SettingsForm' from the same data provider
            fSettingsForm         = new SettingsForm(fData);
            fSettingsForm.OnSave += fSettingsForm_OnSave;
            fSettingsForm.Show();
        }