public virtual T FindQualifiedItem <T>([NotNull] string qualifiedName) where T : class, IProjectItem { if (!qualifiedName.IsGuidOrSoftGuid()) { return(QualifiedNameIndex.FirstOrDefault <T>(qualifiedName)); } if (!Guid.TryParse(qualifiedName, out Guid guid)) { guid = StringHelper.ToGuid(qualifiedName); } return(GuidIndex.FirstOrDefault <T>(guid.Format())); }
public virtual void Remove([NotNull] IProjectItem projectItem) { lock (this) { GuidIndex.Remove(projectItem); UriIndex.Remove(projectItem); QualifiedNameIndex.Remove(projectItem); ShortNameIndex.Remove(projectItem); foreach (var snapshot in projectItem.GetSnapshots()) { SourceFileIndex.Remove(snapshot.SourceFile.GetDirectoryAndFileNameWithoutExtensions()); } var databaseProjectItem = projectItem as DatabaseProjectItem; if (databaseProjectItem != null) { GuidDatabaseIndex.Remove(databaseProjectItem); QualifiedNameDatabaseIndex.Remove(databaseProjectItem); ShortNameDatabaseIndex.Remove(databaseProjectItem); } var item = projectItem as Item; if (item != null && !item.IsImport) { Items.Remove(item); } if (item != null) { ChildrenIndex.Remove(item); } var template = projectItem as Template; if (template != null && !template.IsImport) { Templates.Remove(template); } } }
public virtual void Add([NotNull] IProjectItem projectItem) { lock (this) { GuidIndex.Add(projectItem); UriIndex.Add(projectItem); QualifiedNameIndex.Add(projectItem); ShortNameIndex.Add(projectItem); foreach (var snapshot in projectItem.GetSnapshots()) { SourceFileIndex.Add(snapshot.SourceFile.GetDirectoryAndFileNameWithoutExtensions(), projectItem); } if (projectItem is DatabaseProjectItem databaseProjectItem) { GuidDatabaseIndex.Add(databaseProjectItem); QualifiedNameDatabaseIndex.Add(databaseProjectItem); ShortNameDatabaseIndex.Add(databaseProjectItem); } if (projectItem is Item item) { ChildrenIndex.Add(item); if (!item.IsImport) { Items.Add(item); } } if (projectItem is Template template && !template.IsImport) { Templates.Add(template); } } }
public UnityClassItem(GuidIndex id, string unityClass, OptionsSettingsSmartContext optionsSettingsSmartContext) { throw new NotImplementedException(); }