Ejemplo n.º 1
0
		void WpfTextView_Closed(object sender, EventArgs e) {
			UnregisterEvents();
			RemoveAllLineElements();
			ClearXPosCache();
			blockStructureServiceDataProvider = NullBlockStructureServiceDataProvider.Instance;
			wpfTextView.Closed -= WpfTextView_Closed;
			wpfTextView.Options.OptionChanged -= Options_OptionChanged;
		}
Ejemplo n.º 2
0
		public void SetDataProvider(IBlockStructureServiceDataProvider dataProvider) {
			if (wpfTextView.IsClosed)
				return;
			blockStructureServiceDataProvider = dataProvider ?? NullBlockStructureServiceDataProvider.Instance;
			if (enabled) {
				ClearXPosCache();
				RepaintAllLines();
			}
		}
Ejemplo n.º 3
0
 public BlockStructureService(IWpfTextView wpfTextView, IEditorFormatMapService editorFormatMapService)
 {
     if (wpfTextView == null)
     {
         throw new ArgumentNullException(nameof(wpfTextView));
     }
     if (editorFormatMapService == null)
     {
         throw new ArgumentNullException(nameof(editorFormatMapService));
     }
     this.wpfTextView                  = wpfTextView;
     this.editorFormatMapService       = editorFormatMapService;
     blockStructureServiceDataProvider = NullBlockStructureServiceDataProvider.Instance;
     onRemovedDelegate                 = OnRemoved;
     lineElements   = new List <LineElement>();
     xPosCache      = new XPosCache(wpfTextView);
     lineColorInfos = new LineColorInfo[TextColor.BlockStructureXaml - TextColor.BlockStructureNamespace + 1] {
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureNamespace),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureType),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureModule),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureValueType),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureInterface),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureMethod),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureAccessor),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureAnonymousMethod),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureConstructor),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureDestructor),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureOperator),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureConditional),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureLoop),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureProperty),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureEvent),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureTry),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureCatch),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureFilter),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureFinally),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureFault),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureLock),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureUsing),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureFixed),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureSwitch),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureCase),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureLocalFunction),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureOther),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureXml),
         new LineColorInfo(ThemeClassificationTypeNameKeys.BlockStructureXaml),
     };
     wpfTextView.Closed += WpfTextView_Closed;
     wpfTextView.Options.OptionChanged += Options_OptionChanged;
     UpdateEnabled();
 }