Exemplo n.º 1
0
        public Metadata Get(Type type)
        {
            var metadata = new Metadata();
            foreach (var prop in MedataProperties)
            {
                AutoKeyDictionary<Type, object> dic;
                var hadDictionary  = lookupDictionaries.TryGetValue(prop.Name, out dic);
                if (hadDictionary)
                {
                    object value;
                    var hadValue = dic.TryGetValue(type, out value);
                    if (hadValue)
                    {
                        prop.SetValue(metadata, value);
                    }
                    else
                    {
                        prop.SetValue(metadata, null);
                    }
                }
                else
                {
                    prop.SetValue(metadata, null);
                }
            }

            return metadata;
        }
Exemplo n.º 2
0
 public void Register(Type type, Metadata medataData)
 {
     foreach (var propertyInfo in medataData.GetType().GetRuntimeProperties())
     {
         var dic = GetDictionary(propertyInfo.Name);
         var value = propertyInfo.GetValue(medataData);
         if (value != null)
         {
             dic.Add(type, value);
         }
     }
 }
 public void RegisterMetadata(Type type, OmniMetadata metadata)
 {
     _metadata.Add(type, metadata);
 }
 public void RegisterMetadata(Type type, OmniMetadata metadata)
 {
     _metadata.Add(type, metadata);
 }
Exemplo n.º 5
0
 public void RegisterMetadata(Type type, Metadata metadata)
 {
     metadatas.Register(type, metadata);
 }
Exemplo n.º 6
0
 public static bool IsEmpty(Metadata metadata)
 {
     return typeof(Metadata).GetRuntimeProperties().All(info => info.GetValue(metadata) == null);
 }
Exemplo n.º 7
0
 protected bool Equals(Metadata other)
 {
     return Equals(PropertyDependencies, other.PropertyDependencies) && string.Equals(RuntimePropertyName, other.RuntimePropertyName);
 }