Пример #1
0
 public TaskManager(mainForm frm, Settings stgs)
 {
     this.form = frm;
     this.settings = stgs;
     this.mainTimer.Interval = 1 * 60 * 1000; // 1 minute
     this.mainTimer.Tick += new EventHandler(mainTimer_Tick);
 }
Пример #2
0
        private bool readSettingsFromFile()
        {
            if (!File.Exists(configFile))
            {
                return false;
            }
            TextReader reader = new StreamReader(configFile);
            bool result = false;

            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(Settings));
                this.settings = (Settings)serializer.Deserialize(reader);
                result = true;
                this.addToLog("config readed");
            }
            catch (Exception e)
            {
                this.addToLog("error: " + e.Message);
            }
            finally
            {
                reader.Close();
            }

            return result;
        }