public CurrentColumnAdornment(
            IWpfTextView view, IClassificationFormatMap formatMap,
            IClassificationType formatType, IVsfSettings settings)
        {
            this.view = view;
              this.formatMap = formatMap;
              this.formatType = formatType;
              this.settings = settings;
              this.columnRect = new Rectangle();
              layer = view.GetAdornmentLayer(Constants.COLUMN_HIGHLIGHT);

              view.Caret.PositionChanged += OnCaretPositionChanged;
              view.ViewportWidthChanged += OnViewportChanged;
              view.ViewportHeightChanged += OnViewportChanged;
              view.LayoutChanged += OnViewLayoutChanged;
              view.TextViewModel.EditBuffer.PostChanged += OnBufferPostChanged;
              view.Closed += OnViewClosed;
              view.Options.OptionChanged += OnSettingsChanged;

              this.settings.SettingsChanged += OnSettingsChanged;
              formatMap.ClassificationFormatMappingChanged +=
             OnClassificationFormatMappingChanged;

              CreateDrawingObjects();
        }
예제 #2
0
        public AutoExpander(
            IWpfTextView textView,
            IVsOutliningManager outlining,
            IVsfSettings settings)
        {
            this.settings = settings;
              this.theView = textView;
              this.outliningManager = outlining;
              this.expandMode = settings.AutoExpandRegions;

              this.theView.Closed += OnViewClosed;
              this.settings.SettingsChanged += OnSettingsChanged;

              if ( expandMode == AutoExpandMode.Disable ) {
            outlining.Enabled = false;
              } else if ( expandMode == AutoExpandMode.Expand ) {
            // in most cases, this is enough to
            // expand all outlining as necessary.
            // However, it does not appear to work
            // if the solution is just opened
            // so take notice of when regions are
            // collapsed and do it again just in case
            // Try expanding it when the window gets focus
            // as a last chance for Visual Basic
            this.theView.LayoutChanged += OnLayoutChanged;
            this.outliningManager.RegionsCollapsed += OnRegionsCollapsed;
            this.theView.GotAggregateFocus += OnGotFocus;
              }
        }
예제 #3
0
        public CurrentLineAdornment(
            IWpfTextView view, IClassificationFormatMap formatMap,
            IClassificationType formatType, IVsfSettings settings)
        {
            this.view       = view;
            this.formatMap  = formatMap;
            this.formatType = formatType;
            this.settings   = settings;
            this.layer      = view.GetAdornmentLayer(Constants.LINE_HIGHLIGHT);
            this.lineRect   = new Rectangle();
            this.dispatcher = Dispatcher.CurrentDispatcher;

            view.Caret.PositionChanged += OnCaretPositionChanged;
            view.ViewportWidthChanged  += OnViewportWidthChanged;
            view.LayoutChanged         += OnLayoutChanged;
            view.ViewportLeftChanged   += OnViewportLeftChanged;
            view.Closed += OnViewClosed;
            view.Options.OptionChanged += OnSettingsChanged;

            this.settings.SettingsChanged += OnSettingsChanged;
            formatMap.ClassificationFormatMappingChanged +=
                OnClassificationFormatMappingChanged;

            CreateDrawingObjects();
        }
예제 #4
0
        public AutoExpander(
            IWpfTextView textView,
            IVsOutliningManager outlining,
            IVsfSettings settings)
        {
            this.settings         = settings;
            this.theView          = textView;
            this.outliningManager = outlining;
            this.expandMode       = settings.AutoExpandRegions;

            this.theView.Closed           += OnViewClosed;
            this.settings.SettingsChanged += OnSettingsChanged;

            if (this.expandMode == AutoExpandMode.Disable)
            {
                outlining.Enabled = false;
            }
            else if (this.expandMode == AutoExpandMode.Expand)
            {
                // in most cases, this is enough to
                // expand all outlining as necessary.
                // However, it does not appear to work
                // if the solution is just opened
                // so take notice of when regions are
                // collapsed and do it again just in case
                // Try expanding it when the window gets focus
                // as a last chance for Visual Basic
                this.theView.LayoutChanged             += OnLayoutChanged;
                this.outliningManager.RegionsCollapsed += OnRegionsCollapsed;
                this.theView.GotAggregateFocus         += OnGotFocus;
            }
        }
예제 #5
0
 public DevMarginVisual(DevMarginViewModel model, IVsfSettings settings)
     : this()
 {
     this.Model = model;
       this.DataContext = Model;
       this.settings = settings;
 }
예제 #6
0
 void OnViewClosed(object sender, EventArgs e)
 {
     if (this.settings != null)
     {
         this.settings.SettingsChanged -= OnSettingsChanged;
         this.settings = null;
     }
     if (this.view != null)
     {
         this.view.Options.OptionChanged -= OnSettingsChanged;
         this.view.Caret.PositionChanged -= OnCaretPositionChanged;
         this.view.ViewportWidthChanged  -= OnViewportWidthChanged;
         this.view.LayoutChanged         -= OnLayoutChanged;
         this.view.ViewportLeftChanged   -= OnViewportLeftChanged;
         this.view.Closed -= OnViewClosed;
         this.view         = null;
     }
     if (this.formatMap != null)
     {
         this.formatMap.ClassificationFormatMappingChanged -= OnClassificationFormatMappingChanged;
         this.formatMap = null;
     }
     this.layer      = null;
     this.formatType = null;
 }
예제 #7
0
        public CurrentColumnAdornment(
            IWpfTextView view, IClassificationFormatMap formatMap,
            IClassificationType formatType, IVsfSettings settings)
        {
            this.view       = view;
            this.formatMap  = formatMap;
            this.formatType = formatType;
            this.settings   = settings;
            this.dispatcher = Dispatcher.CurrentDispatcher;
            this.highlight  = new Border();
            layer           = view.GetAdornmentLayer(Constants.COLUMN_HIGHLIGHT);

            view.Caret.PositionChanged += OnCaretPositionChanged;
            view.ViewportWidthChanged  += OnViewportChanged;
            view.ViewportHeightChanged += OnViewportChanged;
            view.LayoutChanged         += OnViewLayoutChanged;
            view.TextViewModel.EditBuffer.PostChanged += OnBufferPostChanged;
            view.Closed += OnViewClosed;
            view.Options.OptionChanged += OnSettingsChanged;

            this.settings.SettingsChanged += OnSettingsChanged;
            formatMap.ClassificationFormatMappingChanged +=
                OnClassificationFormatMappingChanged;

            CreateDrawingObjects();
        }
예제 #8
0
 private void Cleanup()
 {
     if (this.wpfTextViewHost != null)
     {
         this.wpfTextViewHost.Closed -= OnTextViewHostClosed;
         this.wpfTextViewHost         = null;
     }
     if (this.textView != null)
     {
         this.textView.BufferGraph.GraphBuffersChanged           -= OnGraphBuffersChanged;
         this.textView.BufferGraph.GraphBufferContentTypeChanged -= OnGraphBufferContentTypeChanged;
         this.textView.Caret.PositionChanged -= OnCaretPositionChanged;
         this.textView.TextViewModel.EditBuffer.PostChanged -= OnBufferPostChanged;
         this.textView = null;
     }
     if (this.visual != null)
     {
         this.visual.ViewBuffer -= OnViewBuffer;
         this.visual             = null;
     }
     if (this.settings != null)
     {
         this.settings.SettingsChanged -= OnSettingsChanged;
         this.settings = null;
     }
     this.extensionRegistry = null;
 }
 public PresentationModeFontChanger(IPresentationModeState state)
 {
     this.packageState = state;
       this.enabled = false;
       this.settings = SettingsContext.GetSettings();
       this.categories = GetCategories();
       this.fontsAndColors = state.GetService<IVsFontAndColorStorage>();
 }
 public PresentationModeFontChanger(IPresentationModeState state)
 {
     this.packageState   = state;
     this.enabled        = false;
     this.settings       = SettingsContext.GetSettings();
     this.categories     = GetCategories();
     this.fontsAndColors = state.GetService <IVsFontAndColorStorage>();
 }
예제 #11
0
 public RainbowKeyProcessor(ITextView textView, IVsfSettings settings)
 {
     this.theView = textView;
       this.theView.LostAggregateFocus += OnLostFocus;
       this.theView.Closed += OnViewClosed;
       this.settings = settings;
       pressTime = TimeSpan.FromMilliseconds(settings.RainbowCtrlTimer);
 }
예제 #12
0
 public BoldAsItalicsFormatter(
     IWpfTextView textView, IClassificationFormatMap map,
     IVsfSettings settings)
 {
     this.formatMap = map;
       this.settings = settings;
       textView.GotAggregateFocus += OnViewFocus;
       this.formatMap.ClassificationFormatMappingChanged += OnMappingChanged;
 }
예제 #13
0
 public BoldAsItalicsFormatter(
     IWpfTextView textView, IClassificationFormatMap map,
     IVsfSettings settings)
 {
     this.formatMap              = map;
     this.settings               = settings;
     textView.GotAggregateFocus += OnViewFocus;
     this.formatMap.ClassificationFormatMappingChanged += OnMappingChanged;
 }
예제 #14
0
 public PlainTextCompletionSource(
     ITextBuffer buffer,
     ITextStructureNavigator structureNavigator,
     IVsfSettings settings)
 {
     this.theBuffer = buffer;
       this.navigator = structureNavigator;
       this.settings = settings;
       glyphIcon = new BitmapImage(new Uri("pack://application:,,,/Winterdom.Viasfora;component/Resources/PlainTextCompletion.ico"));
 }
예제 #15
0
 public PlainTextCompletionSource(
     ITextBuffer buffer,
     ITextStructureNavigator structureNavigator,
     IVsfSettings settings)
 {
     this.theBuffer = buffer;
     this.navigator = structureNavigator;
     this.settings  = settings;
     glyphIcon      = new BitmapImage(new Uri("pack://application:,,,/Winterdom.Viasfora;component/Resources/PlainTextCompletion.ico"));
 }
예제 #16
0
        public PresentationMode(IWpfTextView textView, IVsfSettings settings)
        {
            this.theView = textView;
              this.settings = settings;

              VsfPackage.PresentationModeChanged += OnPresentationModeChanged;

              settings.SettingsChanged += OnSettingsChanged;
              textView.Closed += OnTextViewClosed;
              textView.ViewportWidthChanged += OnViewportWidthChanged;
        }
예제 #17
0
 private void OnViewClosed(object sender, EventArgs e)
 {
     this.settings.SettingsChanged -= OnSettingsChanged;
     this.settings = null;
     this.outliningManager.RegionsCollapsed -= OnRegionsCollapsed;
     this.theView.LayoutChanged             -= OnLayoutChanged;
     this.theView.GotAggregateFocus         -= OnGotFocus;
     this.theView.Closed  -= OnViewClosed;
     this.theView          = null;
     this.outliningManager = null;
 }
예제 #18
0
        public PresentationMode(IWpfTextView textView, IPresentationModeState state, IVsfSettings settings)
        {
            this.theView  = textView;
            this.settings = settings;
            this.state    = state;

            state.PresentationModeChanged += OnPresentationModeChanged;

            settings.SettingsChanged      += OnSettingsChanged;
            textView.Closed               += OnTextViewClosed;
            textView.ViewportWidthChanged += OnViewportWidthChanged;
        }
예제 #19
0
 void OnTextViewClosed(object sender, EventArgs e)
 {
     if ( this.settings != null ) {
     this.settings.SettingsChanged -= OnSettingsChanged;
     this.settings = null;
       }
       if ( theView != null ) {
     VsfPackage.PresentationModeChanged -= OnPresentationModeChanged;
     theView.Closed -= OnTextViewClosed;
     theView.ViewportWidthChanged -= OnViewportWidthChanged;
     theView = null;
       }
 }
 public PlainTextCompletionSource(
     ITextBuffer buffer,
     ITextStructureNavigator structureNavigator,
     IVsfSettings settings)
 {
     this.theBuffer = buffer;
       this.navigator = structureNavigator;
       this.settings = settings;
       String assemblyName = this.GetType().Assembly.GetName().Name;
       glyphIcon = new BitmapImage(new Uri(String.Format(
     "pack://application:,,,/{0};component/Resources/PlainTextCompletion.ico",
     assemblyName)));
 }
예제 #21
0
 public ItalicsFormatter(ITextView textView, IClassificationFormatMap map, IVsfSettings settings)
 {
     this.textView                  = textView;
     this.formatMap                 = map;
     this.settings                  = settings;
     this.working                   = false;
     this.classificationTypes       = new List <String>();
     this.settings.SettingsChanged += OnSettingsChanged;
     this.formatMap.ClassificationFormatMappingChanged += OnMappingChanged;
     // Delay activating until after the textView
     // gets focus. Otherwise, VS may crash/hang
     this.textView.GotAggregateFocus += OnTextViewFocus;
 }
예제 #22
0
 public void Dispose()
 {
     if (settings != null)
     {
         settings.SettingsChanged -= OnSettingsChanged;
         settings = null;
     }
     if (aggregator != null)
     {
         aggregator.Dispose();
         aggregator = null;
     }
     theBuffer = null;
 }
예제 #23
0
 public void Dispose()
 {
     if (this.settings != null)
     {
         this.settings.SettingsChanged -= OnSettingsChanged;
         this.settings = null;
     }
     if (this.aggregator != null)
     {
         this.aggregator.Dispose();
         this.aggregator = null;
     }
     this.theBuffer = null;
 }
예제 #24
0
        public PlainTextCompletionSource(
            ITextBuffer buffer,
            ITextStructureNavigator structureNavigator,
            IVsfSettings settings)
        {
            this.theBuffer = buffer;
            this.navigator = structureNavigator;
            this.settings  = settings;
            String assemblyName = this.GetType().Assembly.GetName().Name;

            glyphIcon = new BitmapImage(new Uri(String.Format(
                                                    "pack://application:,,,/{0};component/Resources/PlainTextCompletion.ico",
                                                    assemblyName)));
        }
예제 #25
0
 void OnTextViewClosed(object sender, EventArgs e)
 {
     if (this.settings != null)
     {
         this.settings.SettingsChanged -= OnSettingsChanged;
         this.settings = null;
     }
     if (theView != null)
     {
         state.PresentationModeChanged -= OnPresentationModeChanged;
         theView.Closed -= OnTextViewClosed;
         theView.ViewportWidthChanged -= OnViewportWidthChanged;
         theView = null;
     }
 }
예제 #26
0
#pragma warning restore 67

        internal KeywordTagger(ITextBuffer buffer, KeywordTaggerProvider provider)
        {
            theBuffer        = buffer;
            this.aggregator  = provider.Aggregator.CreateTagAggregator <IClassificationTag>(buffer);
            this.langFactory = provider.LanguageFactory;

            keywordClassification      = provider.GetTag(Constants.KEYWORD_CLASSIF_NAME);
            linqClassification         = provider.GetTag(Constants.LINQ_CLASSIF_NAME);
            visClassification          = provider.GetTag(Constants.VISIBILITY_CLASSIF_NAME);
            stringEscapeClassification = provider.GetTag(Constants.STRING_ESCAPE_CLASSIF_NAME);
            formatSpecClassification   = provider.GetTag(Constants.FORMAT_SPECIFIER_NAME);

            this.settings = provider.Settings;
            this.settings.SettingsChanged += this.OnSettingsChanged;
        }
예제 #27
0
 private void OnViewClosed(object sender, EventArgs e)
 {
     if (this.settings != null)
     {
         this.settings.SettingsChanged -= OnSettingsChanged;
         this.settings = null;
     }
     if (this.theView != null)
     {
         this.theView.Closed -= OnViewClosed;
         TextObfuscationState.EnabledChanged -= OnEnabledChanged;
         this.theView             = null;
         this.theBuffer           = null;
         this.obfuscationType     = null;
         this.expressionsToSearch = null;
     }
 }
예제 #28
0
        public TextObfuscationTagger(
            ITextView view,
            ITextBuffer buffer,
            IClassificationType obfuscationType,
            IVsfSettings settings)
        {
            this.theView             = view;
            this.theBuffer           = buffer;
            this.obfuscationType     = obfuscationType;
            this.enabled             = TextObfuscationState.Enabled;
            this.settings            = settings;
            this.expressionsToSearch =
                settings.TextObfuscationRegexes.ListFromJson <RegexEntry>();

            this.settings.SettingsChanged       += OnSettingsChanged;
            TextObfuscationState.EnabledChanged += OnEnabledChanged;
            this.theView.Closed += OnViewClosed;
        }
예제 #29
0
        public DevViewMargin(IWpfTextViewHost wpfTextViewHost,
                             IFileExtensionRegistryService fers,
                             IVsfSettings settings)
        {
            this.model                     = new DevMarginViewModel();
            this.wpfTextViewHost           = wpfTextViewHost;
            this.extensionRegistry         = fers;
            this.settings                  = settings;
            this.settings.SettingsChanged += OnSettingsChanged;
            this.wpfTextViewHost.Closed   += OnTextViewHostClosed;

            this.visual             = new DevMarginVisual(this.model, settings);
            this.visual.ViewBuffer += OnViewBuffer;

            UpdateVisibility();
            InitializeTextView();
            RefreshBufferGraphList();
            this.model.RefreshView(wpfTextViewHost.TextView);
        }
예제 #30
0
        public DevViewMargin(IWpfTextViewHost wpfTextViewHost, 
            IFileExtensionRegistryService fers,
            IVsfSettings settings)
        {
            model = new DevMarginViewModel();
              this.wpfTextViewHost = wpfTextViewHost;
              this.extensionRegistry = fers;
              this.settings = settings;
              this.settings.SettingsChanged += OnSettingsChanged;
              this.wpfTextViewHost.Closed += OnTextViewHostClosed;

              this.visual = new DevMarginVisual(model, settings);
              this.visual.ViewBuffer += OnViewBuffer;

              UpdateVisibility();
              InitializeTextView();
              RefreshBufferGraphList();
              this.model.RefreshView(wpfTextViewHost.TextView);
        }
예제 #31
0
        public CurrentLineAdornment(
            IWpfTextView view, IClassificationFormatMap formatMap,
            IClassificationType formatType, IVsfSettings settings)
        {
            this.view = view;
              this.formatMap = formatMap;
              this.formatType = formatType;
              this.settings = settings;
              this.layer = view.GetAdornmentLayer(Constants.LINE_HIGHLIGHT);
              this.lineRect = new Rectangle();

              view.Caret.PositionChanged += OnCaretPositionChanged;
              view.ViewportWidthChanged += OnViewportWidthChanged;
              view.LayoutChanged += OnLayoutChanged;
              view.ViewportLeftChanged += OnViewportLeftChanged;
              view.Closed += OnViewClosed;
              view.Options.OptionChanged += OnSettingsChanged;

              this.settings.SettingsChanged += OnSettingsChanged;
              formatMap.ClassificationFormatMappingChanged +=
             OnClassificationFormatMappingChanged;

              CreateDrawingObjects();
        }
예제 #32
0
 private void Cleanup()
 {
     if ( this.wpfTextViewHost != null ) {
     this.wpfTextViewHost.Closed -= OnTextViewHostClosed;
     this.wpfTextViewHost = null;
       }
       if ( this.textView != null ) {
     this.textView.BufferGraph.GraphBuffersChanged -= OnGraphBuffersChanged;
     this.textView.BufferGraph.GraphBufferContentTypeChanged -= OnGraphBufferContentTypeChanged;
     this.textView.Caret.PositionChanged -= OnCaretPositionChanged;
     this.textView.TextViewModel.EditBuffer.PostChanged -= OnBufferPostChanged;
     this.textView = null;
       }
       if ( this.visual != null ) {
     this.visual.ViewBuffer -= OnViewBuffer;
     this.visual = null;
       }
       if ( this.settings != null ) {
     this.settings.SettingsChanged -= OnSettingsChanged;
     this.settings = null;
       }
       this.extensionRegistry = null;
 }
예제 #33
0
 public XmlSettings(IVsfSettings settings)
 {
     this.settings = settings;
       this.settings.SettingsChanged += OnSettingsChanged;
 }
예제 #34
0
 public LanguageInfo(IVsfSettings settings)
 {
     this.Settings = settings;
 }
예제 #35
0
 public Sql(IVsfSettings settings) : base(settings)
 {
 }
예제 #36
0
 public CSharp(IVsfSettings settings) : base(settings)
 {
 }
예제 #37
0
 public TypeScript(IVsfSettings settings) : base(settings) {
 }
예제 #38
0
파일: Cpp.cs 프로젝트: bayulabster/viasfora
 public Cpp(IVsfSettings settings) : base(settings) {
 }
예제 #39
0
 public RainbowSettings(IVsfSettings settings)
 {
     this.settings = settings;
       this.settings.SettingsChanged += OnSettingsChanged;
 }
예제 #40
0
 public DefaultLanguage(IVsfSettings settings) : base(settings) {
 }
예제 #41
0
 public PowerShell(IVsfSettings settings) : base(settings)
 {
 }
예제 #42
0
 public LanguageFactory(IVsfSettings settings)
 {
     this.defaultLang = new DefaultLanguage(settings);
 }
예제 #43
0
 public XmlSettings(IVsfSettings settings)
 {
     this.settings = settings;
     this.settings.SettingsChanged += OnSettingsChanged;
 }
예제 #44
0
파일: R.cs 프로젝트: bayulabster/viasfora
 public R(IVsfSettings settings) : base(settings) {
 }
예제 #45
0
 public LanguageFactory(IVsfSettings settings)
 {
     this.defaultLang = new DefaultLanguage(settings);
 }
예제 #46
0
 public DefaultLanguage(IVsfSettings settings) : base(settings)
 {
 }
예제 #47
0
파일: Sql.cs 프로젝트: bayulabster/viasfora
 public Sql(IVsfSettings settings) : base(settings) {
 }
예제 #48
0
 public JScript(IVsfSettings settings) : base(settings) {
 }
예제 #49
0
 public JSON(IVsfSettings settings) : base(settings)
 {
 }
예제 #50
0
 public Cpp(IVsfSettings settings) : base(settings)
 {
 }
예제 #51
0
파일: Python.cs 프로젝트: deus-amd/viasfora
 public Python(IVsfSettings settings) : base(settings)
 {
 }
예제 #52
0
 void OnViewClosed(object sender, EventArgs e)
 {
     if ( this.settings != null ) {
     this.settings.SettingsChanged -= OnSettingsChanged;
     this.settings = null;
       }
       if ( this.view != null ) {
     view.Options.OptionChanged -= OnSettingsChanged;
     view.Caret.PositionChanged -= OnCaretPositionChanged;
     view.ViewportWidthChanged -= OnViewportWidthChanged;
     view.LayoutChanged -= OnLayoutChanged;
     view.ViewportLeftChanged -= OnViewportLeftChanged;
     view.Closed -= OnViewClosed;
     view = null;
       }
       if ( formatMap != null ) {
     formatMap.ClassificationFormatMappingChanged -= OnClassificationFormatMappingChanged;
     formatMap = null;
       }
       layer = null;
       formatType = null;
 }
예제 #53
0
 public FSharp(IVsfSettings settings) : base(settings) {
 }
예제 #54
0
 public Python(IVsfSettings settings) : base(settings) {
 }
예제 #55
0
 public VB(IVsfSettings settings) : base(settings)
 {
 }
예제 #56
0
파일: Css.cs 프로젝트: bayulabster/viasfora
 public Css(IVsfSettings settings) : base(settings) {
 }
예제 #57
0
 private void OnViewClosed(object sender, EventArgs e)
 {
     this.settings.SettingsChanged -= OnSettingsChanged;
       this.settings = null;
       this.outliningManager.RegionsCollapsed -= OnRegionsCollapsed;
       this.theView.LayoutChanged -= OnLayoutChanged;
       this.theView.GotAggregateFocus -= OnGotFocus;
       this.theView.Closed -= OnViewClosed;
       this.theView = null;
       this.outliningManager = null;
 }