Exemplo n.º 1
0
        private void NewModulatedKrystal()
        {
            using (NewModulationDialog kd = new NewModulationDialog())
            {
                DialogResult      result   = kd.ShowDialog();
                ModulationKrystal mKrystal = null;
                if (result == DialogResult.OK)
                {
                    if (string.IsNullOrEmpty(kd.XInputFilepath) || string.IsNullOrEmpty(kd.YInputFilepath))
                    {
                        MessageBox.Show("Both the XInput and the YInput krystals must be set.",
                                        "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        NewModulatedKrystal(); // recursive call
                    }
                    else if (kd.ModulationKrystal != null)
                    {
                        mKrystal = kd.ModulationKrystal;
                    }
                    else
                    {
                        mKrystal = new ModulationKrystal(kd.XInputFilepath,
                                                         kd.YInputFilepath,
                                                         kd.ModulatorFilepath);
                    }

                    ModulationEditor editor = new ModulationEditor(mKrystal);
                    editor.EventHandler = new ModulationEditor.ModulationEditorEventHandler(HandleModulationEditorEvents);
                    editor.Show();
                }
            }
        }
Exemplo n.º 2
0
        private void NewModulatedKrystal()
        {
            using(NewModulationDialog kd = new NewModulationDialog())
            {
                DialogResult result = kd.ShowDialog();
                ModulationKrystal mKrystal = null;
                if(result == DialogResult.OK)
                {
                    if(string.IsNullOrEmpty(kd.XInputFilepath) || string.IsNullOrEmpty(kd.YInputFilepath))
                    {
                        MessageBox.Show("Both the XInput and the YInput krystals must be set.",
                            "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        NewModulatedKrystal(); // recursive call
                    }
                    else if(kd.ModulationKrystal != null)
                        mKrystal = kd.ModulationKrystal;
                    else
                        mKrystal = new ModulationKrystal(kd.XInputFilepath,
                                                   kd.YInputFilepath,
                                                   kd.ModulatorFilepath);

                    ModulationEditor editor = new ModulationEditor(mKrystal);
                    editor.EventHandler = new ModulationEditor.ModulationEditorEventHandler(HandleModulationEditorEvents);
                    editor.Show();
                }
            }
        }