예제 #1
0
 public void StartAll()
 {
     foreach (KeyValuePair <long, KLogger> kvp in dictionary)
     {
         KLogger k = kvp.Value;
         if (k.enabled)
         {
             k.Start();
         }
     }
 }
예제 #2
0
        public KLogger[] ToArray()
        {
            KLogger[] loggers = new KLogger[Count];
            int       i       = 0;

            foreach (KeyValuePair <long, KLogger> kvp in dictionary)
            {
                loggers[i++] = kvp.Value;
            }
            return(loggers);
        }
예제 #3
0
        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);
        }
예제 #4
0
 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);
     }
 }