Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 private void SetupForm_Closing(object sender, CancelEventArgs e)
 {
     if (_isDirty)
     {
         VixenSystem.SaveModuleConfigAsync();
     }
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Called to complete a bulk update operation
 /// </summary>
 public async void EndBulkUpdate()
 {
     _bulkUpdating = false;
     _GradientsChanged(_bulkGradientChangeNames);
     _bulkGradientChangeNames = null;
     await VixenSystem.SaveModuleConfigAsync();
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        /// <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();
        }
Ejemplo n.º 8
0
        public bool RemoveCurve(string name)
        {
            bool removed = _RemoveCurve(name);

            if (removed)
            {
                _CurveChanged(name);
                VixenSystem.SaveModuleConfigAsync();
            }
            return(removed);
        }
Ejemplo n.º 9
0
        public bool RemoveColorGradient(string name)
        {
            bool removed = _RemoveColorGradient(name);

            if (removed)
            {
                _GradientChanged(name);
                VixenSystem.SaveModuleConfigAsync();
            }

            return(removed);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
 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();
             }
         }
     }
 }
Ejemplo n.º 12
0
        public bool RemoveCurve(string name)
        {
            bool removed = _RemoveCurve(name);

            if (removed)
            {
                if (!_bulkUpdating)
                {
                    _CurvesChanged(new[] { name });
                    VixenSystem.SaveModuleConfigAsync();
                }
                else
                {
                    _bulkCurveChangeNames.Add(name);
                }
            }
            return(removed);
        }
Ejemplo n.º 13
0
 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();
         }
     }
 }
Ejemplo n.º 14
0
        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();
        }
Ejemplo n.º 15
0
        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;
            _CurveChanged(name);
            VixenSystem.SaveModuleConfigAsync();
            return(inLibrary);
        }
Ejemplo n.º 16
0
        private async void DeleteSelectedShow()
        {
            if (listViewShows.SelectedItems.Count > 0)
            {
                ListViewItem lvItem = listViewShows.SelectedItems[0];

                if (lvItem != null)
                {
                    //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 show?\r\n\r\n" + lvItem.Text + "\r\n\r\nYou CANNOT undo this!", "Delete Show", true, false);
                    messageBox.ShowDialog();
                    if (messageBox.DialogResult == DialogResult.OK)
                    {
                        Data.Shows.Remove(lvItem.Tag as Show);
                        listViewShows.Items.Remove(lvItem);
                        await VixenSystem.SaveModuleConfigAsync();
                    }
                }
            }
        }
Ejemplo n.º 17
0
        private async void EditSelectedShow()
        {
            if (listViewShows.SelectedItems.Count > 0)
            {
                ListViewItem lvItem = listViewShows.SelectedItems[0];

                if (lvItem != null)
                {
                    Show           show = (lvItem.Tag as Show).Clone() as Show;
                    ShowEditorForm form = new ShowEditorForm(show);
                    if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        int showIndex = Data.Shows.FindIndex(oldShow => oldShow == lvItem.Tag);
                        Data.Shows[showIndex] = form.ShowData;
                        lvItem.Tag            = form.ShowData;
                        lvItem.Text           = form.ShowData.Name;
                        await VixenSystem.SaveModuleConfigAsync();
                    }
                }
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Called to complete a bulk update operation
        /// </summary>
        public async void EndBulkUpdate()
        {
            await VixenSystem.SaveModuleConfigAsync();

            _bulkUpdating = false;
        }