コード例 #1
0
 internal void GrabFocusForView(DocumentView view)
 {
     if (linkedController != null)
     {
         linkedController?.GrabFocusForView(view);
     }
     else
     {
         OnGrabFocus(view);
     }
 }
コード例 #2
0
 /// <summary>
 /// Gets the view that will show the content of the document.
 /// </summary>
 /// <returns>The view</returns>
 public async Task <DocumentView> GetDocumentView()
 {
     CheckInitialized();
     if (finalViewItem == null)
     {
         try {
             finalViewItem = await itemExtension.OnInitializeView();
         } catch (Exception ex) {
             LoggingService.LogError("View container initialization failed", ex);
             finalViewItem = new DocumentViewContent(() => (Control)null);
         }
         NotifyContentChanged();
     }
     return(finalViewItem);
 }
コード例 #3
0
 async Task <DocumentView> InternalInitializeView()
 {
     if (viewItem == null)
     {
         try {
             viewItem = await OnInitializeView();
         } catch (Exception ex) {
             LoggingService.LogError("View container initialization failed", ex);
             viewItem = new DocumentViewContent(() => (Control)null);
         }
         // If the view already has a controller bound to it, link it to the new one, so that all
         // events from the view are propagated to the old controller besides the new one.
         if (viewItem.SourceController != null)
         {
             linkedController = viewItem.SourceController;
             linkedController.linkedControllerParent = this;
         }
         viewItem.SourceController = this;
     }
     return(viewItem);
 }
コード例 #4
0
ファイル: DocumentView.cs プロジェクト: Zyx-A/monodevelop
 public DocumentView()
 {
     AttachedViews.AttachListener(this);
     activeAttachedView = this;
 }
コード例 #5
0
 /// <summary>
 /// Called when the view of this controller needs to grab the focus (usually because it has
 /// become the active document).
 /// </summary>
 /// <param name="view">View.</param>
 protected virtual void OnGrabFocus(DocumentView view)
 {
     // Use the default GrabFocus implementation in DocumentView.
     view.DefaultGrabFocus();
 }