private void _smartTagTimer_Tick(object sender, EventArgs e)
 {
     if (((((base.get_Document().get_Length() > 0) && this._textForSmartTagDirty) && ((DateTimeOffset.Now > this._lastChange.AddMilliseconds(500.0)) && (this._lastCursorPos == base.get_SelectedView().get_Selection().get_EndOffset()))) && !base.get_IntelliPrompt().get_SmartTag().get_Visible()) && (this._slowSmartTagCount < 2))
     {
         CustomCSharpSyntaxLanguage language = base.get_Document().get_Language() as CustomCSharpSyntaxLanguage;
         if (language != null)
         {
             Stopwatch stopwatch = Stopwatch.StartNew();
             try
             {
                 language.ShowNamespaceSmartTag(this, this._lastCursorPos);
             }
             catch (ArgumentOutOfRangeException)
             {
             }
             stopwatch.Stop();
             if ((stopwatch.ElapsedMilliseconds > 0x7d0L) || ((stopwatch.ElapsedMilliseconds > 500L) && !this._firstSmartTag))
             {
                 this._slowSmartTagCount += 2;
             }
             else if (!((stopwatch.ElapsedMilliseconds <= 100L) || this._firstSmartTag))
             {
                 this._slowSmartTagCount++;
             }
             this._firstSmartTag = false;
         }
         this._textForSmartTagDirty = false;
     }
 }
        private void AddedNamespace()
        {
            CustomCSharpSyntaxLanguage language = base.get_Document().get_Language() as CustomCSharpSyntaxLanguage;

            if (language != null)
            {
                language.ShowIntelliPromptParameterInfo(this);
            }
        }
Exemple #3
0
        private SyntaxLanguage GetCSharpLanguage()
        {
            CustomCSharpSyntaxLanguage language = new CustomCSharpSyntaxLanguage(this._typeResolver);

            language.get_HighlightingStyles().get_Item("StringStyle").set_ForeColor((WindowBrightness < 0.4f) ? Color.FromArgb(220, 100, 100) : Color.FromArgb(220, 20, 20));
            language.get_HighlightingStyles().get_Item("CommentStyle").set_ForeColor((WindowBrightness < 0.4f) ? Color.FromArgb(100, 200, 110) : Color.Green);
            language.get_HighlightingStyles().get_Item("KeywordStyle").set_ForeColor((WindowBrightness < 0.4f) ? Color.FromArgb(130, 170, 0xff) : Color.Blue);
            language.get_HighlightingStyles().get_Item("NumberStyle").set_ForeColor((WindowBrightness < 0.4f) ? Color.FromArgb(180, 80, 230) : Color.FromArgb(200, 30, 250));
            (from s in language.get_HighlightingStyles().Cast <HighlightingStyle>() select s.get_Key()).ToArray <string>();
            if (WindowBrightness < 0.4f)
            {
                language.get_HighlightingStyles().Add(new HighlightingStyle("BracketHighlightingStyle", "Bracket Highlighted Text", Color.White, Color.DarkRed));
            }
            return(language);
        }
        internal bool CheckSmartTagAtLocation(int location)
        {
            CustomCSharpSyntaxLanguage language = base.get_Document().get_Language() as CustomCSharpSyntaxLanguage;

            if (language == null)
            {
                return(false);
            }
            try
            {
                return(language.ShowNamespaceSmartTag(this, location));
            }
            catch
            {
                return(false);
            }
        }
 private SyntaxLanguage GetCSharpLanguage()
 {
     CustomCSharpSyntaxLanguage language = new CustomCSharpSyntaxLanguage(this._typeResolver);
     language.get_HighlightingStyles().get_Item("StringStyle").set_ForeColor((WindowBrightness < 0.4f) ? Color.FromArgb(220, 100, 100) : Color.FromArgb(220, 20, 20));
     language.get_HighlightingStyles().get_Item("CommentStyle").set_ForeColor((WindowBrightness < 0.4f) ? Color.FromArgb(100, 200, 110) : Color.Green);
     language.get_HighlightingStyles().get_Item("KeywordStyle").set_ForeColor((WindowBrightness < 0.4f) ? Color.FromArgb(130, 170, 0xff) : Color.Blue);
     language.get_HighlightingStyles().get_Item("NumberStyle").set_ForeColor((WindowBrightness < 0.4f) ? Color.FromArgb(180, 80, 230) : Color.FromArgb(200, 30, 250));
     (from s in language.get_HighlightingStyles().Cast<HighlightingStyle>() select s.get_Key()).ToArray<string>();
     if (WindowBrightness < 0.4f)
     {
         language.get_HighlightingStyles().Add(new HighlightingStyle("BracketHighlightingStyle", "Bracket Highlighted Text", Color.White, Color.DarkRed));
     }
     return language;
 }