コード例 #1
0
 void citationItem_Click(object sender, EventArgs e)
 {
     CitationInfoForm cif = new CitationInfoForm(false);
     cif.ShowDialog();
 }
コード例 #2
0
 private void citationToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CitationInfoForm cif = new CitationInfoForm(false);
     cif.ShowDialog();
 }
コード例 #3
0
        /// <summary>
        /// runLog will be null in general, when running Cicero as a standalone application. However, when Cicero is launched through Elgin,
        /// runLog will contain the log that we intent to browse.
        /// </summary>
        /// <param name="runLog"></param>
        public MainClientForm(RunLog runLog)
        {
            #region Singleton
            if (instance != null)
                throw new Exception("Word Generator is already running!");
            instance = this;
            #endregion

            try
            {
                string[] forts = WordGenerator.Properties.Resources.Fortunes.Split('\n');
                fortunes = new List<string>(forts);
            }
            catch { }

            if (runLog == null)
            {
                // Identify the clientStartupSettingsFile
                clientStartupSettingsFile = FileNameStrings.DefaultClientStartupSettingsFile;

                // Load all necessary data into Storage
                Storage.SaveAndLoad.LoadAllSubclasses(clientStartupSettingsFile);

            }
            else
            {
                Storage.clientStartupSettings = new ClientStartupSettings();
                Storage.sequenceData = runLog.RunSequence;
                Storage.settingsData = runLog.RunSettings;
            }

            InitializeComponent();

            #if DEBUG
            debugToolStripMenuItem.Visible = true;
            #endif

            ToolStripMenuItem citationItem = new ToolStripMenuItem();
            citationItem.Text = "Citation";
            citationItem.Click += new EventHandler(citationItem_Click);
            aboutToolStripMenuItem.DropDownItems.Add(citationItem);

            if (hotKeyBindings == null)
                hotKeyBindings = new List<object>();

                try {

                /*
                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F9);
                hotKeyBindings.Add(sequencePage1.runControl1.runZeroButton);
                */

                // bind F11 hotkey to server manager:
                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F11);
                hotKeyBindings.Add(this.serverManagerButton);

                // bind F1 to F8 to appropriate tab pages

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F1);
                hotKeyBindings.Add(this.sequenceTab);

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F2);
                hotKeyBindings.Add(this.overrideTab);

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F3);
                hotKeyBindings.Add(this.analogTab);

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F4);
                hotKeyBindings.Add(this.gpibTab);

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F5);
                hotKeyBindings.Add(this.rs232Tab);

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F6);
                hotKeyBindings.Add(this.commonWaveformTab);

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F7);
                hotKeyBindings.Add(this.variablesTab);

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.None, Keys.F8);
                hotKeyBindings.Add(this.pulsesTab);

                RegisterHotKey(Handle, hotKeyBindings.Count, KeyModifiers.Control, Keys.F9);
                hotKeyBindings.Add(this.sequencePage.runControl1.bgRunButton);
            }
            catch (Exception e) {
                addMessageLogText(this, new MessageEvent("Unable to add hotkeys due to error: " + e.Message,
                                                         0,
                                                         MessageEvent.MessageTypes.Error));
            }

            RefreshRecentFiles();
            this.RefreshSettingsDataToUI();
            this.RefreshSequenceDataToUI();

            if (!Storage.clientStartupSettings.HasShownCitationMessage)
            {
                CitationInfoForm cif = new CitationInfoForm(true);
                cif.ShowDialog();
                Storage.clientStartupSettings.HasShownCitationMessage = true;
            }
        }