public static T Annotation <T>(this object target, Expression <Funclet> expression, object key)
        {
            ClassAnnotation  classAnnotation  = GetOrCreateAnnotation(target);
            MemberAnnotation memberAnnotation = classAnnotation.ForMember(expression);

            return((T)memberAnnotation[key]);
        }
        public static ClassAnnotation Annotate <T>(this object target, params Func <string, T>[] args)
        {
            ClassAnnotation annotation = GetOrCreateAnnotation(target);

            annotation.Annotate(args);
            return(annotation);
        }
        public static bool HasAnnotation(this object target, string name)
        {
            ClassAnnotation annotation = GetAnnotation(target);

            if (annotation == null)
            {
                return(false);
            }
            return(annotation.HasKey(name));
        }
        private static ClassAnnotation GetOrCreateAnnotation(object key)
        {
            _annotations.RemoveCollectedEntries();

            ClassAnnotation annotation;

            if (!_annotations.TryGetValue(key, out annotation))
            {
                lock (_annotations)
                {
                    if (!_annotations.TryGetValue(key, out annotation))
                    {
                        annotation = new ClassAnnotation(key);
                        _annotations.Add(key, annotation);
                    }
                }
            }

            return(annotation);
        }
        public static MemberAnnotation Annotate <T>(this object target, Expression <Proc> expression, params Func <string, T>[] args)
        {
            ClassAnnotation annotation = GetOrCreateAnnotation(target);

            return(annotation.Annotate(expression, args));
        }
        public static void Annotate <T>(this object target, object key, T value)
        {
            ClassAnnotation annotation = GetOrCreateAnnotation(target);

            annotation[key] = value;
        }
        public static void ClearAnnotations(this object target)
        {
            ClassAnnotation annotation = GetOrCreateAnnotation(target);

            annotation.Clear();
        }
        public static void ClearAnnotation(this object target, object key)
        {
            ClassAnnotation annotation = GetOrCreateAnnotation(target);

            annotation.Remove(key);
        }
        public static T Annotation <T>(this object target, object key)
        {
            ClassAnnotation annotation = GetOrCreateAnnotation(target);

            return((T)annotation[key]);
        }
 public MemberAnnotation(MemberInfo member, ClassAnnotation classAnnotation)
 {
     _member          = member;
     _classAnnotation = classAnnotation;
 }