public static void Initialize() { if (instance == null) { instance = new ArchiverMain(); } }
private static void ChannelUpdaterThreadProc(object obj) { ArchiverMain self = (ArchiverMain)obj; try { for (; ;) { foreach (Rule rule in self.channelSettings.Rules) { if (rule.Enable) { foreach (BaseCondition cond in rule.Conditions) { cond.Process(); } if (rule.Archive) { self.dbWriter.WriteChannels(rule.Channels); } } } Thread.Sleep(100); } } catch (ThreadAbortException) { } catch (System.Data.Common.DbException e) { self.dbWriter.Close(); self.Accessor.Close(); throw e; } if (self.dbWriter != null) { self.dbWriter.Close(); } }
private static void ChannelUpdaterThreadProc(object obj) { ArchiverMain self = (ArchiverMain)obj; try { for (; ;) { //System.Console.WriteLine("{0} ChannelUpdaterThreadProc: Start loop", System.DateTime.Now); foreach (Rule rule in self.channelSettings.Rules) { if (rule.Enable) { foreach (BaseCondition cond in rule.Conditions) { cond.Process(); } if (rule.Archive) { self.dbWriter.WriteChannels(rule.Channels); } } } Thread.Sleep(100); } } catch (ThreadAbortException) { } if (self.dbWriter != null) { self.dbWriter.Close(); } }
public static void Deinitialize() { instance = null; }
public ArchiverAccessor(ArchiverMain arch) { _archiver = arch; }