Pārlūkot izejas kodu

Updated Add/Remove API docs

Tig 1 gadu atpakaļ
vecāks
revīzija
3b3906a7f1
1 mainītis faili ar 15 papildinājumiem un 1 dzēšanām
  1. 15 1
      Terminal.Gui/View/View.cs

+ 15 - 1
Terminal.Gui/View/View.cs

@@ -514,9 +514,23 @@ public partial class View : Responder, ISupportInitializeNotification
     /// <returns></returns>
     public override string ToString () { return $"{GetType ().Name}({Id}){Frame}"; }
 
-    /// <inheritdoc/>
+    /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
+    /// <remarks>
+    /// <para>
+    ///     Subviews added to this view via <see cref="Add(View)"/> have their lifetime owned by this view and <see cref="Dispose"/> will
+    ///     dispose them. To prevent this, and have the creator of the Subview instance handle disposal, use <see cref="Remove"/> to remove
+    ///     the subview first.
+    /// </para>
+    /// <para>
+    ///     If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and
+    ///     unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from
+    ///     inside the finalizer, and you should not reference other objects. Only unmanaged resources can be disposed.
+    /// </para>
+    /// </remarks>
+    /// <param name="disposing"></param>
     protected override void Dispose (bool disposing)
     {
+        // BUGBUG: We should only dispose these objects if disposing == true
         LineCanvas.Dispose ();
 
         DisposeAdornments ();