示例#1
0
文件: Form1.cs 项目: Mnrikard/Clippy
 private void HandlePersistentResponse(object sender, EditorResponseEventArgs e)
 {
     if (_infoBox != null)
     {
         _infoBox.Close();
         _infoBox = null;
     }
     _infoBox = new PersistentInformation(e.ResponseString);
     _infoBox.StartPosition = FormStartPosition.CenterParent;
     _infoBox.Show();
 }
示例#2
0
文件: Form1.cs 项目: Mnrikard/Clippy
        private void executeButton_Click(object sender, EventArgs e)
        {
            int           i          = 1;
            StringBuilder parmString = new StringBuilder();

            foreach (DataGridViewRow dr in parametersGrid.Rows)
            {
                string parmValue = dr.Cells["Value"].Value == null ? String.Empty : dr.Cells["Value"].Value.ToString();
                try
                {
                    clipManager.ClipEditor.SetParameter(i, parmValue);
                }
                catch (ClippyLib.InvalidParameterException pe)
                {
                    MessageBox.Show(pe.ParameterMessage, "Error with passed parameter: \"" + parmValue + "\"", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                catch (IndexOutOfRangeException)
                {
                    MessageBox.Show("Error with command, possibly not a function of clippy", "Error with command", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                parmString.AppendFormat(" \"{0}\"", parmValue.Replace("\"", "\\q").Replace("\t", "\\t"));
                i++;
            }

            try
            {
                clipManager.ClipEditor.GetClipboardContent();
                clipManager.ClipEditor.Edit();
                clipManager.ClipEditor.SetClipboardContent();
            }
            catch (UndefinedFunctionException udfex)
            {
                MessageBox.Show(udfex.FunctionMessage);
            }

            SaveThisCommand(_currentCommand, parmString.ToString());

            clipManager.ClipEditor.EditorResponse -= HandleResponseFromClippy;
            functions.Focus();

            try
            {
                _infoBox.Close();
                _infoBox = null;
            }
            catch { }
            this.Close();
        }
示例#3
0
文件: Form1.cs 项目: acbeard/Clippy
 private void HandlePersistentResponse(object sender, EditorResponseEventArgs e)
 {
     if (_infoBox != null)
     {
         _infoBox.Close();
         _infoBox = null;
     }
     _infoBox = new PersistentInformation(e.ResponseString);
     _infoBox.StartPosition = FormStartPosition.CenterParent;
     _infoBox.Show();
 }
示例#4
0
文件: Form1.cs 项目: acbeard/Clippy
        private void executeButton_Click(object sender, EventArgs e)
        {
            int i=1;
            StringBuilder parmString = new StringBuilder();
            foreach (DataGridViewRow dr in parametersGrid.Rows)
            {
                string parmValue = dr.Cells["Value"].Value == null ? String.Empty : dr.Cells["Value"].Value.ToString();
                try
                {
                    clipManager.ClipEditor.SetParameter(i, parmValue);
                }
                catch (ClippyLib.InvalidParameterException pe)
                {
                    MessageBox.Show(pe.ParameterMessage, "Error with passed parameter: \"" + parmValue + "\"", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                catch (IndexOutOfRangeException)
                {
                    MessageBox.Show("Error with command, possibly not a function of clippy", "Error with command", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                parmString.AppendFormat(" \"{0}\"",parmValue.Replace("\"","\\q").Replace("\t","\\t"));
                i++;
            }

            try
            {
                clipManager.ClipEditor.GetClipboardContent();
                clipManager.ClipEditor.Edit();
                clipManager.ClipEditor.SetClipboardContent();
            }
            catch (UndefinedFunctionException udfex)
            {
                MessageBox.Show(udfex.FunctionMessage);
            }

            SaveThisCommand(_currentCommand, parmString.ToString());

            clipManager.ClipEditor.EditorResponse -= HandleResponseFromClippy;
            functions.Focus();

            try
            {
                _infoBox.Close();
                _infoBox = null;
            }
            catch { }
            this.Close();
        }