System.Collections.Generic.Dictionary.ContainsKey(string)

Here are the examples of the csharp api class System.Collections.Generic.Dictionary.ContainsKey(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

Project: Borderless-Gaming
Source File: Language.cs
internal string Data(string key)
        {
            return LanguageData.ContainsKey(key) ? LanguageData[key] : null;
        }

2. Example

Project: TraceLab
Source File: TermDocumentMatrix.cs
public bool ContainsDocument(string artifactID)
        {
            return _docIndexLookup.ContainsKey(artifactID);
        }

3. Example

Project: TraceLab
Source File: TermDocumentMatrix.cs
public bool ContainsTerm(string term)
        {
            return _termIndexLookup.ContainsKey(term);
        }

4. Example

Project: TraceLab
Source File: PackageManager.cs
public bool Contains(IPackageReference package)
        {
            if (package == null)
                throw new ArgumentNullException("package");

            return m_packages.ContainsKey(package.ID);
        }

5. Example

Project: TraceLab
Source File: PackageManager.cs
public IPackage GetPackage(IPackageReference package)
        {
            if (package == null)
                throw new ArgumentNullException("package");

            if (m_packages.ContainsKey(package.ID))
            {
                return m_packages[package.ID];
            }

            return null;
        }

6. Example

Project: TraceLab
Source File: Workspace.cs
public DateTime GetDateTimeStamp(string unitname)
        {
            if (m_objectDisposed)
            {
                throw new ObjectDisposedException("m_workspace");
            }
            if (unitname == null)
            {
                throw new ArgumentNullException("unitname", "FriendlyUnitName cannot be null");
            }
            if (unitname.Length == 0)
            {
                throw new ArgumentException("FriendlyUnitName cannot be empty!", "unitname");
            }

            if (!m_dataUnits.ContainsKey(unitname))
            {
                throw new ArgumentException("Workspace does not contain given unitname", "unitname");
            }

            return m_dataUnits[unitname].Timestamp;
        }

7. Example

Project: TraceLab
Source File: ComponentsLibraryNode.cs
public virtual ComponentsLibraryNode GetChild(string label)
        {
            if (!children.ContainsKey(label))
                return null;
            return children[label];
        }

8. Example

Project: TraceLab
Source File: Node.cs
public virtual Node GetChild(string label)
        {
            if (!children.ContainsKey(label))
                return null;
            return children[label];
        }

9. Example

Project: TraceLab
Source File: TLDictionaryIndex.cs
public bool ContainsTermEntry(string term)
        {
            if (term == null)
                throw new ArgumentException("The term cannot be null");

            return Terms.ContainsKey(term);
        }

10. Example

Project: TraceLab
Source File: TLDictionaryIndex.cs
public bool ContainsArtifactVectorWeight(string artifactId)
        {
            if (artifactId == null || artifactId == "")
                throw new ArgumentException("The artifactId cannot be empty or null");

            return VectorLengthsOfArtifacts.ContainsKey(artifactId);
        }

11. Example

Project: TraceLab
Source File: TLTermEntry.cs
public bool ContainsPosting(string artifactId)
        {
            if (artifactId == null || artifactId == "")
                throw new ArgumentException("The documentId cannot be empty or null");

            return PostingsLookup.ContainsKey(artifactId);
        }

12. Example

Project: Command-R
Source File: AppContext.cs
public virtual T Get<T>(string key, T def = default(T))
        {
            return ContainsKey(key) ? (T)base[key] : def;
        }

13. Example

Project: 09-ZombieRunner
Source File: VirtualInput.cs
public bool AxisExists(string name)
        {
            return m_VirtualAxes.ContainsKey(name);
        }

14. Example

Project: 09-ZombieRunner
Source File: VirtualInput.cs
public bool ButtonExists(string name)
        {
            return m_VirtualButtons.ContainsKey(name);
        }

15. Example

Project: 09-ZombieRunner
Source File: VirtualInput.cs
public CrossPlatformInputManager.VirtualAxis VirtualAxisReference(string name)
        {
            return m_VirtualAxes.ContainsKey(name) ? m_VirtualAxes[name] : null;
        }

16. Example

Project: 10-TwinStick
Source File: VirtualInput.cs
public bool AxisExists(string name)
        {
            return m_VirtualAxes.ContainsKey(name);
        }

17. Example

Project: 10-TwinStick
Source File: VirtualInput.cs
public bool ButtonExists(string name)
        {
            return m_VirtualButtons.ContainsKey(name);
        }

18. Example

Project: 10-TwinStick
Source File: VirtualInput.cs
public CrossPlatformInputManager.VirtualAxis VirtualAxisReference(string name)
        {
            return m_VirtualAxes.ContainsKey(name) ? m_VirtualAxes[name] : null;
        }

19. Example

Project: SmoONE
Source File: frmWork.cs
private void MenuItem(string id)
        {
            if (MenuGroupDict.ContainsKey(id) == true)
  /n ..... /n //View Source file for more details /n }

20. Example

Project: SmoONE
Source File: WebHeaderCollection.cs
internal static bool IsMultiValue (string headerName)
		{
			if (headerName == null || headerName == "")
				return false;

			return multiValue.ContainsKey (headerName);
		}

21. Example

Project: TFSEvolution
Source File: ObservableDictionary.cs
public bool ContainsKey(string key)
        {
            return _dictionary.ContainsKey(key);
        }

22. Example

Project: TFSEvolution
Source File: SuspensionManager.cs
public static Dictionary<String, Object> SessionStateForFrame(Frame frame)
        {
            var frameState = (Dictionary<String, Object>) frame.GetValue(FrameSessionStateProperty);

            if (frameState == null)
            {
                var frameSessionKey = (String) frame.GetValue(FrameSessionStateKeyProperty);
                if (frameSessionKey != null)
                {
                    // Registered frames reflect the corresponding session state
                    if (!_sessionState.ContainsKey(frameSessionKey))
                    {
                        _sessionState[frameSessionKey] = new Dictionary<String, Object>();
                    }
                    frameState = (Dictionary<String, Object>) _sessionState[frameSessionKey];
                }
                else
                {
                    // Frames that aren't registered have transient state
                    frameState = new Dictionary<String, Object>();
                }
                frame.SetValue(FrameSessionStateProperty, frameState);
            }
            return frameState;
        }

23. Example

Project: ContinuousTests
Source File: GraphGeneratorFactory.cs
public static IGraphVisualization GetVisualizerFor(string provider)
        {
            if (hash.ContainsKey(provider)) return hash[provider];
            return hash["default"];
        }

24. Example

Project: ContinuousTests
Source File: SequenceDiagramGeneratorFactory.cs
public static ISequenceDiagramVisualization GetVisualizerFor(string provider)
        {
            if (hash.ContainsKey(provider)) return hash[provider];
            return hash["default"];
        }

25. Example

Project: ContinuousTests
Source File: AffectedGraph.cs
public bool ContainsNode(string key)
        {
            return _nodes.ContainsKey(key);
        }

26. Example

Project: ContinuousTests
Source File: AffectedGraph.cs
public bool ContainsNode(string key)
        {
            return _nodes.ContainsKey(key);
        }

27. Example

Project: ContinuousTests
Source File: CouplingCache.cs
public bool AssemblyHasTests(string name)
        {
            return _testAssemblies.ContainsKey(name);
        }

28. Example

Project: ContinuousTests
Source File: GenericContext.cs
public bool CanTransitionTo(Dictionary<string,GenericEntry> context2)
        {
            foreach(var param in context2)
            {
                if (param.Value.IsGeneric) continue;
                if(_limitations.ContainsKey(param.Key))
                {
                    var entry = _limitations[param.Key];
                    if (entry.IsGeneric) continue;
                    if(!param.Value.Type.IsBaseTypeOf(entry.Type))
                    {
                        return false;
                    }
                }
            }
            return true;
        }

29. Example

Project: Colore
Source File: LogManager.cs
internal static ILog GetLogger(string name, LogLevel level = LogLevel.Debug)
        {
            if (Cache.ContainsKey(name))
                return Cache[name];

            var logger = new TraceLogger(name, level);

            Cache[name] = logger;

            return logger;
        }

30. Example

Project: QuickUnity
Source File: GameScore.cs
public static int GetKills(string type)
    {
        if (Instance == null || !Instance.m_Kills.ContainsKey(type))
        {
            return 0;
        }

        return Instance.m_Kills[type];
    }

31. Example

Project: QuickUnity
Source File: GameScore.cs
public static void RegisterDeath(GameObject deadObject)
    {
        if (Instance == null)
        {
            Debug.Log("Game score not loaded");
            return;
        }

        int
            playerLayer = LayerMask.NameToLayer(Instance.playerLayerName),
            enemyLayer = LayerMask.NameToLayer(Instance.enemyLayerName);

        if (deadObject.layer == playerLayer)
        {
            Instance.m_Deaths++;
        }
        else if (deadObject.layer == enemyLayer)
        {
            Instance.m_Kills[deadObject.name] = Instance.m_Kills.ContainsKey(deadObject.name) ? Instance.m_Kills[deadObject.name] + 1 : 1;
        }
    }

32. Example

Project: XSharp
Source File: ObjectList.cs
protected override bool Check(string aText) {
            return mList.ContainsKey(aText);
        }

33. Example

Project: XSharp
Source File: Registers.cs
public static RegistersEnum? GetRegister(string aName)
        {
            if (mNameToReg.ContainsKey(aName))
            {
                return mNameToReg[aName];
            }else
            {
                return null;
            }
        }

34. Example

Project: countly-sdk-windows
Source File: PhoneNameHelper.cs
private static CanonicalPhoneName ResolveHuawei(string manufacturer, string model)
        {
            var modelNormalized = model.Trim().ToUpper();

            var result = new CanonicalPhoneName()
            {
                ReportedManufacturer = manufacturer,
                ReportedModel = model,
                CanonicalManufacturer = "HUAWEI",
                CanonicalModel = model,
                IsResolved = false
            };


            var lookupValue = modelNormalized;

            if (lookupValue.StartsWith("HUAWEI H883G"))
            {
                lookupValue = "HUAWEI H883G";
            }

            if (lookupValue.StartsWith("HUAWEI W1"))
            {
                lookupValue = "HUAWEI W1";
            }

            if (modelNormalized.StartsWith("HUAWEI W2"))
            {
                lookupValue = "HUAWEI W2";
            }

            if (huaweiLookupTable.ContainsKey(lookupValue))
            {
                var modelMetadata = huaweiLookupTable[lookupValue];
                result.CanonicalModel = modelMetadata.CanonicalModel;
                result.Comments = modelMetadata.Comments;
                result.IsResolved = true;
            }

            return result;
        }

35. Example

Project: countly-sdk-windows
Source File: PhoneNameHelper.cs
private static CanonicalPhoneName ResolveLg(string manufacturer, string model)
        {
            var modelNormalized = model.Trim().ToUpper();

            var result = new CanonicalPhoneName()
            {
                ReportedManufacturer = manufacturer,
                ReportedModel = model,
                CanonicalManufacturer = "LG",
                CanonicalModel = model,
                IsResolved = false
            };


            var lookupValue = modelNormalized;

            if (lookupValue.StartsWith("LG-C900"))
            {
                lookupValue = "LG-C900";
            }

            if (lookupValue.StartsWith("LG-E900"))
            {
                lookupValue = "LG-E900";
            }

            if (lgLookupTable.ContainsKey(lookupValue))
            {
                var modelMetadata = lgLookupTable[lookupValue];
                result.CanonicalModel = modelMetadata.CanonicalModel;
                result.Comments = modelMetadata.Comments;
                result.IsResolved = true;
            }

            return result;
        }

36. Example

Project: countly-sdk-windows
Source File: PhoneNameHelper.cs
private static CanonicalPhoneName ResolveSamsung(string manufacturer, string model)
        {
            var modelNormalized = model.Trim().ToUpper();

            var result = new CanonicalPhoneName()
            {
                ReportedManufacturer = manufacturer,
                ReportedModel = model,
                CanonicalManufacturer = "SAMSUNG",
                CanonicalModel = model,
                IsResolved = false
            };


            var lookupValue = modelNormalized;

            if (lookupValue.StartsWith("GT-S7530"))
            {
                lookupValue = "GT-S7530";
            }

            if (lookupValue.StartsWith("SGH-I917"))
            {
                lookupValue = "SGH-I917";
            }

            if (samsungLookupTable.ContainsKey(lookupValue))
            {
                var modelMetadata = samsungLookupTable[lookupValue];
                result.CanonicalModel = modelMetadata.CanonicalModel;
                result.Comments = modelMetadata.Comments;
                result.IsResolved = true;
            }

            return result;
        }

37. Example

Project: countly-sdk-windows
Source File: PhoneNameHelper.cs
private static CanonicalPhoneName ResolveHtc(string manufacturer, string model)
        {
            var modelNormalized = model.Trim().ToUpper();

            var result = new CanonicalPhoneName()
            {
                ReportedManufacturer = manufacturer,
                ReportedModel = model,
                CanonicalManufacturer = "HTC",
                CanonicalModel = model,
                IsResolved = false
            };


            var lookupValue = modelNormalized;

            if (lookupValue.StartsWith("A620"))
            {
                lookupValue = "A620";
            }

            if (lookupValue.StartsWith("C625"))
            {
                lookupValue = "C625";
            }

            if (lookupValue.StartsWith("C620"))
            {
                lookupValue = "C620";
            }

            if (htcLookupTable.ContainsKey(lookupValue))
            {
                var modelMetadata = htcLookupTable[lookupValue];
                result.CanonicalModel = modelMetadata.CanonicalModel;
                result.Comments = modelMetadata.Comments;
                result.IsResolved = true;
            }

            return result;
        }

38. Example

Project: xRM-Portals-Community-Edition
Source File: ProductAccessProvider.cs
private ProductAccessProvider.RelationshipMetadata BuildRelationshipMetadata(OrganizationServiceCont/n ..... /n //View Source file for more details /n }

39. Example

Project: MonoGame.Extended
Source File: TextureAtlas.cs
public bool ContainsRegion(string name)
        {
            return _regionMap.ContainsKey(name);
        }

40. Example

Project: MonoGame.Extended
Source File: GuiControlStyle.cs
public bool ContainsKey(string key) => _setters.ContainsKey(key);

41. Example

Project: GameCloud.Orleans
Source File: AsyncAssetLoaderMgr.cs
public void _destroyAsyncAssetLoader(string asset_path)
    {
        if (mMapIAsyncAssetLoader.ContainsKey(asset_path))
        {
            mMapNeedRemoveAssetLoader[asset_path] = mMapIAsyncAssetLoader[asset_path];
        }
    }

42. Example

Project: GameCloud.Orleans
Source File: Blackboard.cs
public bool hasData(string key)
        {
            return mMapData.ContainsKey(key);
        }

43. Example

Project: GameCloud.Orleans
Source File: ComponentDef.cs
public bool hasPropDef(string prop_name)
        {
            return mMapPropDef.ContainsKey(prop_name);
        }

44. Example

Project: GameCloud.Orleans
Source File: ComponentDef.cs
public bool hasProp(string prop_name)
        {
            return mMapProp.ContainsKey(prop_name);
        }

45. Example

Project: GameCloud.Orleans
Source File: ComponentDef.cs
public void applyMapPropDirty(Dictionary<string, string> map_prop_dirty)
        {
            if (map_prop_dirty == null) return;

            foreach (var j in map_prop_dirty)
            {
                if (!mMapProp.ContainsKey(j.Key)) continue;
                IProp prop = mMapProp[j.Key];
                prop.fromJsonString(j.Value);
            }
        }

46. Example

Project: GameCloud.Orleans
Source File: Entity.cs
public T getUserData<T>()
        {
            string key = typeof(T).Name;
            if (mMapCacheData == null || !mMapCacheData.ContainsKey(key)) return default(T);
            else return (T)mMapCacheData[key];
        }

47. Example

Project: GameCloud.Orleans
Source File: Entity.cs
public object getCacheData(string key)
        {
            if (mMapCacheData == null || !mMapCacheData.ContainsKey(key)) return null;
            else return mMapCacheData[key];
        }

48. Example

Project: GameCloud.Orleans
Source File: Entity.cs
public bool hasCacheData(string key)
        {
            return mMapCacheData.ContainsKey(key);
        }

49. Example

Project: GameCloud.Orleans
Source File: Entity.cs
internal void _addChild(Entity child)
        {
            if (mMapChild == null)
            {
                mMapChild = new Dictionary<string, Dictionary<string, Entity>>();
            }

            string et_type = child.Type;
            string et_guid = child.Guid;
            if (mMapChild.ContainsKey(et_type))
            {
                Dictionary<string, Entity> map_child = mMapChild[et_type];
                map_child[et_guid] = child;
            }
            else
            {
                Dictionary<string, Entity> map_child = new Dictionary<string, Entity>();
                map_child[et_guid] = child;
                mMapChild[et_type] = map_child;
            }
        }

50. Example

Project: GameCloud.Orleans
Source File: EntityEvent.cs
internal void _publish(object sender, EntityEvent e)
        {
            var map_entity = new Dictionary<string, Entity>(mMapEntity);
            foreach (var i in map_entity)
            {
                if (mMapEntity.ContainsKey(i.Key)) i.Value._handleEvent(sender, e);
            }

            e.Publisher = null;
        }