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; }
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, Metadata metadata) { metadatas.Register(type, metadata); }
public static bool IsEmpty(Metadata metadata) { return typeof(Metadata).GetRuntimeProperties().All(info => info.GetValue(metadata) == null); }
protected bool Equals(Metadata other) { return Equals(PropertyDependencies, other.PropertyDependencies) && string.Equals(RuntimePropertyName, other.RuntimePropertyName); }