/// <summary> /// Switch to the full-window editor view for the given editor block. /// </summary> public void EnterEditorView(BlockControl block) { SaveScrollOffsets(); EditorViewControl.Instance.SetEditor(block); Content = EditorViewControl.Instance; SplayCodeToolWindow.SetEditorViewMode(true); }
/// <summary> /// Initializes a new instance of the <see cref="SplayCodeToolWindow"/> class. /// </summary> public SplayCodeToolWindow() : base(null) { this.Caption = "SplayCode"; instance = this; // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable, // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on // the object returned by the Content property. this.Content = VirtualSpaceControl.Instance; }
/// <summary> /// Shows the tool window when the menu item is clicked. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event args.</param> private void ShowToolWindow(object sender, EventArgs e) { // Get the instance number 0 of this tool window. This window is single instance so this instance // is actually the only one. // The last flag is set to true so that if the tool window does not exists it will be created. SplayCodeToolWindow window = SplayCodeToolWindow.Instance; if ((null == window) || (null == window.Frame)) { throw new NotSupportedException("Cannot create tool window"); } SplayCodeToolWindow.Instance.Activate(); }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { SplayCodeToolWindow window = (SplayCodeToolWindow)FindToolWindow(typeof(SplayCodeToolWindow), 0, true); if ((null == window) || (null == window.Frame)) { throw new NotSupportedException("Cannot create tool window"); } SplayCodeCommand.Initialize(this); base.Initialize(); AddFileCommand.Initialize(this); SaveLayoutCommand.Initialize(this); LoadLayoutCommand.Initialize(this); ClearLayoutCommand.Initialize(this); LayoutUndoCommand.Initialize(this); AddPackageCommand.Initialize(this); FindCommand.Initialize(this); EditorControl.OLEServiceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)GetService( typeof(Microsoft.VisualStudio.OLE.Interop.IServiceProvider)); }
/// <summary> /// Switch back to the virtual space from the full-window editor view. /// </summary> public void ExitEditorView() { SplayCodeToolWindow.SetEditorViewMode(false); Content = virtualSpace; LoadScrollOffsets(); }