示例#1
0
        private void AppOnExit()
        {
            if (!exitCalled)
            {
                baseProcessRefeshTimer.Stop();

                AppSaveSettings();
                AppUnLoadPages();

                fileSystemWatcher.EnableRaisingEvents = false;

                mainNativeBridge.AppWorkerCallBack(38, IntPtr.Zero, IntPtr.Zero);
                DelingDialogClose();

                mainPageUserMgr.UsersListUnInit();
                mainPagePerf.PerfClear();

                mainPageProcess.ProcessListFreeAll();
                mainPageProcessDetails.ProcessListDetailsUnInit();
                MSCM_Exit();
                mainPageKernelDrvMgr.KernelListUnInit();
                M_LOG_Close();
                if (SysVer.IsWin8Upper())
                {
                    mainPageUwpMgr.AppHistoryUninit();
                    mainPageUwpMgr.UWPListUnInit();
                    M_UWP_UnInit();
                }
                MAppWorkCall3(204, IntPtr.Zero, IntPtr.Zero);
                MAppWorkCall3(207, Handle, IntPtr.Zero);
                exitCalled = true;
            }
        }
示例#2
0
        private string UpdateSysVer(int count, string filelist, bool zip)
        {
            if (count != 0)
            {
                filelist = zip ? filelist:filelist.Substring(0, filelist.Length - 1);
                SysVer sysVer = new SysVer
                {
                    sysver      = txb_ver.Text,
                    note        = rtxb_note.Text,
                    programtype = upgradetype,
                    upgradedate = DateTime.Now.ToLongTimeString(),
                    filelist    = filelist
                };
                int id = loadService.AddSysVer(sysVer);
                if (id > 0)
                {
                    MetroMessageBox.Show(this, "上传成功");
                }
                else
                {
                    MetroMessageBox.Show(this, "上传失败,请重新上传");
                }
            }
            else
            {
                MetroMessageBox.Show(this, "上传文件失败,请重新上传");
            }

            return(filelist);
        }
示例#3
0
        private void FrmReportPrint_Load(object sender, EventArgs e)
        {
            for (int i = 0; i < 10; i++)
            {
                SysVer sysVer = new SysVer {
                    id            = i, filelist = i + "filelist", note = i + "note"
                    , programtype = i + "programtype", sysver = i + "sysver", upgradedate = i + "upgradedate"
                };
                sysVers.Add(sysVer);

                Sysdic sysdic = new Sysdic {
                    id      = i, Dickey = i + "dickey", DicMeno = i + "dicmeno",
                    Dicname = i + "dicname", Dicsetp = i, Dicval = i + "dicval"
                };
                sysdics.Add(sysdic);
            }
        }
示例#4
0
            public override bool GatherData(SystemData sysdata)
            {
                short  clientNo = sysdata.clientNo;
                int    ret      = 0;
                SysVer sysver   = new SysVer();

                ret += CollectShare.Instance().HNC_SystemGetValue((int)HncSystem.HNC_SYS_NCK_VER, ref sysver.ncu, clientNo);
                ret += CollectShare.Instance().HNC_SystemGetValue((int)HncSystem.HNC_SYS_DRV_VER, ref sysver.drv, clientNo);
                ret += CollectShare.Instance().HNC_SystemGetValue((int)HncSystem.HNC_SYS_PLC_VER, ref sysver.plc, clientNo);
                ret += CollectShare.Instance().HNC_SystemGetValue((int)HncSystem.HNC_SYS_CNC_VER, ref sysver.cnc, clientNo);
                ret += CollectShare.Instance().HNC_SystemGetValue((int)HncSystem.HNC_SYS_NC_VER, ref sysver.nc, clientNo);
                if (ret == 0)
                {
                    sysdata.sysver = sysver;
                }

                return(ret == 0 ? true : false);
            }
示例#5
0
        private void AppOnPreLoad()
        {
            //初始化函数

            //初始化桥
            mainNativeBridge = new MainNativeBridge(this);
            mainNativeBridge.exitCallBack = AppExit;
            mainNativeBridge.terminateImporantWarnCallBack = TermintateImporantProcess;
            mainNativeBridge.coreWndProc = (WNDPROC)Marshal.GetDelegateForFunctionPointer(MAppSetCallBack(IntPtr.Zero, 0), typeof(WNDPROC));
            mainNativeBridge.InitCallbacks();

            _isNativeBridgeLoaded = true;

            MainSettings = new MainSettings(this);

            //加载设置和所有页的代码
            AppLoadPages();
            AppLoadSettings();
            AppLoadAllMenuStyles();

            //标题
            SetConfig("LastWindowTitle", "AppSetting", Text);
            Text = GetConfig("Title", "AppSetting", "任务管理器");
            if (Text == "")
            {
                Text = LanuageFBuffers.Str_AppTitle;
            }

            new System.Threading.Thread(mainPagePerf.PerfInitTray).Start();

            //系统位数
#if _X64_
            Log("64 Bit OS ");
            Is64OS = true;
#else
            Is64OS = MIs64BitOS();
            Log(Is64OS ? "64 Bit OS but 32 bit app " : "32 Bit OS");
#endif
            IsAdmin = MIsRunasAdmin();

            //判断是否支持通用应用(win8 以上)
            SysVer.Get();
            if (!SysVer.IsWin8Upper())
            {
                tabControlMain.TabPages.Remove(tabPageUWPCtl);
            }
            else
            {
                M_UWP_Init();
            }

            //提升权限
            if (!MGetPrivileges())
            {
                TaskDialog.Show(LanuageMgr.GetStr("FailedGetPrivileges"), LanuageFBuffers.Str_AppTitle, "", TaskDialogButton.OK, TaskDialogIcon.Warning);
            }

            //tab 头 的自定义
            TaskMgrTabHeader tabHeader = new TaskMgrTabHeader(tabControlMain);
            Controls.Add(tabHeader);
            tabHeader.Dock   = DockStyle.Top;
            tabHeader.Height = 27;
            tabHeader.BringToFront();
            tabHeader.Font = tabControlMain.Font;
            if (IsSimpleView)
            {
                tabHeader.Visible = false;
            }

            //Shell Icon
            IntPtr shellIconPtr   = MGetShieldIcon2();
            Icon   shellIcon      = Icon.FromHandle(shellIconPtr);
            Bitmap shellIcoBtimap = MainUtils.IconToBitmap(shellIcon, 16, 16);

            check_showAllProcess.Image     = shellIcoBtimap;
            linkRebootAsAdmin.Image        = shellIcoBtimap;
            linkRestartAsAdminDriver.Image = shellIcoBtimap;

            DestroyIcon(shellIconPtr);
        }
示例#6
0
        private bool CheckVer()
        {
            SysVer ver = fileLoad.GetNewSysVer();

            return(ver.sysver == Application.ProductVersion);
        }