Esempio n. 1
0
 public void StoreValues(Data data, string path)
 {
     data.SetValue(@"" + path + @"AccountId", Data.EscapeString(AccountId));
     data.SetValue(@"" + path + @"AuthenticationType", AuthenticationType.ToString());
     data.SetValue(@"" + path + @"FtpConnectionType", FtpConnectionType.ToString());
     data.SetValue(@"" + path + @"KeyFileRequiresPass", KeyFileRequiresPass.ToString());
     data.SetValue(@"" + path + @"Password", _password);
     data.SetValue(@"" + path + @"PrivateKeyFile", Data.EscapeString(PrivateKeyFile));
     data.SetValue(@"" + path + @"Server", Data.EscapeString(Server));
     data.SetValue(@"" + path + @"UserName", Data.EscapeString(UserName));
 }
Esempio n. 2
0
        public string FormatFtpConnectionName(string serverName, FtpConnectionType ftpConnectionType)
        {
            switch (ftpConnectionType)
            {
            case FtpConnectionType.Ftp:
                return(string.Format(FtpConnection, serverName));

            case FtpConnectionType.Sftp:
                return(string.Format(SftpConnection, serverName));

            default: throw new Exception($"The FTP connection type {ftpConnectionType} is unknown here");
            }
        }
Esempio n. 3
0
        public override bool Equals(object o)
        {
            if (!(o is FtpAccount))
            {
                return(false);
            }
            FtpAccount v = o as FtpAccount;

            if (!AccountId.Equals(v.AccountId))
            {
                return(false);
            }
            if (!AuthenticationType.Equals(v.AuthenticationType))
            {
                return(false);
            }
            if (!FtpConnectionType.Equals(v.FtpConnectionType))
            {
                return(false);
            }
            if (!KeyFileRequiresPass.Equals(v.KeyFileRequiresPass))
            {
                return(false);
            }
            if (!Password.Equals(v.Password))
            {
                return(false);
            }
            if (!PrivateKeyFile.Equals(v.PrivateKeyFile))
            {
                return(false);
            }
            if (!Server.Equals(v.Server))
            {
                return(false);
            }
            if (!UserName.Equals(v.UserName))
            {
                return(false);
            }
            return(true);
        }