Ejemplo n.º 1
0
 private void ViewService_ViewClosed(object sender, ViewEventArgs e)
 {
     ViewBridge.LinkedView linkedView = this.FindLinkedView(e.View);
     linkedView.Hiding            -= new CancelEventHandler(this.View_Hiding);
     linkedView.IsSelectedChanged -= new EventHandler(this.View_IsSelectedChanged);
     linkedView.Content            = (object)null;
     this.documentGroup.Children.Remove((ViewElement)linkedView);
     linkedView.Dispose();
 }
Ejemplo n.º 2
0
 private ViewBridge.LinkedView FindLinkedView(IView view)
 {
     return((ViewBridge.LinkedView) this.documentGroup.Find((Predicate <ViewElement>)(viewElement =>
     {
         ViewBridge.LinkedView linkedView = viewElement as ViewBridge.LinkedView;
         if (linkedView != null)
         {
             return linkedView.ViewReference == view;
         }
         return false;
     })));
 }
Ejemplo n.º 3
0
 private void ViewService_ViewOpened(object sender, ViewEventArgs e)
 {
     ViewBridge.LinkedView linkedView = (ViewBridge.LinkedView)Microsoft.VisualStudio.PlatformUI.Shell.View.Create(this.ActiveWindowProfile, "Document", typeof(ViewBridge.LinkedView));
     linkedView.ViewReference = e.View;
     linkedView.Initialize(e.View);
     linkedView.Title              = (object)e.View.Caption;
     linkedView.Content            = (object)((IElementProvider)e.View).Element;
     linkedView.Hiding            += new CancelEventHandler(this.View_Hiding);
     linkedView.IsSelectedChanged += new EventHandler(this.View_IsSelectedChanged);
     DockOperations.DockAt((ViewElement)this.documentGroup, (ViewElement)linkedView, -1);
     linkedView.Show();
 }
Ejemplo n.º 4
0
 private void View_IsSelectedChanged(object sender, EventArgs e)
 {
     if (this.silenced)
     {
         return;
     }
     ViewBridge.LinkedView linkedView = (ViewBridge.LinkedView)sender;
     if (!linkedView.IsSelected)
     {
         return;
     }
     this.viewService.ActiveView = linkedView.ViewReference;
 }
Ejemplo n.º 5
0
 private void ViewService_ActiveViewChanged(object sender, ViewChangedEventArgs e)
 {
     if (e.NewView == null)
     {
         return;
     }
     ViewBridge.LinkedView linkedView = this.FindLinkedView(e.NewView);
     if (linkedView.IsSelected)
     {
         return;
     }
     linkedView.ShowInFront();
 }
Ejemplo n.º 6
0
 private void WorkspaceService_ActiveWorkspaceChanging(object sender, CancelEventArgs e)
 {
     if (this.documentGroup == null)
     {
         return;
     }
     this.silenced    = true;
     this.viewShelter = new List <ViewBridge.LinkedView>(this.documentGroup.Children.Count);
     foreach (ViewBridge.LinkedView linkedView in (IEnumerable <ViewElement>) this.documentGroup.Children)
     {
         this.viewShelter.Add(linkedView);
     }
     this.viewShelterActive = (ViewBridge.LinkedView) this.documentGroup.SelectedElement;
 }
Ejemplo n.º 7
0
 private void WorkspaceService_ActiveWorkspaceChanged(object sender, EventArgs e)
 {
     this.UpdateDocumentGroup();
     if (this.viewShelter != null)
     {
         foreach (ViewElement viewElement in this.viewShelter)
         {
             this.documentGroup.Children.Add(viewElement);
         }
         this.documentGroup.SelectedElement = (ViewElement)this.viewShelterActive;
     }
     this.viewShelter       = (List <ViewBridge.LinkedView>)null;
     this.viewShelterActive = (ViewBridge.LinkedView)null;
     this.silenced          = false;
 }
Ejemplo n.º 8
0
        private void View_Hiding(object sender, CancelEventArgs e)
        {
            if (this.silenced)
            {
                return;
            }
            ViewBridge.LinkedView linkedView   = (ViewBridge.LinkedView)sender;
            IDocumentView         documentView = linkedView.ViewReference as IDocumentView;

            if (documentView != null && this.GetViewCount(documentView.Document) <= 1 && !this.viewService.PromptToSaveAssociatedDocument(documentView.Document, this.messageDisplayService))
            {
                e.Cancel = true;
            }
            if (e.Cancel)
            {
                return;
            }
            this.viewService.CloseView(linkedView.ViewReference);
        }
Ejemplo n.º 9
0
 private void WorkspaceService_ActiveWorkspaceChangingCanceled(object sender, EventArgs e)
 {
     this.viewShelter       = (List <ViewBridge.LinkedView>)null;
     this.viewShelterActive = (ViewBridge.LinkedView)null;
     this.silenced          = false;
 }