コード例 #1
0
        public override string ToString()
        {
            var displayText = NewText != null
                ? NewText.Replace("\r", @"\r").Replace("\n", @"\n").Replace("\t", @"\t")
                : "null";

            return($"LinePositionSpanTextChange {{ StartLine={StartLine}, StartColumn={StartColumn}, EndLine={EndLine}, EndColumn={EndColumn}, NewText={displayText} }}");
        }
コード例 #2
0
        public override string ToString()
        {
            var displayText = NewText != null
                ? NewText.Replace("\r", @"\r").Replace("\n", @"\n").Replace("\t", @"\t")
                : string.Empty;

            return($"StartLine={StartLine}, StartColumn={StartColumn}, EndLine={EndLine}, EndColumn={EndColumn}, NewText='{displayText}'");
        }
コード例 #3
0
ファイル: FindscreensHelper.cs プロジェクト: merbst/openpetra
        /// <summary>
        /// Removes any 'Joker' characters from a Criteria TextBox
        /// </summary>
        /// <param name="AFindCriteriaDataTable"></param>
        /// <param name="ASplitButton"></param>
        /// <param name="AAssociatedTextBox"></param>
        /// <param name="ALastSelection"></param>
        public static void RemoveJokersFromTextBox(DataTable AFindCriteriaDataTable, SplitButton ASplitButton,
                                                   TextBox AAssociatedTextBox, TMatches ALastSelection)
        {
            string NewText;

            try
            {
                if (AAssociatedTextBox != null)
                {
                    // Remove * Joker character(s)
                    NewText = AAssociatedTextBox.Text.Replace("*", String.Empty);

                    // If an EXACT search is wanted, we need to remove the % Joker character(s) as well
                    if (ALastSelection == TMatches.EXACT)
                    {
                        NewText = NewText.Replace("%", String.Empty);
                    }

//                    TLogging.Log(
//                        "RemoveJokersFromTextBox:  Associated TextBox's (" + AAssociatedTextBox.Name + ") Text (1): " + AAssociatedTextBox.Text);
//                    AFindCriteriaDataTable.Rows[0].BeginEdit();
//                    AAssociatedTextBox.Text = NewText;
//                    AFindCriteriaDataTable.Rows[0].EndEdit();

                    string fieldname = ((TextBox)AAssociatedTextBox).DataBindings[0].BindingMemberInfo.BindingMember;
                    AFindCriteriaDataTable.Rows[0][fieldname] = NewText;
                    fieldname = ((SplitButton)ASplitButton).DataBindings[0].BindingMemberInfo.BindingMember;
                    AFindCriteriaDataTable.Rows[0][fieldname] = Enum.GetName(typeof(TMatches), ALastSelection);
//                    AFindCriteriaDataTable.Rows[0].EndEdit();

//
//                    AAssociatedTextBox.Text = NewText;
//
//                    TLogging.Log(
//                        "RemoveJokersFromTextBox:  Associated TextBox's (" + AAssociatedTextBox.Name + ") Text (2): " + AAssociatedTextBox.Text);
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show("Exception in RemoveJokersFromTextBox: " + exp.ToString());
            }
        }