private void SmartQuotesPlugInEditorCharacterTyping(EditorCharacterTypingEventArgs ea)
        {
            TextViewCaret caret = GetCaretInActiveFocusedView();

            if (caret != null)
            {
                if (this.settings.UseSmartDoubleQuotes &&
                    this.settings.DoubleQuotesIgnoreClosingQuote &&
                    ea.Character == '\"' &&
                    CaretBeforeClosingDoubleQuote(caret))
                {
                    ea.Cancel = true;
                    IgnoreClosingCharacter(caret, this.settings.DoubleQuotesUseTextFields);
                    return;
                }
                if (this.settings.UseSmartQuotes &&
                    this.settings.QuotesIgnoreClosingQuote &&
                    ea.Character == '\'' &&
                    CaretBeforeClosingQuote(caret))
                {
                    ea.Cancel = true;
                    IgnoreClosingCharacter(caret, this.settings.QuotesUseTextFields);
                    return;
                }
            }
        }
Ejemplo n.º 2
0
 private void MethodNameReformatting_EditorCharacterTyping(EditorCharacterTypingEventArgs ea)
 {
     if (ea.Character == ' ' && !ea.IsAltKeyDown && !ea.IsCtrlKeyDown && !ea.IsShiftKeyDown && IAmInAMethodDeclaration())
     {
         ea.Cancel = true;
         ea.TextView.TextDocument.InsertText(CodeRush.Caret.SourcePoint, "_");
     }
 }
 private void MethodNameReformatting_EditorCharacterTyping(EditorCharacterTypingEventArgs ea)
 {
     if (ea.Character == ' ' && !ea.IsAltKeyDown && !ea.IsCtrlKeyDown && !ea.IsShiftKeyDown && IAmInAMethodDeclaration())
     {
         ea.Cancel = true;
         ea.TextView.TextDocument.InsertText(CodeRush.Caret.SourcePoint, "_");
     }
 }
Ejemplo n.º 4
0
        private void CR_SmartGenerics_EditorCharacterTyping(EditorCharacterTypingEventArgs ea)
        {
            if (!CodeRush.Language.IsCSharp)
            {
                return;
            }
            TextViewCaret caret = GetCaretInActiveFocusedView();

            if (caret != null &&
                this.settings.UseSmartGenerics &&
                this.settings.SmartGenericsIgnoreClosingGeneric &&
                ea.Character == '>' &&
                IsRightTextStartedWithCloseGenericOperator(caret) &&
                IsInsideGenerics())
            {
                ea.Cancel = true;
                IgnoreClosingCharacter(caret, this.settings.SmartGenericsUseTextFields);
                return;
            }
        }
Ejemplo n.º 5
0
 private void PlugIn1_EditorCharacterTyping(EditorCharacterTypingEventArgs ea)
 {
     bool inTextField = CodeRush.Context.Satisfied("System\\In TextField") == ContextResult.Satisfied;
     if (_ConvertingSpacesToCamelCase)
     {
         if (!inTextField)		// State issue -- maybe we didn't get the TextFieldDeactivated event?
             ConvertSpacesToCamelCase(false);
         if (ea.Character == ' ')
         {
             ea.Cancel = true;
             _NextCharIsUpper = true;
         }
         else if (_NextCharIsUpper)
         {
             ea.Cancel = true;
             _NextCharIsUpper = false;
             CodeRush.Test.SendKey(CodeRush.IDE.Handle, char.ToUpper(ea.Character));
         }
     }
 }
 private void CR_SmartGenerics_EditorCharacterTyping(EditorCharacterTypingEventArgs ea)
 {
     if (!CodeRush.Language.IsCSharp)
     {
         return;
     }
     TextViewCaret caret = GetCaretInActiveFocusedView();
     if (caret != null
         && this.settings.UseSmartGenerics
         && this.settings.SmartGenericsIgnoreClosingGeneric
         && ea.Character == '>'
         && IsRightTextStartedWithCloseGenericOperator(caret)
         && IsInsideGenerics())
     {
         ea.Cancel = true;
         IgnoreClosingCharacter(caret, this.settings.SmartGenericsUseTextFields);
         return;
     }
 }
 private void SmartQuotesPlugInEditorCharacterTyping(EditorCharacterTypingEventArgs ea)
 {
     TextViewCaret caret = GetCaretInActiveFocusedView();
     if (caret != null)
     {
         if (this.settings.UseSmartDoubleQuotes
             && this.settings.DoubleQuotesIgnoreClosingQuote
             && ea.Character == '\"'
             && CaretBeforeClosingDoubleQuote(caret))
         {
             ea.Cancel = true;
             IgnoreClosingCharacter(caret, this.settings.DoubleQuotesUseTextFields);
             return;
         }
         if (this.settings.UseSmartQuotes
             && this.settings.QuotesIgnoreClosingQuote
             && ea.Character == '\''
             && CaretBeforeClosingQuote(caret))
         {
             ea.Cancel = true;
             IgnoreClosingCharacter(caret, this.settings.QuotesUseTextFields);
             return;
         }
     }
 }