SharpDevelop IDE IViewContent.cs类

打印 上一主题 下一主题

主题 816|帖子 816|积分 2448

文件位置:IViewContent.cs
  1. /// <summary>
  2.         /// IViewContent is the base interface for "windows" in the document area of SharpDevelop.
  3.         /// A view content is a view onto multiple files, or other content that opens like a document
  4.         /// (e.g. the start page).
  5.         /// </summary>
  6.         public interface IViewContent : IDisposable, ICanBeDirty, IServiceProvider
  7.         {
  8.                 /// <summary>
  9.                 /// This is the UI element for the view.
  10.                 /// You can use both Windows.Forms and WPF controls.
  11.                 /// </summary>
  12.                 object Control {
  13.                         get;
  14.                 }
  15.                
  16.                 /// <summary>
  17.                 /// Gets the control which has focus initially.
  18.                 /// </summary>
  19.                 object InitiallyFocusedControl {
  20.                         get;
  21.                 }
  22.                
  23.                 /// <summary>
  24.                 /// The workbench window in which this view is displayed.
  25.                 /// </summary>
  26.                 IWorkbenchWindow WorkbenchWindow {
  27.                         get;
  28.                         set;
  29.                 }
  30.                
  31.                 /// <summary>
  32.                 /// Is raised when the value of the TabPageText property changes.
  33.                 /// </summary>
  34.                 event EventHandler TabPageTextChanged;
  35.                
  36.                 /// <summary>
  37.                 /// The text on the tab page when more than one view content
  38.                 /// is attached to a single window.
  39.                 /// </summary>
  40.                 string TabPageText {
  41.                         get;
  42.                 }
  43.                
  44.                 /// <summary>
  45.                 /// The title of the view content. This normally is the title of the primary file being edited.
  46.                 /// </summary>
  47.                 string TitleName {
  48.                         get;
  49.                 }
  50.                
  51.                 /// <summary>
  52.                 /// Is called each time the name for the content has changed.
  53.                 /// </summary>
  54.                 event EventHandler TitleNameChanged;
  55.                
  56.                 /// <summary>
  57.                 /// The tooltip that will be shown when you hover the mouse over the title
  58.                 /// </summary>
  59.                 string InfoTip {
  60.                         get;
  61.                 }
  62.                 /// <summary>
  63.                 /// Is called each time the info tip for the content has changed.
  64.                 /// </summary>
  65.                 event EventHandler InfoTipChanged;
  66.                 /// <summary>
  67.                 /// Saves the content to the location <code>fileName</code>
  68.                 /// </summary>
  69.                 /// <remarks>
  70.                 /// When the user switches between multiple views editing the same file, a view
  71.                 /// change will trigger one view content to save that file into a memory stream
  72.                 /// and the other view content will load the file from that memory stream.
  73.                 /// </remarks>
  74.                 void Save(OpenedFile file, Stream stream);
  75.                
  76.                 /// <summary>
  77.                 /// Load or reload the content of the specified file from the stream.
  78.                 /// </summary>
  79.                 /// <remarks>
  80.                 /// When the user switches between multiple views editing the same file, a view
  81.                 /// change will trigger one view content to save that file into a memory stream
  82.                 /// and the other view content will load the file from that memory stream.
  83.                 /// </remarks>
  84.                 void Load(OpenedFile file, Stream stream);
  85.                
  86.                 /// <summary>
  87.                 /// Gets the list of files that are being edited using this view content.
  88.                 /// The returned collection usually is read-only.
  89.                 /// </summary>
  90.                 IList<OpenedFile> Files { get; }
  91.                
  92.                 /// <summary>
  93.                 /// Gets the primary file being edited. Might return null if no file is edited.
  94.                 /// </summary>
  95.                 OpenedFile PrimaryFile { get; }
  96.                
  97.                 /// <summary>
  98.                 /// Gets the name of the primary file being edited. Might return null if no file is edited.
  99.                 /// </summary>
  100.                 FileName PrimaryFileName { get; }
  101.                
  102.                 /// <summary>
  103.                 /// Builds an <see cref="INavigationPoint"/> for the current position.
  104.                 /// </summary>
  105.                 INavigationPoint BuildNavPoint();
  106.                
  107.                 bool IsDisposed { get; }
  108.                
  109.                 event EventHandler Disposed;
  110.                
  111.                 /// <summary>
  112.                 /// Gets if the view content is read-only (can be saved only when choosing another file name).
  113.                 /// </summary>
  114.                 bool IsReadOnly { get; }
  115.                
  116.                 /// <summary>
  117.                 /// Gets if the view content is view-only (cannot be saved at all).
  118.                 /// </summary>
  119.                 bool IsViewOnly { get; }
  120.                
  121.                 /// <summary>
  122.                 /// Gets whether this view content should be closed when the solution is closed.
  123.                 /// </summary>
  124.                 bool CloseWithSolution { get; }
  125.                
  126.                 #region Secondary view content support
  127.                 /// <summary>
  128.                 /// Gets the collection that stores the secondary view contents.
  129.                 /// </summary>
  130.                 ICollection<IViewContent> SecondaryViewContents { get; }
  131.                
  132.                
  133.                 /// <summary>
  134.                 /// Gets switching without a Save/Load cycle for <paramref name="file"/> is supported
  135.                 /// when switching from this view content to <paramref name="newView"/>.
  136.                 /// </summary>
  137.                 bool SupportsSwitchFromThisWithoutSaveLoad(OpenedFile file, IViewContent newView);
  138.                
  139.                 /// <summary>
  140.                 /// Gets switching without a Save/Load cycle for <paramref name="file"/> is supported
  141.                 /// when switching from <paramref name="oldView"/> to this view content.
  142.                 /// </summary>
  143.                 bool SupportsSwitchToThisWithoutSaveLoad(OpenedFile file, IViewContent oldView);
  144.                
  145.                 /// <summary>
  146.                 /// Executes an action before switching from this view content to the new view content.
  147.                 /// </summary>
  148.                 void SwitchFromThisWithoutSaveLoad(OpenedFile file, IViewContent newView);
  149.                
  150.                 /// <summary>
  151.                 /// Executes an action before switching from the old view content to this view content.
  152.                 /// </summary>
  153.                 void SwitchToThisWithoutSaveLoad(OpenedFile file, IViewContent oldView);
  154.                 #endregion
  155.         }
复制代码
IViewContent 是一个接口,定义了视图内容的根本举动和属性。在 SharpDevelop IDE 中,视图内容是文档地区中的“窗口”,可以是一个编辑器窗口,也可以是其他类型的窗口,如起始页。
以下是 IViewContent 接口的重要功能:

  • 获取和设置视图内容的 UI 元素:通过 Control 属性,可以获取和设置视图内容的 UI 元素。这个 UI 元素可以是 Windows.Forms 控件,也可以是 WPF 控件。
  • 获取和设置视图内容的标题:通过 TitleName 属性,可以获取和设置视图内容的标题。这个标题通常是正在编辑的重要文件的标题。
  • 获取和设置视图内容的标签页文本:通过 TabPageText 属性,可以获取和设置视图内容的标签页文本。这个文本在多个视图内容附加到同一个窗口时利用。
  • 保存和加载视图内容:通过 Save 和 Load 方法,可以保存和加载视图内容。这些方法担当一个 OpenedFile 对象和一个 Stream 对象,用于保存和加载文件。
  • 获取正在编辑的文件列表:通过 Files 属性,可以获取正在编辑的文件列表。这个列表通常是一个只读的集合。
  • 获取正在编辑的重要文件:通过 PrimaryFile 属性,可以获取正在编辑的重要文件。假如没有任何文件正在编辑,这个属性可能返回 null。
  • 获取正在编辑的重要文件的名称:通过 PrimaryFileName 属性,可以获取正在编辑的重要文件的名称。假如没有任何文件正在编辑,这个属性可能返回 null。
  • 构建导航点:通过 BuildNavPoint 方法,可以构建一个导航点,用于表示当前的位置。
  • 获取视图内容的关闭举动:通过 CloseWithSolution 属性,可以获取视图内容的关闭举动。这个属性表示当办理方案关闭时,视图内容是否应该关闭。
  • 获取视图内容的只读和只读状态:通过 IsReadOnly 和 IsViewOnly 属性,可以获取视图内容的只读和只读状态。假如视图内容是只读的,那么它只能保存到另一个文件名,不能保存到原始文件。假如视图内容是只读的,那么它不能保存到任何文件。
  • 获取和设置视图内容的上下文资助提供者:通过 ContextHelpProvider 属性,可以获取和设置视图内容的上下文资助提供者。上下文资助提供者用于提供上下文干系的资助信息。
  • 获取和设置视图内容的工具宿主:通过 ToolsHost 属性,可以获取和设置视图内容的工具宿主。工具宿主用于显示和管理工具。
  • 获取和设置视图内容的属性容器:通过 PropertyContainer 属性,可以获取和设置视图内容的属性容器。属性容器用于存储和显示对象的属性。
  • 获取和设置视图内容的剪贴板处置处罚程序:通过 ClipboardHandler 属性,可以获取和设置视图内容的剪贴板处置处罚程序。剪贴板处置处罚程序用于处置处罚剪贴板操作,如复制、粘贴、剪切等。
  • 获取和设置视图内容的撤销处置处罚程序:通过 UndoHandler 属性,可以获取和设置视图内容的撤销处置处罚程序。撤销处置处罚程序用于处置处罚撤销和重做操作。
  • 获取和设置视图内容的文件文档提供程序:通过 FileDocumentProvider 属性,可以获取和设置视图内容的文件文档提供程序。文件文档提供程序用于提供文件文档。
  • 获取和设置视图内容的组件变动服务:通过 ComponentChangeService 属性,可以获取和设置视图内容的组件变动服务。组件变动服务用于通知组件的变动。
  • **获取和设置视图内容的

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

大连密封材料

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表