Example #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  += (sender, e) =>
            {
                _data.IsEnabled = e.CheckedState;
            };

            /*if (schedulerMenu.Items.Length > 0)
             *      schedulerMenu.Add(new AppCommand("s1", "-"));*/
            schedulerMenu.Add(showCommand);
            schedulerMenu.Add(new AppCommand("s1", "-"));
            schedulerMenu.Add(enabledCommand);
        }
Example #2
0
        private void InjectAppCommands()
        {
            if (_application == null ||
                _application.AppCommands == null)
            {
                return;
            }

            var rootCommand = new AppCommand("Setup Preview Module", "Display Preview")
            {
                Enabled = true,
                Visible = true,
                Style   = AppCommand.AppCommandStyle.Menu
            };
            var command = new AppCommand("Edit Preview Setup", "Edit Preview Setup");

            command.Click  += SetupAppCommandClick;
            command.Enabled = true;
            command.Visible = true;
            rootCommand.Add(command);
            command         = new AppCommand("Preferences window", "Preferences");
            command.Click  += PreferencesCommandClick;
            command.Enabled = true;
            command.Visible = true;
            rootCommand.Add(command);
            _application.AppCommands.Add(rootCommand);
        }
        private void _AddApplicationMenu()
        {
            if (_AppSupportsCommands())
            {
                AppCommand rootCommand = new AppCommand(ID_ROOT, "Scheduler");

                LatchedAppCommand enabledCommand = new LatchedAppCommand("SchedulerEnabled", "Enabled");
                enabledCommand.IsChecked = _data.IsEnabled;
                enabledCommand.Checked  += (sender, e) => {
                    // Not setting the data member in _SetEnableState because we want to be
                    // able to call _SetEnableState without affecting the data (to stop
                    // the scheduler upon shutdown).
                    _data.IsEnabled = e.CheckedState;
                    _SetEnableState(_data.IsEnabled);
                };

                AppCommand separator1 = new AppCommand("s1", "-");

                AppCommand showCommand = new AppCommand("SchedulerShow", "Show");
                showCommand.Click += (sender, e) => {
                    using (SchedulerForm schedulerForm = new SchedulerForm(_data)) {
                        if (schedulerForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            enabledCommand.IsChecked = _data.IsEnabled;
                        }
                    }
                };

                rootCommand.Add(enabledCommand);
                rootCommand.Add(separator1);
                rootCommand.Add(showCommand);

                _application.AppCommands.Add(rootCommand);
            }
        }
Example #4
0
        private void _AddApplicationMenu()
        {
            if (_AppSupportsCommands())
            {
                var toolsMenu   = _GetToolsMenu();
                var rootCommand = new AppCommand(MENU_ID_ROOT, "Version Control");
                rootCommand.Add(_enabledCommand ?? (_enabledCommand = _CreateEnabledCommand()));
                rootCommand.Add(new AppCommand("s1", "-"));
                rootCommand.Add(_showCommand ?? (_showCommand = _CreateShowCommand()));

                toolsMenu.Add(rootCommand);
            }
        }
        private void _AddApplicationMenu()
        {
            if (_AppSupportsCommands())
            {
                AppCommand toolsMenu   = _GetToolsMenu();
                AppCommand rootCommand = new AppCommand(MENU_ID_ROOT, "Simple Scheduler");

                rootCommand.Add(_enabledCommand ?? (_enabledCommand = _CreateEnabledCommand()));
                rootCommand.Add(new AppCommand("s1", "-"));
                rootCommand.Add(_showCommand ?? (_showCommand = _CreateShowCommand()));

                toolsMenu.Add(rootCommand);
            }
        }
Example #6
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);
            }
        }
Example #7
0
        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();
        }
Example #8
0
        private void _AddApplicationMenu()
        {
            if (_AppSupportsCommands())
            {
                AppCommand toolsMenu   = _GetToolsMenu();
                AppCommand rootCommand = new AppCommand(MENU_ID_ROOT, "Web Server");

                rootCommand.Add(_showCommand ?? (_showCommand = _CreateShowCommand()));

                toolsMenu.Add(rootCommand);
            }
        }
Example #9
0
        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);
        }
Example #10
0
        public override void Loading()
        {
            if (_AppSupportsCommands)
            {
                AppCommand toolsMenu = _GetToolsMenu();

                AppCommand rootMenuItem = new AppCommand(ROOT_ID, "Input Effect Router");
                rootMenuItem.Click += (sender, e) => {
                    if (_inputManagement.ShowForm() == DialogResult.OK)
                    {
                        _data.Map          = _inputManagement.InputEffects;
                        _data.InputModules = _inputManagement.InputModules;
                    }
                };

                toolsMenu.Add(rootMenuItem);

                _inputManagement.Start();
            }
        }
Example #11
0
        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);
            }

            Logging.Info("Starting JIT Profiler");
            StartJITProfiler();
            Logging.Info("Completed JIT Profiler");

            if (_rootDataDirectory == null)
            {
                Logging.Info("Processing Profiles");
                ProcessProfiles();
                Logging.Info("Finished Processing Profiles");
            }

            _applicationData = new VixenApplicationData(_rootDataDirectory);

            _rootDataDirectory = _applicationData.DataFileDirectory;

            if (IsProfileLocked(_rootDataDirectory) || !CreateLockFile())
            {
                var form = new MessageBoxForm("Profile is already in use or unable to the lock the profile.", "Error", MessageBoxButtons.OK, SystemIcons.Error);
                form.ShowDialog();
                form.Dispose();
                Environment.Exit(0);
            }

            stopping = false;
            PopulateVersionStrings();
            AppCommands = new AppCommand(this);
            Execution.ExecutionStateChanged += executionStateChangedHandler;
            if (!VixenSystem.Start(this, _openExecution, _disableControllers, _applicationData.DataFileDirectory))
            {
                var messageBox = new MessageBoxForm("An error occured starting the system and the application will be halted.", "Error", MessageBoxButtons.OK, SystemIcons.Error);
                messageBox.ShowDialog();
                Application.Exit();
            }

            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();
        }