Beispiel #1
0
        protected override void OnCompleteType(
            ITypeInitializationContext context)
        {
            base.OnCompleteType(context);

            if (context.Type == null)
            {
                throw new InvalidOperationException(
                          "It is not allowed to initialize a field without " +
                          "a type context.");
            }

            DeclaringType = context.Type;
            Type          = context.ResolveFieldType <T>(this, TypeReference);
        }