示例#1
0
        protected override object GetElementKey(ConfigurationElement element)
        {
            TokenProviderElement tokenProviderElement = (TokenProviderElement)element;

            if (tokenProviderElement == null || string.IsNullOrEmpty(tokenProviderElement.Name))
            {
                throw new ConfigurationErrorsException(SRCore.NullOrEmptyConfigurationAttribute("name", "tokenProvider"));
            }
            return(tokenProviderElement.Name);
        }
        public override void CopyFrom(ServiceModelExtensionElement from)
        {
            TokenProviderElement tokenProviderElement = (TokenProviderElement)from;

            base.CopyFrom(from);
            this.SharedSecret.CopyFrom(tokenProviderElement.SharedSecret);
            this.WindowsAuthentication.CopyFrom(tokenProviderElement.WindowsAuthentication);
            this.SharedAccessSignature.CopyFrom(tokenProviderElement.SharedAccessSignature);
            this.Name = tokenProviderElement.Name;
        }