/* Copyright (C) 2014-2019 de4dot@gmail.com This file is part of dnSpy dnSpy is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. dnSpy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with dnSpy. If not, see . */ using System; using System.Collections.Generic; using VSTE = Microsoft.VisualStudio.Text.Editor; namespace dnSpy.Contracts.Hex.Editor { /// /// Creates hex views and hosts /// public abstract class HexEditorFactoryService { /// /// Constructor /// protected HexEditorFactoryService() { } /// /// Gets all predefined hex view roles /// public abstract VSTE.ITextViewRoleSet AllPredefinedRoles { get; } /// /// Gets the default hex view roles /// public abstract VSTE.ITextViewRoleSet DefaultRoles { get; } /// /// Gets an empty role set /// public abstract VSTE.ITextViewRoleSet NoRoles { get; } /// /// Raised when a new hex view is created /// public abstract event EventHandler? HexViewCreated; /// /// Creates a new /// /// Buffer /// public virtual WpfHexView Create(HexBuffer buffer) => Create(buffer, (HexViewCreatorOptions?)null); /// /// Creates a new /// /// Buffer /// Roles /// public virtual WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles) => Create(buffer, roles, (HexViewCreatorOptions?)null); /// /// Creates a new /// /// Buffer /// Roles /// Parent options /// public virtual WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, VSTE.IEditorOptions parentOptions) => Create(buffer, roles, parentOptions, (HexViewCreatorOptions?)null); /// /// Creates a new /// /// Buffer /// Options or null /// public abstract WpfHexView Create(HexBuffer buffer, HexViewCreatorOptions? options); /// /// Creates a new /// /// Buffer /// Roles /// Options or null /// public abstract WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, HexViewCreatorOptions? options); /// /// Creates a new /// /// Buffer /// Roles /// Parent options /// Options or null /// public abstract WpfHexView Create(HexBuffer buffer, VSTE.ITextViewRoleSet roles, VSTE.IEditorOptions parentOptions, HexViewCreatorOptions? options); /// /// Creates a new /// /// Hex view /// true to set focus /// public abstract WpfHexViewHost CreateHost(WpfHexView wpfHexView, bool setFocus); /// /// Creates a role set /// /// Roles /// public abstract VSTE.ITextViewRoleSet CreateTextViewRoleSet(IEnumerable roles); /// /// Creates a role set /// /// Roles /// public abstract VSTE.ITextViewRoleSet CreateTextViewRoleSet(params string[] roles); } }