Пример #1
0
 /// <summary>
 /// Resets the layout of the dock panels to a developer specified location.
 /// </summary>
 public void ResetLayout()
 {
     // todo: consider plugins that have closed panels and don't want them displayed at this point when the layout is reset.
     // also: consider whether a plugin has been unloaded since the layout was persisted.
     if (defaultLayout != null)
     {
         defaultLayout.Position = 0;
         try
         {
             dockManager.RestoreLayoutFromStream(defaultLayout);
         }
         catch (ArgumentOutOfRangeException)
         {
             // There were more plugins the last time the layout was saved than there are now.
             Trace.WriteLine("ArgumentOutOfRangeException while resetting dock layout.");
         }
         catch (InvalidCastException)
         {
             // There were more plugins the last time the layout was saved than there are now.
             Trace.WriteLine("InvalidCastException while resetting dock layout.");
         }
     }
 }