Пример #1
0
        public static string GetExecutionPath(IWebResource resource)
        {
            if (resource == null)
            {
                throw new ArgumentNullException(nameof(resource));
            }

            var path = GetMapper(resource.GetType())(resource);

            var queryString = HttpContext.Current.Request.QueryString;

            if (queryString.AllKeys.Any())
            {
                foreach (var key in queryString.AllKeys)
                {
                    if (path.Contains(key + "="))
                    {
                        continue;
                    }

                    if (!path.Contains("?"))
                    {
                        path += "?";
                    }
                    else if (!path.EndsWith("&"))
                    {
                        path += "&";
                    }
                    path += key + "=" + queryString[key];
                }
            }

            return(path);
        }
Пример #2
0
        public static bool AddWebResource(string prefix, IWebResource resource)
        {
            if (_resources.ContainsKey(prefix))
            {
                return(false);
            }

            _resources.Add(prefix, resource);

            return(true);
        }
 public WebKitResource(IWebResource resource)
 {
     this.Url = resource.url();
     this.MimeType = resource.mimeType();
     this.Encoding = resource.textEncodingName();
 }
Пример #4
0
 /// <summary>
 /// Determines if this web resource's Url matches a given path.
 /// </summary>
 public static bool Matches(this IWebResource resource, string path)
 {
     return(resource.GetUrl().Equals(path, StringComparison.OrdinalIgnoreCase));
 }
Пример #5
0
 public void AddResource(string path, IWebResource resource)
 {
     resources [path] = resource;
 }
Пример #6
0
 public void AddDirectory(string path, IWebResource resource)
 {
     directories[path] = resource;
 }
Пример #7
0
 public WebKitResource(IWebResource resource)
 {
     this.Url      = resource.url();
     this.MimeType = resource.mimeType();
     this.Encoding = resource.textEncodingName();
 }
 public void AddResource(string path, IWebResource resource)
 {
     Debug.Log($"AddResource: {path}");
     resources[path] = resource;
 }