public void Copy(X509RecipientCertificateClientElement from)
        {
            if (this.IsReadOnly())
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigReadOnly)));
            }
            if (null == from)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("from");
            }

            this.DefaultCertificate.Copy(from.DefaultCertificate);

            X509ScopedServiceCertificateElementCollection srcScopedCertificates = from.ScopedCertificates;
            X509ScopedServiceCertificateElementCollection dstScopedCertificates = this.ScopedCertificates;

            dstScopedCertificates.Clear();
            for (int i = 0; i < srcScopedCertificates.Count; ++i)
            {
                dstScopedCertificates.Add(srcScopedCertificates[i]);
            }

            this.Authentication.Copy(from.Authentication);
            this.SslCertificateAuthentication.Copy(from.SslCertificateAuthentication);
        }
Exemple #2
0
        public void Copy(X509RecipientCertificateClientElement from)
        {
            if (this.IsReadOnly())
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(System.ServiceModel.SR.GetString("ConfigReadOnly")));
            }
            if (from == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("from");
            }
            this.DefaultCertificate.Copy(from.DefaultCertificate);
            X509ScopedServiceCertificateElementCollection scopedCertificates = from.ScopedCertificates;
            X509ScopedServiceCertificateElementCollection elements2          = this.ScopedCertificates;

            elements2.Clear();
            for (int i = 0; i < scopedCertificates.Count; i++)
            {
                elements2.Add(scopedCertificates[i]);
            }
            this.Authentication.Copy(from.Authentication);
        }