Exemple #1
0
        public static FileLink CreateLink(string url, string userName, string password)
        {
            FileLink link = null;

            if (url.StartsWith("file://"))
            {
                link = new DiskFileLink(url);
            }
            else if (url.StartsWith("http://"))
            {
                link = new HttpFileLink(url);
            }
            else if (url.StartsWith("https://"))
            {
                link = new HttpFileLink(url);
            }
            else if (url.StartsWith("ftp://"))
            {
                link = new FtpFileLink(url, userName, password);
            }
            else
            {
                link = new DiskFileLink(url);
            }

            return(link);
        }
Exemple #2
0
        public override bool Equals(object obj)
        {
            FileLink link = obj as FileLink;

            if (obj == null)
            {
                return(false);
            }

            return(url.Equals(link.url));
        }