Example #1
0
 /// <summary>
 /// Returns true if the current value under the caret should be highlighted
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool HighlightCurrentValue(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.HighlightCurrentValueId));
 }
Example #2
0
 /// <summary>
 /// Returns the delay in milliseconds before highlighting the new value
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static int GetHighlightCurrentValueDelayMilliSeconds(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.HighlightCurrentValueDelayMilliSecondsId));
 }
Example #3
0
 /// <summary>
 /// Returns true if extra vertical pixels should be removed from text lines
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsRemoveExtraTextLineVerticalPixelsEnabled(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.RemoveExtraTextLineVerticalPixelsId));
 }
Example #4
0
 /// <summary>
 /// Returns column group #1 line kind
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static HexColumnLineKind GetColumnGroupLine1Kind(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.ColumnGroupLine1Id));
 }
Example #5
0
 /// <summary>
 /// Returns true if refresh-screen-on-change is enabled
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsRefreshScreenOnChangeEnabled(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.RefreshScreenOnChangeId));
 }
Example #6
0
 /// <summary>
 /// Returns the number of milliseconds to wait before refreshing the screen after the document gets changed
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static int GetRefreshScreenOnChangeWaitMilliSeconds(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.RefreshScreenOnChangeWaitMilliSecondsId));
 }
Example #7
0
 /// <summary>
 /// Returns true if text should be colorized
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsColorizationEnabled(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.EnableColorizationId));
 }
Example #8
0
 /// <summary>
 /// Returns true if the hex view prohibits user input
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool DoesViewProhibitUserInput(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.ViewProhibitUserInputId));
 }
Example #9
0
 /// <summary>
 /// Returns true if the offset is displayed in lower case hex
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsOffsetLowerCaseHexEnabled(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.OffsetLowerCaseHexId));
 }
Example #10
0
 /// <summary>
 /// Returns the number of bytes in a group
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static int GetGroupSizeInBytes(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.GroupSizeInBytesId));
 }
Example #11
0
 /// <summary>
 /// Returns the offset format
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static HexOffsetFormat GetOffsetFormat(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.HexOffsetFormatId));
 }
Example #12
0
 /// <summary>
 /// Returns true if the positions are relative to the base
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool UseRelativePositions(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.UseRelativePositionsId));
 }
Example #13
0
 /// <summary>
 /// Returns true if the zoom control is enabled
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsZoomControlEnabled(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewHostOptions.ZoomControlId));
 }
 /// <summary>
 /// Returns true if the active column (values or ASCII) should be highlighted
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool HighlightActiveColumn(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.HighlightActiveColumnId));
 }
Example #15
0
 /// <summary>
 /// Returns the encoding code page
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static int GetEncodingCodePage(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.EncodingCodePageId));
 }
Example #16
0
 /// <summary>
 /// Returns the zoom level
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static double ZoomLevel(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultWpfHexViewOptions.ZoomLevelId));
 }
 /// <summary>
 /// Returns the number of bytes that should be displayed per line
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static int GetBytesPerLine(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.BytesPerLineId));
 }
Example #18
0
 /// <summary>
 /// Returns true if mouse wheel zoom is enabled
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsMouseWheelZoomEnabled(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultWpfHexViewOptions.EnableMouseWheelZoomId));
 }
Example #19
0
 /// <summary>
 /// Returns the appearance category
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static string AppearanceCategory(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultWpfHexViewOptions.AppearanceCategoryId));
 }
Example #20
0
 /// <summary>
 /// Returns true if the current line should be highlighted
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsHighlightCurrentLineEnabled(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultWpfHexViewOptions.EnableHighlightCurrentLineId));
 }
Example #21
0
 /// <summary>
 /// Returns true if simple graphics option is enabled
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsSimpleGraphicsEnabled(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultWpfHexViewOptions.EnableSimpleGraphicsId));
 }
Example #22
0
 /// <summary>
 /// Returns true if the horizontal scroll bar is enabled
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsHorizontalScrollBarEnabled(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewHostOptions.HorizontalScrollBarId));
 }
Example #23
0
 /// <summary>
 /// Returns true if clear type should be forced is enabled
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsForceClearTypeIfNeededEnabled(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultWpfHexViewOptions.ForceClearTypeIfNeededId));
 }
Example #24
0
 /// <summary>
 /// Returns true if the the glyph margin is enabled
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsGlyphMarginEnabled(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewHostOptions.GlyphMarginId));
 }
Example #25
0
 /// <summary>
 /// Returns true if high contrast mode is enabled
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool IsInContrastMode(this VSTE.IEditorOptions options)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewHostOptions.IsInContrastModeId));
 }
Example #26
0
 /// <summary>
 /// Gets the end position
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static HexPosition GetEndPosition(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.EndPositionId));
 }
Example #27
0
 /// <summary>
 /// Returns true if the ASCII column is shown
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool ShowAsciiColumn(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.ShowAsciiColumnId));
 }
Example #28
0
 /// <summary>
 /// Returns true if the structure under the mouse cursor should be highlighted
 /// </summary>
 /// <param name="options">Options</param>
 /// <returns></returns>
 public static bool HighlightStructureUnderMouseCursor(this VSTE.IEditorOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.GetOptionValue(DefaultHexViewOptions.HighlightStructureUnderMouseCursorId));
 }
Example #29
0
        /// <summary>
        /// Returns the encoding
        /// </summary>
        /// <param name="options">Options</param>
        /// <returns></returns>
        public static Encoding TryGetEncoding(this VSTE.IEditorOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            var codePage = options.GetEncodingCodePage();

            try {
                return(Encoding.GetEncoding(codePage));
            }
            catch {
                return(null);
            }
        }
 /// <summary>
 /// Creates a new <see cref="WpfHexView"/>
 /// </summary>
 /// <param name="buffer">Buffer</param>
 /// <param name="roles">Roles</param>
 /// <param name="parentOptions">Parent options</param>
 /// <returns></returns>
 public virtual WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, VSTE.IEditorOptions parentOptions) => Create(buffer, roles, parentOptions, (HexViewCreatorOptions?)null);