示例#1
0
        void Update_Pic()
        {
            WinProgressBar wpb = new WinProgressBar()
            {
                BgWork = _Update_Pic, MaxRespTime = 5, BarTitle = "正在转存图片"
            };

            wpb.Topmost = true;
            wpb.ShowDialog();
            int rst = _rst_update_pic;

            if (rst == 0)
            //上传成功,删除图片
            {
                DirectoryInfo info = new DirectoryInfo(MonitoringX.picDirect);
                if (info.Exists)
                {
                    // System.Threading.Thread.Sleep(3000);
                    var files = info.GetFiles();
                    for (int i = 0; i < files.Length; i++)
                    {
                        if (files[i].Name != MonitoringX.picfile_name)
                        {
                            files[i].Delete();
                        }
                    }
                }
            }
        }
        public void startPlay()//获取视频句柄
        {
            //Thread thread = new Thread(new ThreadStart(realPlay));
            // thread.Start();
            // thread.Join();
            WinProgressBar wpb = new WinProgressBar()
            {
                BgWork = realPlay, MaxRespTime = 2, BarTitle = "双屏显示启动中"
            };

            wpb.ShowDialog();
            if (VideoState[0] < 0)
            {
                infraredRayPictureBox1.change_Pic("..\\..\\Image\\video.png");
            }
            if (VideoState[1] < 0)
            {
                infraredRayPictureBox2.change_Pic("..\\..\\Image\\video.png");
            }
            if (VideoState[2] < 0)
            {
                infraredRayPictureBox3.change_Pic("..\\..\\Image\\video.png");
            }
            if (VideoState[3] < 0)
            {
                infraredRayPictureBox4.change_Pic("..\\..\\Image\\video.png");
            }
        }
示例#3
0
        private void sure(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(filePath) || File.Exists(filePath) == false)
            {
                MessageBoxX.Show("舷号导入提示", "数据文件为空或不存在");
                //this.Close();
                return;
            }
            WinProgressBar wpb = new WinProgressBar()
            {
                BgWork = Update_ShipName, MaxRespTime = 30, BarTitle = "船舷号导入中"
            };

            wpb.ShowDialog();

            this.Close();
        }
        private SetConfig config = new SetConfig();                       //配置文件实例
        //管理员,工程师,操作员,观察员

        public MainWindow()
        {
            InitializeComponent();

            dbIP       = config.read_string("dbsetting", "dbip");
            dbUser     = config.read_string("dbsetting", "dbuser");
            dbPassword = config.read_string("dbsetting", "dbpassword");
            dbName     = config.read_string("dbsetting", "dbname");

            WinProgressBar dialog = new WinProgressBar()
            {
                MaxRespTime = 2, BgWork = dataConnect, BarTitle = "正在加载系统"
            };                                                                                                          //主界面进度条

            dialog.ShowDialog();
            deviceIP = getDeviceIP();
            try
            {
                //MessageBoxX("Info", GetProcess.ProcessManager.IsRunning("MaritimeSecurityMonitoring") == true)
                if (ProcessManager.IsRunning("MaritimeSecurityMonitoring") == true)
                {
                    MessageBoxX.Show("启动警告", "检测到软件已运行,请关闭后重启");
                    System.Windows.Application.Current.Shutdown();

                    Environment.Exit(0);//强制退出
                    GC.Collect();
                }
            }
            catch (Exception ee)
            {
            }
            try
            {
                loginData        = new LoginManager();
                OperationLogData = new OperationLogWriter();
                opeation         = new OperationLog();
            }
            catch (Exception ee)
            {
            }
        }