/// <summary>Returns whether given symbol is already used for a device or node.</summary> /// <param name="symbol"></param> /// <returns></returns> private bool IsDefined(string symbol) { return(DefinedDevices.Contains(symbol) || NodeIndices.ContainsKey(symbol)); }
/// <summary>Adds given symbol to the set of device names, returns true if it not already used.</summary> /// <param name="name"></param> /// <returns></returns> public bool TryDefineDevice(string name) { return(!IsDefined(name) && DefinedDevices.Add(name)); }