Exemplo n.º 1
0
        /// <summary>
        /// Edit the selected text editor.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]		07/20/2006	Created
        /// </history>
        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            if (TextEditorsItem.IsSelected)
             {
            if (TextEditorsList.SelectedItems.Count > 0)
            {
               ListViewItem item = TextEditorsList.SelectedItems[0];
               frmAddEditTextEditor dlg = new frmAddEditTextEditor();

               // set values
               dlg.IsAdd = false;
               dlg.IsAllTypesDefined = IsAllTypesDefined();
               dlg.TextEditorFileType = item.Text;
               dlg.TextEditorLocation = item.SubItems[1].Text;
               dlg.TextEditorCommandLine = item.SubItems[2].Text;

               if (dlg.ShowDialog(this) == DialogResult.OK)
               {
                  // get values
                  TextEditorsList.SelectedItems[0].Text = dlg.TextEditorFileType;
                  TextEditorsList.SelectedItems[0].SubItems[1].Text = dlg.TextEditorLocation;
                  TextEditorsList.SelectedItems[0].SubItems[2].Text = dlg.TextEditorCommandLine;
               }

               SetTextEditorsButtonState();
            }
             }

             this.DialogResult = DialogResult.None;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Edit the selected text editor.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]		07/20/2006	Created
        /// [Curtis_Beard]		08/13/2014	FIX: better detection of file types
        /// [Curtis_Beard]		03/06/2015	FIX: 65, support use quotes around file name
        /// </history>
        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            if (tbcOptions.SelectedTab == tabTextEditors)
             {
            if (TextEditorsList.SelectedItems.Count > 0)
            {
               ListViewItem item = TextEditorsList.SelectedItems[0];
               frmAddEditTextEditor dlg = new frmAddEditTextEditor();

               // set values
               dlg.IsAdd = false;
               dlg.IsAllTypesDefined = IsAllTypesDefined();
               dlg.Editor = item.Tag as TextEditor;
               dlg.ExistingFileTypes = GetExistingFileTypes();

               if (dlg.ShowDialog(this) == DialogResult.OK)
               {
                  // get values
                  TextEditorsList.SelectedItems[0].Tag = dlg.Editor;
                  TextEditorsList.SelectedItems[0].Text = dlg.Editor.FileType;
                  TextEditorsList.SelectedItems[0].SubItems[1].Text = dlg.Editor.Editor;
                  TextEditorsList.SelectedItems[0].SubItems[2].Text = dlg.Editor.Arguments;
                  TextEditorsList.SelectedItems[0].SubItems[3].Text = dlg.Editor.TabSize.ToString();
               }

               SetTextEditorsButtonState();
            }
             }

             this.DialogResult = DialogResult.None;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Add a new text editor.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]		07/20/2006	Created
        /// </history>
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            if (TextEditorsItem.IsSelected)
             {
            frmAddEditTextEditor dlg = new frmAddEditTextEditor();
            dlg.IsAdd = true;
            dlg.IsAllTypesDefined = IsAllTypesDefined();

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
               // get values
               ListViewItem item = new ListViewItem();
               item.Text = dlg.TextEditorFileType;
               item.SubItems.Add(dlg.TextEditorLocation);
               item.SubItems.Add(dlg.TextEditorCommandLine);

               TextEditorsList.Items.Add(item);

               SetTextEditorsButtonState();
            }
             }

             this.DialogResult = DialogResult.None;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Add a new text editor.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]		07/20/2006	Created
        /// [Curtis_Beard]		03/06/2015	FIX: 65, support use quotes around file name
        /// </history>
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            if (tbcOptions.SelectedTab == tabTextEditors)
             {
            frmAddEditTextEditor dlg = new frmAddEditTextEditor();
            dlg.IsAdd = true;
            dlg.IsAllTypesDefined = IsAllTypesDefined();
            dlg.ExistingFileTypes = GetExistingFileTypes();

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
               // create new entry
               ListViewItem item = new ListViewItem();
               item.Tag = dlg.Editor;
               item.Text = dlg.Editor.FileType;
               item.SubItems.Add(dlg.Editor.Editor);
               item.SubItems.Add(dlg.Editor.Arguments);
               item.SubItems.Add(dlg.Editor.TabSize.ToString());
               TextEditorsList.Items.Add(item);

               SetTextEditorsButtonState();
            }
             }

             this.DialogResult = DialogResult.None;
        }