示例#1
0
 /// <summary>
 /// Record a form's position and that of several splitters.
 /// </summary>
 /// <param name="windowSettings">Where the settings should be recorded,
 /// or null.</param>
 /// <param name="form">The form to record. May be null if you just want 
 /// to record splitter positions.</param>
 /// <param name="splitters">The splitters to record. You can change 
 /// some entries to null if you no longer use that position in the 
 /// list.</param>
 /// <returns>The windowSettings parameter, or a new WindowSettings 
 /// object if that was null.</returns>
 public static WindowSettings Record(
     WindowSettings windowSettings,
     Form form,
     params SplitContainer[] splitters)
 {
     if(windowSettings == null) {
         windowSettings = new WindowSettings();
     }
     windowSettings.Record(form, splitters);
     return windowSettings;
 }
示例#2
0
 /// <summary>
 /// Restore a form's position and that of several splitters.
 /// </summary>
 /// <param name="windowSettings">Holds the settings to restore.</param>
 /// <param name="form">The form to restore. May be null if you just want 
 /// to record splitter positions.</param>
 /// <param name="splitters">The splitters to restore. You can change 
 /// some entries to null if you no longer use that position in the 
 /// list.</param>
 public static void Restore(
     WindowSettings windowSettings,
     Form form,
     params SplitContainer[] splitters)
 {
     if(windowSettings != null) {
         windowSettings.Restore(form, splitters);
     }
 }