private void tsmiFunctions_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            CloseAllMenu();
            switch (e.ClickedItem.Name)
            {
            case "tsmCopyToMain":
                _fFunction.CopyTextToForm(txtMessageInformation.Text, false, Text);
                break;

            case "tsmiCopyClose":
                _fFunction.CopyTextToForm(txtMessageInformation.Text, false, Text);
                Close();
                break;

            case "tsmAppToForm":
                _fFunction.CopyTextToForm(txtMessageInformation.Text, true, Text);
                break;

            case "tsmAppAndClose":
                _fFunction.CopyTextToForm(txtMessageInformation.Text, true, Text);
                Close();
                break;

            case "tsmClose":
                Close();
                break;

            case "tsmShowFormattedJson":
                txtMessageInformation.Text = GetFormattedString(txtMessageInformation.Text, EnStringType.Json, true);
                break;

            case "tsmShowNoFormattedJson":
                txtMessageInformation.Text = GetFormattedString(txtMessageInformation.Text, EnStringType.Json, false);
                break;

            case "tsmOrderJsonProperties":
                txtMessageInformation.Text = OrderByFormatStringProperties(txtMessageInformation.Text, EnStringType.Json, true);
                break;

            case "tsmShowFormattedXml":
                txtMessageInformation.Text = GetFormattedString(txtMessageInformation.Text, EnStringType.Xml, true);
                break;

            case "tsmShowNoFormattedXml":
                txtMessageInformation.Text = GetFormattedString(txtMessageInformation.Text, EnStringType.Xml, false);
                break;

            case "tsmOrderXmlNodes":
                txtMessageInformation.Text = OrderByFormatStringProperties(txtMessageInformation.Text, EnStringType.Xml, true);
                break;

            case "tsmCopyFromMain":
                txtMessageInformation.Text = _fFunction.GetContentsBox().Text;
                break;
            }
        }
Ejemplo n.º 2
0
        private void btnReplace_Click(object sender, EventArgs e)
        {
            var contentsBox = _fFunction.GetContentsBox();

            if (!string.IsNullOrEmpty(txtFind.Text))
            {
                contentsBox.Text = Replace(contentsBox.Text, txtFind.Text, txtReplaceWith.Text
                                           , cbkMatchCase.Checked, cbkRExpression.Checked);
                var sst = _fFunction.GetWinWorkingStatus();

                var status = string.Format("case {0} {1}", cbkMatchCase.Checked ? "sensitive" : "un-sensitive"
                                           , cbkRExpression.Checked ? "regular expression" : "mode");
                sst.Text = $"Replace '{txtFind.Text}' with '{txtReplaceWith.Text}' in {status}.";
            }
        }