瀏覽代碼

增加注释与using编译时控制

luche lin 10 月之前
父節點
當前提交
cbf813ac0a
共有 2 個文件被更改,包括 27 次插入4 次删除
  1. 15 3
      Masuit.Tools.Abstractions/Models/Tree.cs
  2. 12 1
      Masuit.Tools.Abstractions/Models/TreeExtensions.cs

+ 15 - 3
Masuit.Tools.Abstractions/Models/Tree.cs

@@ -1,14 +1,26 @@
-using System.Collections.Generic;
+#if NETFRAMEWORK
+using System.Collections.Generic;
+#endif
 
 namespace Masuit.Tools.Models;
 
+/// <summary>
+/// 代表树形结构的类
+/// </summary>
+/// <typeparam name="T"></typeparam>
 public class Tree<T>
 {
+    /// <summary>
+    /// 初始化方法
+    /// </summary>
+    /// <param name="value"></param>
     public Tree(T value)
     {
         Value = value;
     }
-
+    /// <summary>
+    /// 代表当前节点的值
+    /// </summary>
     public T Value { get; set; }
 
     /// <summary>
@@ -17,7 +29,7 @@ public class Tree<T>
     public virtual T Parent { get; set; }
 
     /// <summary>
-    /// 子
+    /// 子
     /// </summary>
     public virtual ICollection<Tree<T>> Children { get; set; }
 }

+ 12 - 1
Masuit.Tools.Abstractions/Models/TreeExtensions.cs

@@ -1,6 +1,8 @@
-using System;
+#if NETFRAMEWORK
+using System;
 using System.Collections.Generic;
 using System.Linq;
+#endif
 using System.Linq.Expressions;
 using Masuit.Tools.Systems;
 
@@ -867,6 +869,9 @@ public static class TreeExtensions
     }
 }
 
+/// <summary>
+/// 树形数据扩展 long
+/// </summary>
 public static class TreeExtensionLong
 {
     /// <summary>
@@ -881,6 +886,9 @@ public static class TreeExtensionLong
     }
 }
 
+/// <summary>
+/// 树形数据扩展 guid
+/// </summary>
 public static class TreeExtensionGuid
 {
     /// <summary>
@@ -895,6 +903,9 @@ public static class TreeExtensionGuid
     }
 }
 
+/// <summary>
+/// 树形数据扩展 string
+/// </summary>
 public static class TreeExtensionString
 {
     /// <summary>