public List <CSharpQuery> GetValueOrNull(IndexerKey key) { if (codeStatments.ContainsKey(key)) { return(GetValue(key)); } return(null); }
public void Add(IndexerKey key, List <CSharpQuery> value) { if (codeStatments.ContainsKey(key)) { var codeStatmentsForKey = codeStatments[key]; codeStatmentsForKey.AddRange(value); codeStatments[key] = codeStatmentsForKey; } else { codeStatments.Add(key, value); } }
public void RemoveStatmentByValue(List <CSharpQuery> value) { IndexerKey key = new IndexerKey { StatmentName = MapNamespaceHelper.GetQueryWithoutNamespace(value.First().QueryId), VsProjectName = value.First().QueryFileName, StatmentFullyQualifiedName = value.First().QueryId, }; var codeStatmentsForKey = codeStatments[key]; codeStatmentsForKey.Remove(value.First()); codeStatments[key] = codeStatmentsForKey; }
internal DataItemIndexerDescriptor GetIndexer(object[] indexValues) { if ((indexValues == null) || (indexValues.Length <= 0) || (m_targetType == null)) { return(null); } var entry = this.GetEntry(); lock ( entry ) { var indexers = entry.Indexers; var descriptor = default(DataItemIndexerDescriptor); var key = new IndexerKey(indexValues); if ((indexers != null) && (indexers.TryGetValue(key, out descriptor))) { return(descriptor); } var indexer = this.CreateIndexerDescriptor(indexValues); if (indexer == null) { return(null); } var factory = new DataItemPropertyDescriptorFactory(this); descriptor = factory.CreateIndexerDescriptor(indexer); if (descriptor == null) { return(null); } if (indexers == null) { indexers = new Dictionary <IndexerKey, DataItemIndexerDescriptor>(); entry.Indexers = indexers; } indexers.Add(key, descriptor); return(descriptor); } }
private void AddSingleWithoutKey(CSharpQuery value) { IndexerKey key = new IndexerKey { StatmentName = MapNamespaceHelper.GetQueryWithoutNamespace(value.QueryId), VsProjectName = value.QueryVsProjectName, StatmentFullyQualifiedName = value.QueryId, }; if (codeStatments.ContainsKey(key)) { var codeStatmentsForKey = codeStatments[key]; codeStatmentsForKey.Add(value); codeStatments[key] = codeStatmentsForKey; } else { var codeStamentsForKey = new List <CSharpQuery> { value, }; codeStatments.Add(key, codeStamentsForKey); } }
public void RenameQuery(IndexerKey key, string newQueryId) { var statments = codeStatments[key]; foreach (var statment in statments) { statment.QueryId = newQueryId; } var newKey = new IndexerKey { StatmentName = MapNamespaceHelper.GetQueryWithoutNamespace(newQueryId), VsProjectName = key.VsProjectName, StatmentFullyQualifiedName = newQueryId, }; codeStatments.Remove(key); if (codeStatments.ContainsKey(newKey)) { codeStatments[newKey] = statments; } else { codeStatments.Add(newKey, statments); } }
public void Rename(IndexerKey key, string value) { GotoAsyncPackage.Storage.XmlQueries.RenameQuery(key, value); }
public Statement GetSingleStatmentFromKey(IndexerKey key) { return(GotoAsyncPackage.Storage.XmlQueries.GetValueOrNull(key)); }
public List <CSharpQuery> GetSingleStatmentFromKey(IndexerKey key) { return(GotoAsyncPackage.Storage.CodeQueries.GetValueOrNull(key)); }
public List <CSharpQuery> GetValue(IndexerKey key) { return(codeStatments[key]); }