public List <MetadataItem> GetList() { List <MetadataItem> result = new List <MetadataItem>(); foreach (PropertyItem prop in fSystemImage.PropertyItems) { MetadataDefinition defn = MetadataLibrary.Lookup(prop.Id); if (defn == null) { defn = new MetadataDefinition() { Id = prop.Id, Name = "?", Category = "Unknown Tags", Description = string.Empty, DataType = prop.Type != 0 ? (MetadataType)prop.Type : MetadataType.Undefined }; } object value = GetObject(prop); result.Add(new MetadataItem(defn, value)); } return(result); }
public static void ExportAllKnownMetadataDefinitions(string path) { Dictionary <string, object> result = new Dictionary <string, object>(); foreach (MetadataDefinition defn in MetadataLibrary.GetList()) { result.Add("0x" + defn.Id.ToString("X4"), defn); } File.WriteAllText(path, Json.Serialize(result)); }
public List <MetadataItem> GetAllDefinedMetadata() { List <MetadataItem> result = GetList(); foreach (MetadataDefinition defn in MetadataLibrary.GetList()) { MetadataItem item = result.FirstOrDefault(c => c.Definition.Id == defn.Id); if (item == null) { result.Add(new MetadataItem(defn)); } } return(result); }
public static void ExportMetadataDefinitionsToCsv(string path) { using (Stream stream = new FileStream(path, FileMode.Create, FileAccess.Write)) { using (StreamWriter writer = new StreamWriter(stream)) { foreach (MetadataDefinition defn in MetadataLibrary.GetList()) { string line = string.Format("{0:X4}, {0}, {1}, {2}, {3}, {4}", defn.Id, defn.Category, defn.Name, "type", defn.Description ); writer.WriteLine(line); } } } }
public void Remove(string propName) { int propId = MetadataLibrary.GetId(propName); Remove(propId); }
public void Set(string propName, object value) { int propId = MetadataLibrary.GetId(propName); Set(propId, value); }
public object Read(string propName) { int propId = MetadataLibrary.GetId(propName); return(Read(propId)); }
public bool Has(string propName) { int propId = MetadataLibrary.GetId(propName); return(Has(propId)); }