DotAmf.ServiceModel.Dispatcher.AmfEndpointContext.AddContract C# (CSharp) Method

AddContract() private method

Register data contract.
Invalid data contract. Type already registered.
private AddContract ( Type type ) : void
type System.Type Type to register.
return void
        private void AddContract(Type type)
        {
            if (type == null) throw new ArgumentNullException("type");

            if (IsContractRegistered(type))
                throw new InvalidOperationException("Type already registered.");

            if (!IsValidDataContract(type))
                throw new InvalidDataContractException(string.Format("Type '{0}' is not a valid data contract.", type.FullName));

            _contracts.Add(type);

            if (type.IsClass)
            {
                var memberTypes = ProcessClass(type);

                foreach (var subtype in memberTypes)
                {
                    if (IsContractRegistered(subtype) || !IsValidDataContract(subtype)) continue;
                    AddContract(subtype);
                }
            }
        }