/// <summary>
 /// Event called when the docked panel is being closed</summary>
 /// <param name="sender">The parent control</param>
 /// <param name="args">Event args indicating which content to close</param>
 public void OnClose(object sender, ContentClosedEventArgs args)
 {
     if (Closing != null)
     {
         Closing(this, args);
     }
 }
Example #2
0
 void Content_Closing(object sender, ContentClosedEventArgs args)
 {
     if (Parent is IDockLayout)
     {
         ((IDockLayout)Parent).Undock((IDockContent)DockedContent);
     }
     Close();
 }
Example #3
0
 /// <summary>
 /// Handle Close event and perform custom actions</summary>
 /// <param name="sender">Event sender</param>
 /// <param name="args">Arguments describing change</param>
 public void OnClose(object sender, ContentClosedEventArgs args)
 {
     if (args.ContentToClose == ContentToClose.Current && Children.Count > 1)
     {
         DockContent content = ((DockContent)SelectedItem);
         RemoveItem(content);
         content.OnClose(content, new ContentClosedEventArgs(ContentToClose.All));
     }
     else
     {
         while (Children.Count > 0)
         {
             DockContent content = Children[0];
             RemoveItem(content);
             content.OnClose(content, new ContentClosedEventArgs(ContentToClose.All));
         }
         if (Children.Count == 0 && Closing != null)
         {
             Closing(this, new ContentClosedEventArgs(ContentToClose.Current));
         }
     }
 }
Example #4
0
File: Editor.cs Project: zparr/ATF
        private void DockContent_Closing(object sender, Sce.Atf.Wpf.Docking.ContentClosedEventArgs args)
        {
            var dockContent = sender as DockContent;

            if (sender == null)
            {
                return;
            }

            var control = dockContent.Content as System.Windows.Forms.Control;

            if (control == null)
            {
                return;
            }

            var document = control.Tag as WinGuiWpfDataDocument;

            if (document != null)
            {
                Close(document);
            }
        }
Example #5
0
 /// <summary>
 /// Handle Close event and perform custom actions</summary>
 /// <param name="sender">Event sender</param>
 /// <param name="args">Arguments describing change</param>
 public void OnClose(object sender, ContentClosedEventArgs args)
 {
     if (args.ContentToClose == ContentToClose.Current && Children.Count > 1)
     {
         DockContent content = ((DockContent)SelectedItem);
         RemoveItem(content);
         content.OnClose(content, new ContentClosedEventArgs(ContentToClose.All));
     }
     else
     {
         while (Children.Count > 0)
         {
             DockContent content = Children[0];
             RemoveItem(content);
             content.OnClose(content, new ContentClosedEventArgs(ContentToClose.All));					
         }
         if (Children.Count == 0 && Closing != null)
         {
             Closing(this, new ContentClosedEventArgs(ContentToClose.Current));
         }
     }
 }
Example #6
0
 private void DockContentOnClosing(object sender, ContentClosedEventArgs e)
 {
     DockContent dockContent = (DockContent)sender;
     var controlInfo = FindControlInfo(dockContent.Content);
     controlInfo.Client.Close(dockContent.Content, false);
 }
Example #7
0
 void Content_Closing(object sender, ContentClosedEventArgs args)
 {
     if (Parent is IDockLayout)
     {
         ((IDockLayout)Parent).Undock((IDockContent)DockedContent);
     }
     Close();
 }
Example #8
0
 /// <summary>
 /// Event called when the docked panel is being closed</summary>
 /// <param name="sender">The parent control</param>
 /// <param name="args">Event args indicating which content to close</param>
 public void OnClose(object sender, ContentClosedEventArgs args)
 {
     if (Closing != null)
     {
         Closing(this, args);
     }
 }