Example #1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="virtualPath"></param>
        /// <param name="provider"></param>
        public VxPathInfo(string virtualPath, VxProviderInfo provider)
        {
            if (string.IsNullOrWhiteSpace(virtualPath))
            {
                throw new ArgumentNullException(nameof(virtualPath));
            }
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }
            Provider        = provider;
            _segedPathInfo  = provider.Enviroment.SegPath(virtualPath);
            this.PathString = this.BuildPathString(_segedPathInfo, Provider.Enviroment.SeparatorChar);
            int hashProvider = provider.GetHashCode();
            int hashPath     = 0;

            if (Provider.Enviroment.CaseSensetive)
            {
                hashPath = this.PathString.GetHashCode();
            }
            else
            {
                hashPath = this.PathString.ToUpper().GetHashCode();
            }
            _hashCode = hashProvider << 8 + hashPath;
            this.OnInitialize();
        }
Example #2
0
 public string MapPath(VxProviderInfo provider, string path)
 {
     return($"{provider}{SeparatorChar}{path}");
 }