Esempio n. 1
0
        public UriResourceItem(Uri uri)
        {
            this.Uri      = uri;
            this.CleanUri = new Uri(UriUtil.RemoveQuery(uri));
            this.MimeType = MimeMapping.GetMimeMapping(Path.GetFileName(uri.AbsolutePath));
            this.Query    = uri.PathAndQuery;
            switch (Uri.Scheme.ToLower())
            {
            case "http":
                this.SchemeType = UriSchemeType.HTTP;
                break;

            case "https":
                this.SchemeType = UriSchemeType.HTTPS;
                break;

            case "ftp":
                this.SchemeType = UriSchemeType.FTP;
                break;

            case "telnet":
                this.SchemeType = UriSchemeType.TELNET;
                break;

            case "tel":
                this.SchemeType = UriSchemeType.TEL;
                break;

            case "mailto":
                this.SchemeType = UriSchemeType.MAILTO;
                break;

            default:
                this.SchemeType = UriSchemeType.Unknown;
                break;
            }
            this.ReferencedUris = new List <Uri>();
        }