示例#1
0
 public HexCaretLayer(HexCaretImpl hexCaret, HexAdornmentLayer layer, VSTC.IClassificationFormatMap classificationFormatMap, VSTC.IClassificationTypeRegistryService classificationTypeRegistryService)
 {
     if (hexCaret == null)
     {
         throw new ArgumentNullException(nameof(hexCaret));
     }
     if (layer == null)
     {
         throw new ArgumentNullException(nameof(layer));
     }
     if (classificationFormatMap == null)
     {
         throw new ArgumentNullException(nameof(classificationFormatMap));
     }
     if (classificationTypeRegistryService == null)
     {
         throw new ArgumentNullException(nameof(classificationTypeRegistryService));
     }
     overwriteMode = true;
     this.hexCaret = hexCaret;
     this.layer    = layer;
     this.classificationFormatMap    = classificationFormatMap;
     activeCaretClassificationType   = classificationTypeRegistryService.GetClassificationType(CTC.ThemeClassificationTypeNames.HexCaret);
     inactiveCaretClassificationType = classificationTypeRegistryService.GetClassificationType(CTC.ThemeClassificationTypeNames.HexInactiveCaret);
     valuesCaretGeometry             = new CaretGeometry();
     asciiCaretGeometry = new CaretGeometry();
     layer.HexView.Selection.SelectionChanged += Selection_SelectionChanged;
     layer.HexView.VisualElement.AddHandler(GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(VisualElement_GotKeyboardFocus), true);
     layer.HexView.VisualElement.AddHandler(LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(VisualElement_LostKeyboardFocus), true);
     layer.HexView.VisualElement.IsVisibleChanged += VisualElement_IsVisibleChanged;
     classificationFormatMap.ClassificationFormatMappingChanged += ClassificationFormatMap_ClassificationFormatMappingChanged;
     AddAdornment();
 }