コード例 #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);
     }
 }