Пример #1
0
 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
        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
 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
        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();
        }