void timer_Elapsed(object sender, ElapsedEventArgs e) { modify_chongqing_last_update_time(); Dispatcher.Invoke(new Action(delegate { sub_chongqing chongqing = MainWindow.FindChild <sub_chongqing>(Application.Current.MainWindow, "chongqing"); if (chongqing != null) { chongqing.last_update_time = chongqing_last_update_time; } })); if (PublicClass.ChongqingJson.Count > 120 || PublicClass.ChongqingJson.Count == 0) { Dispatcher.Invoke(new Action(delegate { PublicClass.init_trem("cqssc"); create_lianxu_coor("cqssc"); })); } if (DateTime.Now > chongqing_last_update_time) { cur_trem(); create_lianxu_coor("cqssc"); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { //chongqing newchongqing = new chongqing(); //LayoutDocument cq = new LayoutDocument(); //cq.Content = newchongqing; //cq.Title = "重庆时时彩"; //avapane.Children.Add(cq); //xinjiang newxinjiang = new xinjiang(); //LayoutDocument xj = new LayoutDocument(); //xj.Content = newxinjiang; //xj.Title = "新疆时时彩"; //avapane.Children.Add(xj); tremlist newtrem = new tremlist(); newtrem.Name = "newtrem"; leftpanel.Content = newtrem; rightlianxu rightcq = new rightlianxu(); rightcq.Name = "rightcq"; rightcq.titlelable.Content = "重庆时时彩"; //rightpanel.Content = rightcq; rightstack.Children.Add(rightcq); //rightlianxu rightxj = new rightlianxu(); //rightxj.Name = "rightxj"; //rightxj.titlelable.Content = "新疆时时彩"; ////rightpanel.Content = rightxj; //rightstack.Children.Add(rightxj); sub_chongqing chongqing = new sub_chongqing(); chongqing.Name = "chongqing"; LayoutDocument cq = new LayoutDocument(); cq.Content = chongqing; cq.Title = "重庆时时彩"; avapane.Children.Add(cq); timer.Interval = 1000; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); //init_trem(); PublicClass.init_trem("cqssc"); create_lianxu_coor("cqssc"); timer.Start(); }