Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
0
        public VixenApplication()
        {
            InitializeComponent();
            Icon = Resources.Icon_Vixen3;

            string[] args = Environment.GetCommandLineArgs();
            foreach (string arg in args) {
                _ProcessArg(arg);
            }

            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);
        }
Ejemplo n.º 3
0
		public VixenApplication()
		{
			InitializeComponent();
			labelVersion.Font = new Font("Segoe UI", 14);
			labelDebugVersion.Font = new Font("Segoe UI", 9);
			//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;

			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);
		}
Ejemplo n.º 4
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);
			}
		}
Ejemplo n.º 5
0
        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);
            }
        }
        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);
            }
        }
Ejemplo n.º 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);

            _rootDataDirectory = _applicationData.DataFileDirectory;

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