Example #1
0
 /// <summary>
 /// 初始化文件夹对象
 /// </summary>
 /// <param name="pathInfo"></param>
 protected override void OnInitialize(IVxPathInfo pathInfo)
 {
     if (!pathInfo.Exists)
     {
         pathInfo.Create(VxPathType.Folder);
     }
 }
Example #2
0
 /// <summary>
 /// 校验一个虚拟路径对象是否一个文件对象
 /// </summary>
 /// <param name="pathInfo"></param>
 /// <returns></returns>
 protected sealed override IVxPathInfo VerifyVxPathObject(IVxPathInfo pathInfo)
 {
     if (pathInfo.Exists && !pathInfo.IsFile)
     {
         throw new InvalidOperationException($"path {pathInfo.PhysicalPath} must be a file object.");
     }
     return(pathInfo);
 }
Example #3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="virtualPath"></param>
 protected VxIoObject(IVxPathInfo virtualPath)
 {
     if (virtualPath == null)
     {
         throw new ArgumentNullException(nameof(virtualPath));
     }
     this.VxPathObject = this.VerifyVxPathObject(virtualPath);
     this.OnInitialize(this.VxPathObject);
 }
Example #4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="virtualPath"></param>
 public VxFileInfo(IVxPathInfo virtualPath)
     : base(virtualPath)
 {
 }
Example #5
0
 string IVxProviderInfo.GetFullPathString(IVxPathInfo pathInfo) => this.GetFullPathString(pathInfo as VxPathInfo);
Example #6
0
 IVxPathInfo IVxProviderInfo.GetParent(IVxPathInfo pathInfo) => this.GetParent(pathInfo as VxPathInfo);
Example #7
0
 IEnumerable <IVxPathInfo> IVxProviderInfo.GetFolders(IVxPathInfo pathInfo, string pattern) => this.GetFolders(pathInfo as VxPathInfo, pattern);
Example #8
0
 IEnumerable <IVxPathInfo> IVxProviderInfo.GetChildren(IVxPathInfo pathInfo, string pattern) => this.GetChildren(pathInfo as VxPathInfo, pattern);
Example #9
0
 /// <summary>
 /// 执行初始化
 /// </summary>
 /// <param name="pathInfo"></param>
 protected virtual void OnInitialize(IVxPathInfo pathInfo)
 {
 }
Example #10
0
 /// <summary>
 /// 验证路径对象是否一个有效的目标对象
 /// </summary>
 /// <param name="pathInfo"></param>
 /// <returns></returns>
 protected abstract IVxPathInfo VerifyVxPathObject(IVxPathInfo pathInfo);
Example #11
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="virtualPath"></param>
 public VxFolderInfo(IVxPathInfo virtualPath)
     : base(virtualPath)
 {
 }