/// <summary> /// 获取父对象 /// </summary> /// <param name="pathInfo"></param> /// <returns></returns> public VxPathInfo GetParent(VxPathInfo pathInfo) { if (pathInfo == null) { throw new ArgumentNullException(nameof(pathInfo)); } return(this.OnGetParent(pathInfo)); }
/// <summary> /// 获取父对象 /// </summary> /// <param name="pathInfo"></param> /// <returns></returns> protected virtual VxPathInfo OnGetParent(VxPathInfo pathInfo) { if (pathInfo.IsRoot) { return(pathInfo); } return(this.OnCreatePathInfo(pathInfo.GetParentPathString())); }
/// <summary> /// 获取所有子级文件 /// </summary> /// <param name="pathInfo"></param> /// <param name="pattern"></param> /// <returns></returns> public IEnumerable <VxPathInfo> GetFiles(VxPathInfo pathInfo, string pattern) => this.OnGetFiles(pathInfo, pattern);
/// <summary> /// 获取指定对象相对环境的完整路径 /// </summary> /// <param name="pathInfo"></param> /// <returns></returns> public string GetFullPathString(VxPathInfo pathInfo) => this.OnGetFullPathString(pathInfo);
/// <summary> /// 获取所有子级对象 /// </summary> /// <param name="pathInfo"></param> /// <param name="pattern"></param> /// <returns></returns> protected virtual IEnumerable <VxPathInfo> OnGetChildren(VxPathInfo pathInfo, string pattern) { throw new NotImplementedException(); }
/// <summary> /// 获取指定对象相对环境的完整路径 /// </summary> /// <param name="pathInfo"></param> /// <returns></returns> protected virtual string OnGetFullPathString(VxPathInfo pathInfo) { return($"{this.EntryPathString}{pathInfo.PathString.Substring(1)}"); }
/// <summary> /// 获取所有子级对象 /// </summary> /// <param name="pathInfo"></param> /// <param name="pattern"></param> /// <returns></returns> public IEnumerable <VxPathInfo> GetChildren(VxPathInfo pathInfo, string pattern) => this.OnGetChildren(pathInfo, pattern);