/// <summary> /// Removes the given key from the SavedSensor Dictionary. /// </summary> /// <param name="address">Address.</param> public static void removeFromSavedSensorDictionary(string address) { if (SavedSensorDictionary.ContainsKey(address)) { Dictionary <string, string> tempDiction = new Dictionary <string, string>(SavedSensorDictionary); tempDiction.Remove(address); savedSensorDictionary = new Dictionary <string, string>(tempDiction); } }
/// <summary> /// Gets the name of the device based on what'sremov been saved. /// Can be used to get the device name when the device is not available /// </summary> /// <returns>The device name.</returns> /// <param name="address">Address.</param> public static string getDeviceName(string address) { if (SavedSensorDictionary.ContainsKey(address)) { return(SavedSensorDictionary[address]); } else { return(null); } }
/// <summary> /// Adds the value to the SavedSensor Dictionary. If the key already exists then value is updated /// </summary> /// <param name="address">Address.</param> /// <param name="name">Name.</param> public static void addToSavedSensorDictionary(string address, string name) { Dictionary <string, string> tempDiction = SavedSensorDictionary; if (!SavedSensorDictionary.ContainsKey(address)) { tempDiction.Add(address, name); } else { tempDiction[address] = name; } savedSensorDictionary = tempDiction; }