private void TestForm_Load(object sender, EventArgs e) { if (Environment.Is64BitProcess) { Text += " (64-bit)"; } else { Text += " (32-bit)"; } presentation = new Presentation(); // Bindings // Scene SceneListBox.DisplayMember = "Name"; SceneListBox.ValueMember = "Items"; SceneListBox.DataSource = presentation.Scenes; // Item ItemListBox.DisplayMember = "Name"; // Source SourceListBox.DisplayMember = "Name"; SourceListBox.DataSource = presentation.Sources; presentation.AddScene(); ItemListBox.DataSource = SceneListBox.SelectedValue; var source = presentation.CreateSource("random", "some random source"); presentation.AddSource(source); var item = presentation.CreateItem(source); presentation.AddItem(item); presentation.SetScene(SceneListBox.SelectedIndex); presentation.SetItem(ItemListBox.SelectedIndex); presentation.SetSource(SourceListBox.SelectedIndex); HideItemCheckBox.DataBindings.Add( new Binding("Checked", presentation.SelectedItem, "Visible", false, DataSourceUpdateMode.OnPropertyChanged)); EnableSourceCheckBox.DataBindings.Add( new Binding("Checked", presentation.SelectedSource, "Enabled", false, DataSourceUpdateMode.OnPropertyChanged)); MuteSourceCheckBox.DataBindings.Add( new Binding("Checked", presentation.SelectedSource, "Muted", false, DataSourceUpdateMode.OnPropertyChanged)); // setup scene preview panel previewPanel = new PreviewPanel(); previewPanel.Dock = DockStyle.Fill; topPanel.Controls.Add(previewPanel); previewPanel.Show(); previewPanel.SetScene(presentation.SelectedScene); }
private void AddSceneButton_Click(object sender, EventArgs e) { presentation.AddScene(); SceneListBox.SelectedIndex = SceneListBox.Items.Count - 1; }