Exemplo n.º 1
0
        internal RWPathInfo(RWPathInfo parent)
        {
            if (parent == null && Root != null)
            {
                throw new ArgumentNullException(nameof(parent));
            }

            Parent = parent;
        }
Exemplo n.º 2
0
 /// <summary>
 /// 创建一个对象路径信息。
 /// </summary>
 /// <typeparam name="TKey">键类型</typeparam>
 /// <param name="key">键</param>
 /// <param name="parent">父级路径</param>
 /// <returns>返回一个新的路径信息</returns>
 public static RWPathInfo Create <TKey>(TKey key, RWPathInfo parent = null) => new RWPathInfo <TKey>(key, parent ?? Root);