Пример #1
0
        /// <summary>
        /// Create a property dialog for an existing source
        /// </summary>
        /// <param name="source">Source of type ObsSource</param>
        public TestProperties(ObsSource source)
            : this()
        {
            this.source = source;
            ObsData sourceSettings = source.GetSettings();

            view = new PropertiesView(sourceSettings, source, source.GetProperties, source.GetDefaults, source.Update);
            propertyPanel.Controls.Add(view);

            undoButton.Click += (sender, args) =>
            {
                view.ResetChanges();
            };

            defaultButton.Click += (sender, args) =>
            {
                view.ResetToDefaults();
            };

            okButton.Click += (o, args) =>
            {
                view.UpdateSettings();
                DialogResult = DialogResult.OK;
                Close();
            };

            cancelButton.Click += (o, args) =>
            {
                view.ResetChanges();
                DialogResult = DialogResult.Cancel;
                Close();
            };
        }
Пример #2
0
 public SourcePreviewPanel(ObsSource source)
 {
     this.source = source;
 }
Пример #3
0
 public ItemPreviewPanel(Item item, ObsSource source)
 {
     this._item   = item;
     this._source = source;
 }