ToB企服应用市场:ToB评测及商务社交产业平台

标题: SharpDevelop IDE IViewContent.cs类 [打印本页]

作者: 大连密封材料    时间: 2024-12-5 08:11
标题: SharpDevelop IDE IViewContent.cs类
文件位置: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 接口的重要功能:

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




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4