/// <summary> /// Adds an entry with the specified properties to the table, designating it as a HLT belonging /// to the specified HLT group. /// </summary> protected void AddEntry(string fourCC, string fullName, Type tagType, string group) { TypeTableEntry newEntry = new TypeTableEntry(fourCC, fullName, tagType, TagTypeDesignation.HighLevelTag); entries.Add(newEntry); if (!highLevelGroups.ContainsKey(group)) { highLevelGroups.Add(group, new List <TypeTableEntry>()); } highLevelGroups[group].Add(newEntry); }
/// <summary> /// Returns a boolean indicating if the specified type can be previewed. /// </summary> public bool Previewable(TypeTableEntry type) { Type[] interfaces = type.TagType.GetInterfaces(); foreach (Type t in interfaces) { if (t == typeof(IInstanceable)) { return(true); } } return(false); }
/// <summary> /// Updates a currently existing type to a new type. /// The new type must inherit from the existing type. /// </summary> public void UpdateType(Type newType) { for (int i = 0; i < entries.Count; i++) { if (newType.IsSubclassOf(entries[i].TagType)) { // Update to the new type. TypeTableEntry newEntry = new TypeTableEntry( entries[i].FourCC, entries[i].FullName, newType, entries[i].TypeDesignation); entries[i] = newEntry; return; } } }
/// <summary> /// Returns a boolean indicating if the tag type matching the specified name can be previewed. /// </summary> public bool Previewable(string type) { TypeTableEntry entry = LocateEntryByName(type); return(Previewable(entry)); }