System.Net.PrefixLookup.Add C# (CSharp) Method

Add() private method

private Add ( string prefix, object value ) : void
prefix string
value object
return void
        internal void Add(string prefix, object value) {
            // Hashtable will overwrite existing key
            lock (m_Store) {
                // writers are locked
                m_Store[prefix] = value;
            }
        }

Usage Example

        /// <devdoc>
        ///    <para>
        ///       Binds an authentication response to a request for pre-authentication.
        ///    </para>
        /// </devdoc>
        // Create binding between an authorization response and the module
        // generating that response
        // This association is used for deciding which module to invoke
        // for preauthentication purposes
        public override void BindModule(Uri uri, Authorization response, IAuthenticationModule module)
        {
            GlobalLog.Assert(
                module.CanPreAuthenticate,
                "AuthenticationManager::BindModule()|module.CanPreAuthenticate == false");

            if (response.ProtectionRealm != null)
            {
                // The authentication module specified which Uri prefixes
                // will be preauthenticated
                string[] prefix = response.ProtectionRealm;

                for (int k = 0; k < prefix.Length; k++)
                {
                    //
                    // PrefixLookup is thread-safe
                    //
                    moduleBinding.Add(prefix[k], module.AuthenticationType);
                }
            }
            else
            {
                // Otherwise use the default policy for "fabricating"
                // some protection realm generalizing the particular Uri
                string prefix = generalize(uri);
                //
                // PrefixLookup is thread-safe
                //
                moduleBinding.Add(prefix, module.AuthenticationType);
            }
        }
All Usage Examples Of System.Net.PrefixLookup::Add
PrefixLookup