public void NewyorkTime(Object sender, CorrectionEventArgs e) { int jetLag = -5; //纽约的夏时制起止时间为每年的3月10日至11月3日。 DateTime startDate = DateTime.Parse(e.dt.Year.ToString() + "-03-10"); DateTime endDate = DateTime.Parse(e.dt.Year.ToString() + "-11-03"); cityTime.Add(DST(e.dt, startDate, endDate).AddHours(jetLag)); }
public void LondonTime(Object sender, CorrectionEventArgs e) { int jetLag = 0; //伦敦夏时制起止时间为每年的3月31日至10月27日 DateTime startDate = DateTime.Parse(e.dt.Year.ToString() + "-03-31"); DateTime endDate = DateTime.Parse(e.dt.Year.ToString() + "-10-27"); cityTime.Add(DST(e.dt, startDate, endDate).AddHours(jetLag)); }
public void LondonTime(Object sender, CorrectionEventArgs e) { int jetLag = 0; //伦敦夏时制起止时间为每年的3月31日至10月27日 DateTime startDate = DateTime.Parse(e.dt.Year.ToString() + "-03-31"); DateTime endDate = DateTime.Parse(e.dt.Year.ToString() + "-10-27"); cityTime.Add(DST(e.dt, startDate, endDate).AddHours(jetLag)); }
public void NewyorkTime(Object sender, CorrectionEventArgs e) { int jetLag = -5; //纽约的夏时制起止时间为每年的3月10日至11月3日。 DateTime startDate = DateTime.Parse(e.dt.Year.ToString() + "-03-10"); DateTime endDate = DateTime.Parse(e.dt.Year.ToString() + "-11-03"); cityTime.Add(DST(e.dt, startDate, endDate).AddHours(jetLag)); }
//将事件通知观察者 public void NotifyObservers(DateTime UTC) { //枚举容器中的观察者,将事件一一通知给他们 if (ChangeTimeEvent != null) { //e 获取观察者兴趣的变量 CorrectionEventArgs e = new CorrectionEventArgs(UTC); Delegate[] delArry = ChangeTimeEvent.GetInvocationList(); foreach (Delegate item in delArry) { item.DynamicInvoke(this, e); } } }
//将事件通知观察者 public void NotifyObservers(DateTime UTC) { //枚举容器中的观察者,将事件一一通知给他们 if (ChangeTimeEvent != null) { //e 获取观察者兴趣的变量 CorrectionEventArgs e = new CorrectionEventArgs(UTC); Delegate[] delArry = ChangeTimeEvent.GetInvocationList(); foreach (Delegate item in delArry) { item.DynamicInvoke(this, e); } } }
public void SydneyTime(Object sender, CorrectionEventArgs e) { int jetLag = 10; cityTime.Add(e.dt.AddHours(jetLag)); }
public void PekingTime(Object sender, CorrectionEventArgs e) { int jetLag = 8; cityTime.Add(e.dt.AddHours(jetLag)); }
public void MoscowTime(Object sender, CorrectionEventArgs e) { int jetLag = 4; cityTime.Add(e.dt.AddHours(jetLag)); }
public void SydneyTime(Object sender, CorrectionEventArgs e) { int jetLag = 10; cityTime.Add(e.dt.AddHours(jetLag)); }
public void PekingTime(Object sender, CorrectionEventArgs e) { int jetLag = 8; cityTime.Add(e.dt.AddHours(jetLag)); }
public void MoscowTime(Object sender, CorrectionEventArgs e) { int jetLag = 4; cityTime.Add(e.dt.AddHours(jetLag)); }