예제 #1
0
        /*
         * public IntPtr GetDesktopHandle(DesktopLayer layer)
         * { //hWnd = new HandleRef();
         *  HandleRef hWnd;
         *  IntPtr hDesktop = new IntPtr();
         *  switch (layer)
         *  {
         *      case DesktopLayer.Progman:
         *          hDesktop = Win32Support.FindWindow("Progman", null);//第一层桌面
         *          break;
         *      case DesktopLayer.SHELLDLL:
         *          hDesktop = Win32Support.FindWindow("Progman", null);//第一层桌面
         *          hWnd = new HandleRef(this, hDesktop);
         *          hDesktop = Win32Support.GetWindow(hWnd, GW_CHILD);//第2层桌面
         *          break;
         *      case DesktopLayer.FolderView:
         *          hDesktop = Win32Support.FindWindow("Progman", null);//第一层桌面
         *          hWnd = new HandleRef(this, hDesktop);
         *          hDesktop = Win32Support.GetWindow(hWnd, GW_CHILD);//第2层桌面
         *          hWnd = new HandleRef(this, hDesktop);
         *          hDesktop = Win32Support.GetWindow(hWnd, GW_CHILD);//第3层桌面
         *          break;
         *  }
         *  return hDesktop;
         * }
         *
         * public void EmbedDesktop(Object embeddedWindow, IntPtr childWindow, IntPtr parentWindow)
         * {
         *  Form window = (Form)embeddedWindow;
         *  HandleRef HWND_BOTTOM = new HandleRef(embeddedWindow, new IntPtr(1));
         *  const int SWP_FRAMECHANGED = 0x0020;//发送窗口大小改变消息
         *  Win32Support.SetParent(childWindow, parentWindow);
         *  Win32Support.SetWindowPos(new HandleRef(window, childWindow), HWND_BOTTOM, 300, 300, window.Width, window.Height, SWP_FRAMECHANGED);
         *
         *
         * }
         */
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                int hour = int.Parse(tbxHour.Text);
                int min  = int.Parse(tbxMin.Text);

                Money money = DataFiler.FindMoney(tbxMoney.Text);

                if (hour > DateTime.Now.Hour || (hour == DateTime.Now.Hour && min - 1 > DateTime.Now.Minute))
                {
                    money.wakeupList.Add(new MyTime(DateTime.Now.Day, hour, min));
                    timeCountDown.Add(new TimeCountDown(money.Name, new MyTime(DateTime.Now.Day, hour, min)));

                    money.wakeupList.Sort();
                    timeCountDown.Sort();

                    showWPTimeToTanle();
                }
                //else if(hour < DateTime.Now.Hour || (hour == DateTime.Now.Hour && min < DateTime.Now.Minute))
                //{
                //    money.wakeupList.Add(new MyTime(1, hour, min));
                //    timeCountDown.Add(new TimeCountDown(money.Name, new MyTime(1, hour, min)));
                //}
            }
            catch (Exception ex)
            {
                MessageBox.Show("内容非法!");
            }
        }
예제 #2
0
        public static void Run()
        {
            try
            {
                if (BasicData.indexNum == 0)
                {
                    dataFiler = new DataFiler();
                }
                dataShow = new DataShow();
                if (dataFiler.IsGetData())
                {
                    dataFiler.GetData();
                    //dataFiler.SetColor();

                    dataShow.ToTable();
                    dataShow.UpdateLineLoc();

                    dataShow.ToZhongzhou();

                    dataShow.ToLong();
                    dataShow.ToOutMark();
                    //dataShow.UpLine();
                    dataShow.UpStar();
                    dataShow.UpCirMark();
                    dataShow.ToRixingtu();
                    dataShow.ToFengxiangtu();
                    dataShow.ToZoushitu();
                    dataShow.ToSignLight();
                    dataShow.ToSignZoushitu();
                    //dataShow.ToAllDoubleZST();
                    dataShow.UpdateSignnumState();
                }

                if (BasicData.indexNum == 0)
                {
                    foreach (TimeCountDown tcd in FMWarnTime.timeCountDown)
                    {
                        DataFiler.FindMoney(tcd.Name).wakeupList.Add(tcd.CountDown);
                    }
                    foreach (Money money in DataFiler.basicMoney)
                    {
                        if (money.wakeupList.Count != 0)
                        {
                            money.wakeupList.Sort();
                        }
                    }
                }


                //if (BasicData.indexNum == 2)
                //{
                //    dataShow.ToZoushitu();
                //    dataShow.ToFengxiangtu();
                //}

                dataShow.ToShortSuperNum();
                dataShow.ToTime();
                dataShow.ToZSTDownTime();
                dataShow.Countdown();
                //dataShow.ToOutMark();

                dataFiler.PPP();
                dataFiler.hxc();
                dataShow.ToLocation();
                dataShow.ToHxcData();
                if (dataFiler.IsGetData() || dataShow.IsUpdateDZST())
                {
                    dataShow.ToDoubleZoushitu();
                    dataShow.ToAllDoubleZST();
                }
                dataFiler.ToGGG();

                indexNum++;
                Thread.Sleep(1000);     //3000 修改为 1000
                Run();
            }
            catch (Exception ex)
            {
                DataFiler.ErrorLog(ex.ToString());
                Run();
            }
        }