private void _AddApplicationMenu() { if (_AppSupportsCommands()) { AppCommand toolsMenu = _GetToolsMenu(); AppCommand showCommand = new AppCommand(MENU_ID_ROOT, "Web Server"); showCommand.Click += async(sender, e) => { using (Settings cs = new Settings(_data)) { cs.SettingsChanged += cs_SettingsChanged; if (cs.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _data.HttpPort = cs.Port; _data.IsEnabled = cs.WebServerEnabled; await VixenSystem.SaveModuleConfigAsync(); } _SetServerEnableState(_data.IsEnabled, _data.HttpPort); } }; toolsMenu.Add(showCommand); } }
public void CreateMenu() { AppCommand schedulerMenu = GetSchedulerMenu(); AppCommand showCommand = new AppCommand("SuperSchedulerCreateSchedule", "Schedules"); showCommand.Click += (sender, e) => { using (SetupForm form = new SetupForm(_data)) { if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { } } }; LatchedAppCommand enabledCommand = new LatchedAppCommand("SuperSchedulerEnabled", "Enabled"); enabledCommand.IsChecked = _data.IsEnabled; enabledCommand.Checked += async(sender, e) => { _data.IsEnabled = e.CheckedState; await VixenSystem.SaveModuleConfigAsync(); }; /*if (schedulerMenu.Items.Length > 0) * schedulerMenu.Add(new AppCommand("s1", "-"));*/ schedulerMenu.Add(showCommand); schedulerMenu.Add(new AppCommand("s1", "-")); schedulerMenu.Add(enabledCommand); }
private void SetupForm_Closing(object sender, CancelEventArgs e) { if (_isDirty) { VixenSystem.SaveModuleConfigAsync(); } }
/// <summary> /// Called to complete a bulk update operation /// </summary> public async void EndBulkUpdate() { _bulkUpdating = false; _GradientsChanged(_bulkGradientChangeNames); _bulkGradientChangeNames = null; await VixenSystem.SaveModuleConfigAsync(); }
private void VixenApp_FormClosing(object sender, FormClosingEventArgs e) { stopping = true; VixenSystem.Stop(); _applicationData.SaveData(); }
public bool AddColorGradient(string name, ColorGradient cg) { if (name == string.Empty) { return(false); } bool inLibrary = Contains(name); if (inLibrary) { Library[name].IsCurrentLibraryGradient = false; } cg.IsCurrentLibraryGradient = true; cg.LibraryReferenceName = string.Empty; Library[name] = cg; if (!_bulkUpdating) { _GradientsChanged(new [] { name }); VixenSystem.SaveModuleConfigAsync(); } else { _bulkGradientChangeNames.Add(name); } return(inLibrary); }
public bool AddCurve(string name, Curve curve) { if (name == string.Empty) { return(false); } bool inLibrary = Contains(name); if (inLibrary) { Library[name].IsCurrentLibraryCurve = false; } curve.IsCurrentLibraryCurve = true; curve.LibraryReferenceName = string.Empty; Library[name] = curve; if (!_bulkUpdating) { _CurvesChanged(new [] { name }); VixenSystem.SaveModuleConfigAsync(); } else { _bulkCurveChangeNames.Add(name); } return(inLibrary); }
public VixenApplication() { InitializeComponent(); labelVersion.Font = new Font("Segoe UI", 14); //Get rid of the ugly grip that we dont want to show anyway. //Workaround for a MS bug statusStrip.Padding = new Padding(statusStrip.Padding.Left, statusStrip.Padding.Top, statusStrip.Padding.Left, statusStrip.Padding.Bottom); statusStrip.Font = SystemFonts.StatusFont; Icon = Resources.Icon_Vixen3; ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); statusStrip.BackColor = ThemeColorTable.BackgroundColor; statusStrip.ForeColor = ThemeColorTable.ForeColor; toolStripStatusLabel1.ForeColor = ThemeColorTable.ForeColor; toolStripStatusLabelExecutionLight.ForeColor = ThemeColorTable.ForeColor; toolStripStatusLabelExecutionState.ForeColor = ThemeColorTable.ForeColor; toolStripStatusLabel_memory.ForeColor = ThemeColorTable.ForeColor; contextMenuStripRecent.Renderer = new ThemeToolStripRenderer(); string[] args = Environment.GetCommandLineArgs(); foreach (string arg in args) { _ProcessArg(arg); } StartJITProfiler(); if (_rootDataDirectory == null) { ProcessProfiles(); } _applicationData = new VixenApplicationData(_rootDataDirectory); stopping = false; PopulateVersionStrings(); AppCommands = new AppCommand(this); Execution.ExecutionStateChanged += executionStateChangedHandler; VixenSystem.Start(this, _openExecution, _disableControllers, _applicationData.DataFileDirectory); InitStats(); // other modules look for and create it this way... AppCommand toolsMenu = AppCommands.Find("Tools"); if (toolsMenu == null) { toolsMenu = new AppCommand("Tools", "Tools"); AppCommands.Add(toolsMenu); } var myMenu = new AppCommand("Options", "Options..."); myMenu.Click += optionsToolStripMenuItem_Click; toolsMenu.Add(myMenu); toolStripItemClearSequences.Click += (mySender, myE) => ClearRecentSequencesList(); }
private async void changeMapToolStripMenuItem_Click(object sender, EventArgs e) { LipSyncNodeSelect nodeSelectDlg = new LipSyncNodeSelect(); //nodeSelectDlg.MaxNodes = _mapping.MapItems.Count; nodeSelectDlg.MaxNodes = Int32.MaxValue; nodeSelectDlg.MatrixOptionsOnly = false; nodeSelectDlg.AllowGroups = true; nodeSelectDlg.AllowRecursiveAdd = false; DialogResult dr = nodeSelectDlg.ShowDialog(this); if (dr == DialogResult.OK) { if (nodeSelectDlg.SelectedElementNodes.Any()) { FaceSetupHelper helper = new FaceSetupHelper(); var success = helper.Perform(nodeSelectDlg.SelectedElementNodes); if (success) { RenderLipSyncElementsAsync(); await VixenSystem.SaveSystemAndModuleConfigAsync(); } } } }
/// <summary> /// Method to invoke when the ColorOptions command is executed. /// </summary> private async void ColorOptions() { ConfigurationWindowViewModel vm = new ConfigurationWindowViewModel(); var dependencyResolver = this.GetDependencyResolver(); var uiVisualizerService = dependencyResolver.Resolve <UIVisualizerService>(); await uiVisualizerService.ShowDialogAsync(vm); await VixenSystem.SaveModuleConfigAsync(); }
private async void optionsToolStripMenuItem_Click(object sender, EventArgs e) { var dlg = new OptionsDialog(); var res = dlg.ShowDialog(); // so far the dialog box does it all, no real need for this check... if (res == DialogResult.OK) { await VixenSystem.SaveSystemConfigAsync(); } }
public bool RemoveCurve(string name) { bool removed = _RemoveCurve(name); if (removed) { _CurveChanged(name); VixenSystem.SaveModuleConfigAsync(); } return(removed); }
public bool RemoveColorGradient(string name) { bool removed = _RemoveColorGradient(name); if (removed) { _GradientChanged(name); VixenSystem.SaveModuleConfigAsync(); } return(removed); }
private async void editMapsToolStripMenuItem_Click(object sender, EventArgs e) { LipSyncMapSelector mapSelector = new LipSyncMapSelector(); DialogResult dr = mapSelector.ShowDialog(); if (mapSelector.Changed) { mapSelector.Changed = false; SequenceModified(); ResetLipSyncNodes(); await VixenSystem.SaveSystemAndModuleConfigAsync(); } }
private LatchedAppCommand _CreateEnabledCommand() { LatchedAppCommand enabledCommand = new LatchedAppCommand("VersionControlEnabled", "Enabled"); enabledCommand.IsChecked = _data.IsEnabled; enabledCommand.Checked += async(sender, e) => { _data.IsEnabled = e.CheckedState; EnableDisableSourceControl(_data.IsEnabled); await VixenSystem.SaveModuleConfigAsync(); }; return(enabledCommand); }
private void buttonSetupFiltersAndPatching_Click(object sender, EventArgs e) { ConfigFiltersAndPatching form = new ConfigFiltersAndPatching(_applicationData); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { VixenSystem.SaveSystemConfig(); } else { VixenSystem.ReloadSystemConfig(); } }
private void buttonSetupOutputPreviews_Click(object sender, EventArgs e) { ConfigPreviews form = new ConfigPreviews(); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { VixenSystem.SaveSystemConfig(); } else { VixenSystem.ReloadSystemConfig(); } }
private void SetupPreviews() { using (ConfigPreviews form = new ConfigPreviews()) { DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { VixenSystem.SaveSystemConfig(); } else { VixenSystem.ReloadSystemConfig(); } } }
private async void SetupPreviews() { using (ConfigPreviews form = new ConfigPreviews()) { DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { await VixenSystem.SaveSystemAndModuleConfigAsync(); } else { VixenSystem.ReloadSystemConfig(); } } }
private void VixenApp_FormClosing(object sender, FormClosingEventArgs e) { // close all open editors foreach (IEditorUserInterface editor in _openEditors.ToArray()) { editor.CloseEditor(); } stopping = true; VixenSystem.Stop(); _applicationData.SaveData(); Application.Exit(); }
private void SetupFiltersAndPatching() { using (ConfigFiltersAndPatching form = new ConfigFiltersAndPatching(_applicationData)) { DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { VixenSystem.SaveSystemConfig(); } else { VixenSystem.ReloadSystemConfig(); } } }
private void SetupDisplay() { using (DisplaySetup form = new DisplaySetup()) { DialogResult dr = form.ShowDialog(); if (dr == DialogResult.OK) { VixenSystem.SaveSystemConfig(); } else { VixenSystem.ReloadSystemConfig(); } } }
private async void SetupDisplay() { using (DisplaySetup form = new DisplaySetup()) { DialogResult dr = form.ShowDialog(); if (dr == DialogResult.OK) { await VixenSystem.SaveSystemAndModuleConfigAsync(); } else { VixenSystem.ReloadSystemConfig(); } } }
private async void VixenApp_FormClosing(object sender, FormClosingEventArgs e) { // close all open editors foreach (IEditorUserInterface editor in _openEditors.ToArray()) { editor.CloseEditor(); } stopping = true; await VixenSystem.Stop(false); _applicationData.SaveData(); RemoveLockFile(LockFilePath); Application.Exit(); }
private async void EditCurrentItem() { if (listViewItems.SelectedItems.Count == 1) { ListViewItem lvItem = listViewItems.SelectedItems[0]; ScheduleItem scheduleItem = lvItem.Tag as ScheduleItem; using (SetupScheduleForm f = new SetupScheduleForm(scheduleItem)) { if (f.ShowDialog() == DialogResult.OK) { UpdateListItem(scheduleItem); await VixenSystem.SaveModuleConfigAsync(); } } } }
public VixenApplication() { InitializeComponent(); //Get rid of the ugly grip that we dont want to show anyway. //Workaround for a MS bug statusStrip.Padding = new Padding(statusStrip.Padding.Left, statusStrip.Padding.Top, statusStrip.Padding.Left, statusStrip.Padding.Bottom); Icon = Resources.Icon_Vixen3; string[] args = Environment.GetCommandLineArgs(); foreach (string arg in args) { _ProcessArg(arg); } StartJITProfiler(); if (_rootDataDirectory == null) { ProcessProfiles(); } _applicationData = new VixenApplicationData(_rootDataDirectory); stopping = false; PopulateVersionStrings(); AppCommands = new AppCommand(this); Execution.ExecutionStateChanged += executionStateChangedHandler; VixenSystem.Start(this, _openExecution, _disableControllers, _applicationData.DataFileDirectory); InitStats(); // other modules look for and create it this way... AppCommand toolsMenu = AppCommands.Find("Tools"); if (toolsMenu == null) { toolsMenu = new AppCommand("Tools", "Tools"); AppCommands.Add(toolsMenu); } var myMenu = new AppCommand("Options", "Options..."); myMenu.Click += optionsToolStripMenuItem_Click; toolsMenu.Add(myMenu); }
private async void DeleteCurrentItem() { if (listViewItems.SelectedItems.Count == 1) { ListViewItem lvItem = listViewItems.SelectedItems[0]; ScheduleItem scheduleItem = lvItem.Tag as ScheduleItem; //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("Are you sure you want to delete the selected schedule?", "Delete Schedule", true, false); messageBox.ShowDialog(); if (messageBox.DialogResult == DialogResult.OK) { listViewItems.Items.Remove(lvItem); Data.Items.Remove(scheduleItem); await VixenSystem.SaveModuleConfigAsync(); } } }
public bool RemoveCurve(string name) { bool removed = _RemoveCurve(name); if (removed) { if (!_bulkUpdating) { _CurvesChanged(new[] { name }); VixenSystem.SaveModuleConfigAsync(); } else { _bulkCurveChangeNames.Add(name); } } return(removed); }
private async void SaveActiveConfig() { if (comboConfigName.SelectedIndex >= 0) { //we are replacing an existing config. _data.ActiveProfile.Name = comboConfigName.Text; _data.ActiveProfile.Id = (comboConfigName.SelectedItem as ExportProfile).Id; _data.Profiles[comboConfigName.SelectedIndex] = _data.ActiveProfile; } else { //Save as new with text from combo as name _data.ActiveProfile.Name = comboConfigName.Text; _data.ActiveProfile.Id = Guid.NewGuid(); _data.Profiles.Add(_data.ActiveProfile); } await VixenSystem.SaveModuleConfigAsync(); }
public VixenApplication() { string[] args = Environment.GetCommandLineArgs(); foreach (string arg in args) { _ProcessArg(arg); } _applicationData = new VixenApplicationData(_rootDataDirectory); stopping = false; InitializeComponent(); labelVersion.Text = _GetVersionString(VixenSystem.AssemblyFileName); AppCommands = new AppCommand(this); Execution.ExecutionStateChanged += executionStateChangedHandler; VixenSystem.Start(this, _openExecution, _disableControllers, _applicationData.DataFileDirectory); InitStats(); }