コード例 #1
0
        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);
        }
コード例 #2
0
 private void AddSceneButton_Click(object sender, EventArgs e)
 {
     presentation.AddScene();
     SceneListBox.SelectedIndex = SceneListBox.Items.Count - 1;
 }