bool m_InterProcess_RegisterRequestedEvent(object sender, ApplicationInstanceEventArgs e) { Cache c = new Cache(false); if (c.Exists("locked") && c.Get <bool>("locked")) { return(false); } if (!c.Exists("instances")) { c.Set <ApplicationInstanceList>("instances", new ApplicationInstanceList()); } ApplicationInstanceList list = c.Get <ApplicationInstanceList>("instances"); if (list.Count(v => v.FilesystemPath == e.LocalPath) > 0) { return(false); } list.Add(new ApplicationInstance { LastCheckTime = new DateTime(1970, 1, 1), FilesystemPath = e.LocalPath, UpdateUrl = e.UpdateURI.ToString() }); c.Set <ApplicationInstanceList>("instances", list); return(true); }
bool m_InterProcess_RegisterRequestedEvent(object sender, ApplicationInstanceEventArgs e) { Cache c = new Cache(false); if (c.Exists("locked") && c.Get<bool>("locked")) return false; if (!c.Exists("instances")) c.Set<ApplicationInstanceList>("instances", new ApplicationInstanceList()); ApplicationInstanceList list = c.Get<ApplicationInstanceList>("instances"); if (list.Count(v => v.FilesystemPath == e.LocalPath) > 0) return false; list.Add(new ApplicationInstance { LastCheckTime = new DateTime(1970, 1, 1), FilesystemPath = e.LocalPath, UpdateUrl = e.UpdateURI.ToString() }); c.Set<ApplicationInstanceList>("instances", list); return true; }
bool m_InterProcess_ScheduledUpdateRequestedEvent(object sender, ApplicationInstanceEventArgs e) { if (e.Time > 0) { Timer t = new Timer(e.Time * 1000); // Schedule an update in a certain number of seconds. t.Elapsed += new ElapsedEventHandler((a, b) => { this.m_DualLog.WriteEntry("Requested scheduled update check has started."); this.PerformUpdateSingle(e.LocalPath, e.RestartPath); }); t.AutoReset = false; t.Start(); return(true); } else { this.m_DualLog.WriteEntry("Requested scheduled update check has started."); this.PerformUpdateSingle(e.LocalPath, e.RestartPath); return(true); } }
bool m_InterProcess_ScheduledUpdateRequestedEvent(object sender, ApplicationInstanceEventArgs e) { if (e.Time > 0) { Timer t = new Timer(e.Time * 1000); // Schedule an update in a certain number of seconds. t.Elapsed += new ElapsedEventHandler((a, b) => { this.m_DualLog.WriteEntry("Requested scheduled update check has started."); this.PerformUpdateSingle(e.LocalPath, e.RestartPath); }); t.AutoReset = false; t.Start(); return true; } else { this.m_DualLog.WriteEntry("Requested scheduled update check has started."); this.PerformUpdateSingle(e.LocalPath, e.RestartPath); return true; } }
bool m_InterProcess_HasUpdatesRequestedEvent(object sender, ApplicationInstanceEventArgs e) { return(this.HasUpdateSingle(e.LocalPath)); }
bool m_InterProcess_HasUpdatesRequestedEvent(object sender, ApplicationInstanceEventArgs e) { return this.HasUpdateSingle(e.LocalPath); }