MongoDB.Bson.Serialization.Conventions.ConventionRegistry.Register C# (CSharp) Méthode

Register() public static méthode

Registers the conventions.
public static Register ( string name, IConventionPack conventions, bool>.Func filter ) : void
name string The name.
conventions IConventionPack The conventions.
filter bool>.Func The filter.
Résultat void
        public static void Register(string name, IConventionPack conventions, Func<Type, bool> filter)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (conventions == null)
            {
                throw new ArgumentNullException("conventions");
            }
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            lock (__lock)
            {
                var container = new ConventionPackContainer
                {
                    Filter = filter,
                    Name = name,
                    Pack = conventions
                };

                __conventionPacks.Add(container);
            }
        }