public void StartAll() { foreach (KeyValuePair <long, KLogger> kvp in dictionary) { KLogger k = kvp.Value; if (k.enabled) { k.Start(); } } }
public KLogger[] ToArray() { KLogger[] loggers = new KLogger[Count]; int i = 0; foreach (KeyValuePair <long, KLogger> kvp in dictionary) { loggers[i++] = kvp.Value; } return(loggers); }
public static KLogger Deserialize(string fileName) { KLogger obj = new KLogger(); XmlSerializer xs = new XmlSerializer(typeof(KLogger)); FileStream fs = new FileStream(fileName, FileMode.Open); XmlReader xr = new XmlTextReader(fs); obj = (KLogger)xs.Deserialize(xr); xr.Close(); fs.Close(); return(obj); }
public void LoadLoggersFromConfigFiles(string path) { if (!Directory.Exists(path)) { return; } string[] files = Directory.GetFiles(path, @"*.config"); foreach (string file in files) { KLogger k = KLogger.Deserialize(file); dictionary.Add(k.stationID, k); } }