Exemplo n.º 1
0
        public bool HasSameEndPoint(CredentialSettings that)
        {
            // argument checks
            if (that == null)
            {
                return(false);
            }

            return(AreSameEndPoints(this.EndPoint, that.EndPoint));
        }
Exemplo n.º 2
0
        public CredentialSettings(CredentialSettings src) : base(src)
        {
            // argument checks
            if (src == null)
            {
                throw new ArgumentNullException(nameof(src));
            }

            // clone members
            this.EndPoint             = src.EndPoint;
            this.UserName             = src.UserName;
            this.Password             = src.Password;
            this.Persistence          = src.Persistence;
            this.EnableAssumptionMode = src.EnableAssumptionMode;

            return;
        }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            // argument checks
            CredentialSettings that = obj as CredentialSettings;

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

            return(
                this.EnableAssumptionMode == that.EnableAssumptionMode &&
                this.Persistence == that.Persistence &&
                AreSameEndPoints(this.EndPoint, that.EndPoint) &&
                AreSameUserNames(this.UserName, that.UserName) &&
                AreSamePasswords(this.Password, that.Password)
                );
        }
Exemplo n.º 4
0
        public void AddCredential(CredentialSettings credential)
        {
            // argument checks
            if (credential == null)
            {
                throw new ArgumentNullException(nameof(credential));
            }

            IEnumerable <CredentialSettings> credentials = this.credentials;

            if (credentials == null)
            {
                this.credentials = new CredentialSettings[] { credential };
            }
            else
            {
                List <CredentialSettings> list = new List <CredentialSettings>(credentials);
                list.Add(credential);
                this.credentials = list;
            }

            return;
        }