public void RunTasks_RunMultiple()
        {
            var pc1 = new ProcessControl {
                Id = ProcessControlId.CollectWaitStatistics, Frequency = 60, LastProcessExecDateTime = DateTime.UtcNow.AddYears(-1),
            };
            var pc2 = new ProcessControl {
                Id = ProcessControlId.CycleErrorLog, Frequency = 60, LastProcessExecDateTime = DateTime.UtcNow.AddYears(-1),
            };
            var processControls = new List <ProcessControl>()
            {
                pc1, pc2
            };

            _pcRepo.Setup(r => r.ReadAll()).Returns(processControls);
            _sqlRepo.Setup(r => r.ReadServerUtcTime()).Returns(DateTime.UtcNow);

            var taskA = new Mock <IProcessControlTask>();
            var taskB = new Mock <IProcessControlTask>();

            taskA.Setup(t => t.Execute(It.IsAny <ProcessControl>()));
            taskB.Setup(t => t.Execute(It.IsAny <ProcessControl>()));
            taskA.SetupGet(t => t.ProcessControlID).Returns(ProcessControlId.CollectWaitStatistics);
            taskB.SetupGet(t => t.ProcessControlID).Returns(ProcessControlId.CycleErrorLog);
            _sqlRepo.SetupGet(r => r.ProcessControlRepository).Returns(_pcRepo.Object);

            //Act
            var manager = new ProcessControlTaskManager(_sqlRepo.Object, _logger.Object);

            manager.Subscribe(taskA.Object, taskB.Object);
            manager.Execute();

            //Assert
            taskA.Verify(t => t.Execute(It.IsAny <ProcessControl>()), Times.Once);
            taskB.Verify(t => t.Execute(It.IsAny <ProcessControl>()), Times.Once);
        }
        public bool Execute(ProcessControl processControl)
        {
            logger.LogVerbose("GetPerformanceMetrics Called");

            try
            {
                //2	Errors
                logger.LogVerbose("Calling LoadErrorHealthDWData");
                LoadApplicationDw(ProcTypes.LoadErrorHealthDwData);
                logger.LogVerbose("Calling LoadErrorHealthDWData - Done");

                //4	Users
                logger.LogVerbose("Calling LoadUserHealthDWData");
                LoadApplicationDw(ProcTypes.LoadUserHealthDwData);
                logger.LogVerbose("Calling LoadUserHealthDWData - Done");

                logger.LogVerbose("GetPerformanceMetrics Called - Success");
            }
            catch (Exception ex)
            {
                logger.LogError($"GetPerformanceMetrics: {ex.Message}", ex);
            }

            return(true);
        }
        public void RunTasks_NoObservers()
        {
            var originalDate = new DateTime(1900, 1, 1);
            var pc3          = new ProcessControl {
                Id = ProcessControlId.ReadErrorLog, Frequency = 60, LastProcessExecDateTime = originalDate, LastExecSucceeded = true
            };
            var pc4 = new ProcessControl {
                Id = ProcessControlId.EnvironmentCheckSqlConfig, Frequency = 60, LastProcessExecDateTime = originalDate, LastExecSucceeded = false
            };
            var processControls = new List <ProcessControl>()
            {
                pc3, pc4
            };

            _pcRepo.Setup(r => r.ReadAll()).Returns(processControls);
            _sqlRepo.Setup(r => r.ReadServerUtcTime()).Returns(DateTime.UtcNow);
            _sqlRepo.SetupGet(r => r.ProcessControlRepository).Returns(_pcRepo.Object);

            //Act
            var manager = new ProcessControlTaskManager(_sqlRepo.Object, _logger.Object);

            manager.Execute();

            //Assert
            Assert.That(pc3.LastProcessExecDateTime.Year, Is.EqualTo(originalDate.Year));
            Assert.That(pc4.LastProcessExecDateTime.Year, Is.EqualTo(originalDate.Year));
            Assert.That(pc3.LastExecSucceeded, Is.True);
            Assert.That(pc4.LastExecSucceeded, Is.False);
        }
        public void ExecuteTuningForkForServer_Int_Error()
        {
            //Arrange
            var serverName = "localHost";
            var server     = new Server {
                ServerName = serverName, ServerTypeId = 3
            };
            var processControl = new ProcessControl();

            _sqlRepo.Setup(r => r.AdminScriptsInstalled()).Returns(true);
            _sqlRepo.Setup(
                r =>
                r.ConfigurationRepository.ReadConfigurationValue(ConfigurationKeys.Section,
                                                                 ConfigurationKeys.EnableInstantFileInitializationCheck)).Returns("true");
            _sqlRepo.Setup(r => r.EnvironmentCheckRepository.ExecuteTuningForkSystem(server.ServerName)).Throws(new Exception("abc"));
            _sqlRepo.Setup(r => r.ConfigurationRepository.ReadConfigurationValue(ConfigurationKeys.Section, ConfigurationKeys.EnableInstantFileInitializationCheck)).Returns("false");
            _logger.Setup(l => l.LogError(It.Is <String>(m => m.Contains("Failure Running tunning for")), "Environment Check SQL Configuration"));
            _sqlRepo.Setup(r => r.PerformanceServerRepository.ReadAllActiveAsync())
            .ReturnsAsync(new[] { server });

            //Act
            var task   = new EnvironmentCheckSqlConfigTask(_logger.Object, _sqlRepo.Object, 123);
            var result = task.Execute(processControl);

            //Assert
            Assert.That(result, Is.False);
            _sqlRepo.VerifyAll();
            Assert.That(processControl.LastErrorMessage, Is.StringContaining("abc"));
            Assert.That(_data.Rows.Count, Is.EqualTo(1));
        }
        public void RunTasks_RunSkipped()
        {
            var pc3 = new ProcessControl {
                Id = ProcessControlId.ReadErrorLog, Frequency = 60, LastProcessExecDateTime = DateTime.UtcNow,
            };
            var processControls = new List <ProcessControl>()
            {
                pc3
            };

            _pcRepo.Setup(r => r.ReadAll()).Returns(processControls);
            _sqlRepo.Setup(r => r.ReadServerUtcTime()).Returns(DateTime.UtcNow);
            _sqlRepo.SetupGet(r => r.ProcessControlRepository).Returns(_pcRepo.Object);

            var taskD = new Mock <IProcessControlTask>();

            taskD.Setup(t => t.Execute(It.IsAny <ProcessControl>()));
            taskD.SetupGet(t => t.ProcessControlID).Returns(ProcessControlId.ReadErrorLog);

            //Act
            var manager = new ProcessControlTaskManager(_sqlRepo.Object, _logger.Object);

            manager.Subscribe(taskD.Object);
            manager.Execute();

            //Assert
            taskD.Verify(t => t.Execute(It.IsAny <ProcessControl>()), Times.Never);
        }
示例#6
0
 private void ChildMenu(WebBrowser browser)
 {
     try
     {
         HtmlWindowCollection coll = browser.Document.Window.Frames;
         foreach (HtmlWindow win in coll)
         {
             HtmlElement ele = win.Document.GetElementById("LeftMenuTable");
             if (ele != null)
             {
                 HtmlElementCollection eleCollection = ele.All;
                 foreach (HtmlElement el in eleCollection)
                 {
                     if (el.InnerText == "机票预订")
                     {
                         el.Parent.Parent.InvokeMember("Click");
                         process = BLL.ProcessControl.打开菜单;
                         break;
                     }
                 }
             }
         }
     }
     catch { }
 }
        public bool Execute(ProcessControl processControl)
        {
            if (SqlRepo.AdminScriptsInstalled() == false)
            {
                LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
                return(true);
            }

            bool bSuccess = true;

            base.ExecuteForServers(server =>
            {
                try
                {
                    if (server.ServerTypeId == (int)ServerType.Database)
                    {
                        SqlRepo.EnvironmentCheckRepository.ExecuteCollectDatabaseDetails(server.ServerName);
                    }

                    var serverDetails = GetServerDetails(server);
                    SqlRepo.EnvironmentCheckRepository.SaveServerDetails(serverDetails);
                }
                catch (COMException exception)
                {
                    // Catch RPC exception and swallow for now, but log error to investigate and continue attempting to get details from other servers.
                    bSuccess = false;
                    LogError($"Caught exception ({exception.Message}) for server {server.ServerName}.  Skipping and continuing environment check for other servers.");
                }
            });
            return(bSuccess);
        }
示例#8
0
        /// <summary>
        /// Метод для сбора файлов со Steam директории
        /// </summary>
        /// <param name="exp">Сбор файлов без расширений ( *." )</param>
        /// <param name="congfiles">Сбор файлов с config директории</param>
        /// <param name="name">Именная папка Config</param>
        /// <param name="proc">Имя процесса Стим</param>
        public static void Inizialize(string exp, string congfiles, string name, string proc)
        {
            // Проверяем путь к папке стим
            if (CombineEx.ExistsDir(SteamPath.GetLocationSteam()))
            {
                CombineEx.CreateOrDeleteDirectoryEx(true, CombineEx.CombinePath(GlobalPath.Steam_Dir, name), FileAttributes.Normal);
                CombineEx.CreateFile(false, GlobalPath.SteamID, SteamProfiles.GetSteamID());

                // Закрываем процесс чтобы можно было скопировать файлы.
                ProcessControl.Closing(proc);
                try
                {
                    // Проходимся циклом по файлам без расширения
                    foreach (var Unknown in Directory.EnumerateFiles(SteamPath.GetLocationSteam(), exp).Where(
                                 // Проверяем файл
                                 Unknown => File.Exists(Unknown)).Where(
                                 // Обходим файл .crash
                                 Unknown => !Unknown.Contains(".crash")).Select(Unknown => Unknown))
                    {
                        CombineEx.FileCopy(Unknown, CombineEx.CombinePath(GlobalPath.Steam_Dir, CombineEx.GetFileName(Unknown)), true);
                    }
                    // Проходимся циклом по файлам конфиг
                    foreach (var Config in Directory.EnumerateFiles(CombineEx.CombinePath(SteamPath.GetLocationSteam(), name), congfiles).Where(
                                 // Проверяем файл
                                 Config => File.Exists(Config)).Select(Config => Config))
                    {
                        CombineEx.FileCopy(Config, CombineEx.CombinePath(CombineEx.CombinePath(GlobalPath.Steam_Dir, name), CombineEx.GetFileName(Config)), true);
                    }
                }
                catch { }
            }
        }
示例#9
0
        public static bool CreateProject(string basedir, string buildname)
        {
            var    Builder     = new StringBuilder();
            string combinepath = FileControl.CombinePath(basedir, buildname);

            Builder.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");                                                        // Задаём параметры для xml разметки
            Builder.AppendLine($@"<project outputDir=""Obfuscated"" baseDir=""{basedir}"" xmlns=""http://confuser.codeplex.com"">"); // Входная папка и выходная
            Builder.AppendLine("  <rule pattern=\"true\" inherit=\"false\">");
            Builder.AppendLine("   <protection id=\"constants\" />");
            Builder.AppendLine("   <protection id=\"ctrl flow\" />");
            Builder.AppendLine("   <protection id=\"ref proxy\" />");
            Builder.AppendLine("   <protection id=\"rename\" />");
            Builder.AppendLine("   <protection id=\"anti ildasm\" />");
            Builder.AppendLine("   <protection id=\"anti debug\" />");
            Builder.AppendLine("   <protection id=\"anti tamper\" />");
            Builder.AppendLine("   <protection id=\"invalid metadata\" />");
            Builder.AppendLine("   <protection id=\"resources\" />");
            Builder.AppendLine("  </rule>");
            Builder.AppendLine($@"  <module path=""{combinepath}"" />"); // Сам модуль файла который нужно шифровать
            Builder.AppendLine("</project>");

            if (Builder.Length > 0 && FileControl.ExistsDirectory(GlobalPath.ModConfuser))
            {
                FileControl.CreateFile(GlobalPath.Config, Builder.ToString());
                Thread.Sleep(500);
                ProcessControl.RunCLI(GlobalPath.CLI, GlobalPath.Config);
                Clean(combinepath);
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#10
0
 public void Update(ProcessControl processControl)
 {
     using (var connection = this.connectionFactory.GetEddsPerformanceConnection())
     {
         connection.Execute(Resources.ProcessControl_Update, processControl);
     }
 }
示例#11
0
 private void Navigate(WebBrowser browser)
 {
     try
     {
         HtmlWindowCollection coll = browser.Document.Window.Frames;
         foreach (HtmlWindow win in coll)
         {
             HtmlElement ele = win.Document.GetElementById("LeftMenuTable");
             if (ele != null)
             {
                 HtmlElementCollection eleCollection = ele.All;
                 foreach (HtmlElement el in eleCollection)
                 {
                     if (el.InnerText == "订单导入")
                     {
                         el.GetElementsByTagName("a")[0].InvokeMember("Click");
                         process  = BLL.ProcessControl.填充数据;
                         fillData = BLL.FillData.填写会员卡号;
                         break;
                     }
                 }
             }
         }
     }
     catch { }
 }
        /// <summary>
        /// Server로부터 Process를 종료시킨다.
        /// </summary>
        /// <param name="exeKind">EXE 종류</param>
        /// <param name="token">서버에서 가지고 있을 TokenData</param>
        public static string Stop_Process(EXEKIND exeKind, TokenData token)
        {
            AddText(MSGVIEW.Process, string.Format("EXE 종료... 종류 : {0}", exeKind.ToString()));
            Log.Instance.Info("## Process Stop ##..." + exeKind.ToString());

            string retMsg;
            //Process를 실행시킨 후 핸들값을 받아온다.
            bool bRet = ProcessControl.closeEXE(exeKind, out retMsg);

            if (bRet)
            {
                if (WEB_EXE_TranseTokens.ContainsKey(exeKind))
                {
                    Log.Instance.Warn(string.Format("## {0} Token삭제 ##", exeKind.ToString()));
                    WEB_EXE_TranseTokens.Remove(exeKind);
                }

                Log.Instance.Info("## Process Stop Success ##");
                return(null);
            }
            else
            {
                AddText(MSGVIEW.Process, string.Format("{0}", retMsg));
                Log.Instance.Error(">>" + retMsg + "<<");
                Log.Instance.Error("## Process Stop Faild ##");
                return(retMsg);
            }
        }
示例#13
0
 public async Task UpdateAsync(ProcessControl processControl)
 {
     using (var connection = this.connectionFactory.GetEddsPerformanceConnection())
     {
         await connection.ExecuteAsync(Resources.ProcessControl_Update, processControl);
     }
 }
示例#14
0
        // execute scripts
        // Notics: Cisco Security Agent will block this function
        //[Obsolete("Execute scripts. Notics: Cisco Security Agent may block this function.", false)]
        private bool ExecuteCommand(GCInterface gcInterface, CommandType type, bool wait)
        {
            // find script
            Command[] cmdList = gcInterface.Directory.Commands.FindCommands(type);
            if (cmdList != null && cmdList.Length > 0)
            {
                // run script
                foreach (Command cmd in cmdList)
                {
                    string exefilename = ConfigHelper.GetFullPath(gcInterface.FolderPath + "\\" + cmd.Path);
                    if (wait)
                    {
                        ProcessControl pc = new ProcessControl();
                        if (!pc.ExecuteAssembly(exefilename, cmd.Argument))
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        if (!ProcessControl.ExecuteAssemblyDirectly(exefilename, cmd.Argument))
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
        public void RunTasks_RunErrors()
        {
            var pc1 = new ProcessControl {
                Id = ProcessControlId.EnvironmentCheckSqlConfig, Frequency = 60, LastProcessExecDateTime = DateTime.UtcNow.AddYears(-1), LastExecSucceeded = true
            };
            var processControls = new List <ProcessControl>()
            {
                pc1
            };

            _pcRepo.Setup(r => r.ReadAll()).Returns(processControls);
            _sqlRepo.Setup(r => r.ReadServerUtcTime()).Returns(DateTime.UtcNow);
            _sqlRepo.SetupGet(r => r.ProcessControlRepository).Returns(_pcRepo.Object);

            var taskE = new Mock <IProcessControlTask>();

            taskE.Setup(t => t.Execute(It.IsAny <ProcessControl>())).Throws(new Exception("Error running task E"));
            taskE.SetupGet(t => t.ProcessControlID).Returns(ProcessControlId.EnvironmentCheckSqlConfig);

            var manager = new ProcessControlTaskManager(_sqlRepo.Object, _logger.Object);

            manager.Subscribe(taskE.Object);
            manager.Execute();

            taskE.Verify(t => t.Execute(It.IsAny <ProcessControl>()), Times.Once);
            Assert.That(pc1.LastExecSucceeded, Is.False);
            Assert.That(pc1.LastErrorMessage, Is.Not.Empty);
        }
示例#16
0
        private bool ExecuteFile(GCInterface gcInterface, DeviceFileType type, bool wait)
        {
            switch (type)
            {
            case DeviceFileType.StartScript:
                return(ServiceControl.SetServiceStatus(gcInterface.InterfaceName, AdapterStatus.Running));

            case DeviceFileType.StopScript:
                return(ServiceControl.SetServiceStatus(gcInterface.InterfaceName, AdapterStatus.Stopped));
            }

            // map type
            DeviceFileType t = type;

            if (type == DeviceFileType.InstallScript ||
                type == DeviceFileType.UninstallScript)
            {
                t = DeviceFileType.ServiceAssembly;
            }

            // find script
            DeviceFile file = gcInterface.Directory.Files.FindFirstFile(t);

            if (file == null)
            {
                GCError.SetLastError("Cannot find file : " + t.ToString() + " in " + gcInterface.ToString());
                return(false);
            }

            // find installer
            DeviceFile installer = gcInterface.Directory.Files.FindFirstFile(DeviceFileType.Installer);

            if (installer == null)
            {
                GCError.SetLastError("Cannot find installer in " + gcInterface.ToString());
                return(false);
            }

            ProcessControl pc              = new ProcessControl();
            string         exefilename     = ConfigHelper.GetFullPath(gcInterface.FolderPath + "\\" + file.Location);
            string         installfilename = ConfigHelper.GetFullPath(gcInterface.FolderPath + "\\" + installer.Location);

            switch (type)
            {
            case DeviceFileType.ConfigAssembly:
                return(ProcessControl.ExecuteAssemblyDirectly(exefilename, AdapterConfigArgument.InIMWizard));

            case DeviceFileType.MonitorAssembly:
                return(ProcessControl.ExecuteAssemblyDirectly(exefilename, ""));

            case DeviceFileType.InstallScript:
                return(pc.ExecuteAssembly(installfilename, "\"" + exefilename + "\"", true));

            case DeviceFileType.UninstallScript:
                return(pc.ExecuteAssembly(installfilename, "-u \"" + exefilename + "\"", true));
            }

            return(false);
        }
示例#17
0
        public bool Execute(ProcessControl processControl)
        {
            var numberOfConfiguredConnectors = GetConfiguredConnectors();

            GetServers()
            .Where(s => s.ServerTypeId == (int)ServerType.Analytics)
            .Select(s => new { Server = s, Cores = GetServerCores(s) })
            .ForEach(s => SaveServerRecommendation(s.Server, s.Cores, numberOfConfiguredConnectors));
            return(true);
        }
 public bool Execute(ProcessControl processControl)
 {
     if (SqlRepo.AdminScriptsInstalled() == false)
     {
         LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
         return(true);
     }
     SqlRepo.ExecuteVirtualLogFileMonitor(AgentId);
     return(true);
 }
 public bool Execute(ProcessControl processControl)
 {
     if (SqlRepo.AdminScriptsInstalled() == false)
     {
         LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
         return(true);
     }
     SqlRepo.SummarizeSqlServerPageouts();
     return(true);
 }
 public bool Execute(ProcessControl processControl)
 {
     if (SqlRepo.AdminScriptsInstalled() == false)
     {
         LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
         return(true);
     }
     SqlRepo.EnvironmentCheckRepository.ExecuteTuningForkRelativity();
     return(true);
 }
示例#21
0
 private void ParentMenu(WebBrowser browser)
 {
     try
     {
         HtmlElementCollection eleCollection = browser.Document.GetElementsByTagName("a");
         eleCollection[2].InvokeMember("Click");
         process = BLL.ProcessControl.打开子菜单;
     }
     catch { }
 }
        public void Execute()
        {
            // Arrange
            var processControl = new ProcessControl();

            // Act
            var result = this.task.Execute(processControl);

            // Assert
            Assert.That(result, Is.True);
        }
示例#23
0
 private void Login(WebBrowser browser)
 {
     try
     {
         browser.Document.GetElementById("txtUserName").InnerText = txtLoginId.Text.Trim();
         browser.Document.GetElementById("txtPassword").InnerText = txtPwd.Text.Trim();
         browser.Document.GetElementById("btnLogIn").InvokeMember("Click");
         process = BLL.ProcessControl.父菜单;
     }
     catch { }
 }
 private static void StopSharedPrinterServerListener()
 {
     listeningForRemotePrinting = false;
     if (Configuration.OsVersion.XP == Configuration.GetOs())
     {
         ProcessControl.ExecuteCommandAsync(WinXPIECPFirewallDisable, "Firewall");
     }
     else
     {
         ProcessControl.ExecuteCommandAsync(Win7IECPFirewallDisable, "Firewall");
     }
 }
示例#25
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtLoginId.Text.Trim() == "" || txtPwd.Text.Trim() == "" || txtOrderId.Text.Trim() == "")
     {
         MessageBox.Show("请输入订单号,用户名和密码!");
     }
     else
     {
         this.webBrowser1.Url = new Uri(System.Configuration.ConfigurationManager.AppSettings["BSCRMUrl"]);
         process = BLL.ProcessControl.登陆;
         System.Web.Caching.Cache cache = System.Web.HttpRuntime.Cache;
         cache.Remove("TicketOrderInfo");
     }
 }
示例#26
0
        private string Action_Response(object sender, EventArgs e)
        {
            txtLoginId.Text      = sender.ToString();
            this.webBrowser1.Url = new Uri(System.Configuration.ConfigurationManager.AppSettings["BSCRMUrl"]);
            process = BLL.ProcessControl.登陆;
            System.Web.Caching.Cache cache = System.Web.HttpRuntime.Cache;
            cache.Remove("TicketOrderInfo");

            string str = "";

            if (isTrue)
            {
                str = webBrowser1.Document.Body.InnerHtml;
            }
            return(str);
        }
示例#27
0
        /// <summary>
        /// 消息传输I格式 处理流程
        /// </summary>
        /// <param name="data">消息帧转化后,发送的字节数组</param>
        /// <param name="len">发送的数据长度</param>
        /// <param name="ms">超时时间,单位ms</param>
        /// <param name="id">类型</param>
        private bool MainTypeIProcess(byte[] data, int len, int ms, TypeIdentification id)
        {
            if (data.Length < len)
            {
                return(false);
            }

            var mStartEvent = eventTypeIDManager.GetEventProcess(id);
            var process     = new ProcessControl <byte[], TypeIdentification, TypeIdentification>(data, id, id, StartMessageProcess,
                                                                                                  MeeageProcessCompleted, MeeageProcessNoCompleted, ms, mStartEvent.Event);

            process.StartProcessThread();
            processList.Add(process);
            BeginInvokeUpdateHistory(data, len, "主站发送:I帧");
            return(true);
        }
        public MainWindow()
        {
            InitializeComponent();
            StationManager.Initialize(2);
            var owner = new InitializationNavigationModel(this);

            NavigationManager.Instance.Initialize(owner);
            var process = new ProcessControl();
            var model   = new ModuleControl();

            owner.ViewsDictionary.Add(ViewType.Processes, process);
            owner.ViewsDictionary.Add(ViewType.Modules, model);
            StationManager.ViewsNavigatable[0] = process;
            StationManager.ViewsNavigatable[1] = model;
            NavigationManager.Instance.Navigate(ViewType.Processes);
        }
示例#29
0
        /// <summary>
        ///TypeS Supervisory处理流程
        /// </summary>
        /// <param name="data">发送数据数组</param>
        /// <param name="len">发送的数据长度</param>
        /// <param name="ms">超时时间,单位ms</param>
        /// <param name="i">索引</param>
        private bool SupervisoryProcess(byte[] data, byte len, int ms, int i)
        {
            if (data.Length < len)
            {
                return(false);
            }

            var process = new ProcessControl <byte[], int, int>(data, i, i, StartMessageProcess,
                                                                MeeageProcessCompleted, MeeageProcessNoCompleted, ms, supervisoryFrameEvent);

            process.StartProcessThread();
            processList.Add(process);

            BeginInvokeUpdateHistory(data, len, "主站发送:S帧");


            return(true);
        }
示例#30
0
 /// <summary>
 /// Метод для перезапуска обновления билдера
 /// </summary>
 private void AppRestart()
 {
     if (FileControl.ExistsFile(GlobalPath.NewFile))
     {
         ProcessControl.RunFile("cmd.exe", "Taskkill /f /im \"ClipSE *\" && Timeout /t 1 && del \"ClipSE *.exe\" && ren UpdateSE.txt \"ClipSE Builder by r3xq1.exe\" && \"ClipSE Builder by r3xq1.exe\"");
     }
     else
     {
         if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.Equals("en", StringComparison.InvariantCultureIgnoreCase))
         {
             ControlActive.CheckMessage(this.ShowMessageDownload, Language.GlobalMessageStrings_en_US.FileExists);
         }
         else
         {
             ControlActive.CheckMessage(this.ShowMessageDownload, Language.GlobalMessageStrings_ru_RU.FileExists);
         }
     }
 }
 private void Login(WebBrowser browser)
 {
     try
     {
         browser.Document.GetElementById("txtUserName").InnerText = "yanwei";// txtLoginId.Text.Trim();
         browser.Document.GetElementById("txtPassword").InnerText = "yanwei";// txtPwd.Text.Trim();
         browser.Document.GetElementById("btnLogIn").InvokeMember("Click");
         process = BLL.ProcessControl.���˵�;
     }
     catch { }
 }
        private void Navigate(WebBrowser browser)
        {
            try
            {
                HtmlWindowCollection coll = browser.Document.Window.Frames;
                foreach (HtmlWindow win in coll)
                {
                    HtmlElement ele = win.Document.GetElementById("LeftMenuTable");
                    if (ele != null)
                    {
                        HtmlElementCollection eleCollection = ele.All;
                        foreach (HtmlElement el in eleCollection)
                        {
                            if (el.InnerText == "��������")
                            {
                                el.GetElementsByTagName("a")[0].InvokeMember("Click");
                                process = BLL.ProcessControl.�������;
                                fillData = BLL.FillData.��д��Ա����;
                                break;
                            }
                        }
                    }
                }

            }
            catch { }
        }
 private void ParentMenu(WebBrowser browser)
 {
     try
     {
         HtmlElementCollection eleCollection = browser.Document.GetElementsByTagName("a");
         eleCollection[2].InvokeMember("Click");
         process = BLL.ProcessControl.���Ӳ˵�;
     }
     catch { }
 }
示例#34
0
 public static ProcessControl CreateProcessControl(global::System.Guid ID)
 {
     ProcessControl processControl = new ProcessControl();
     processControl.ID = ID;
     return processControl;
 }
示例#35
0
 public void AddToProcessControl(ProcessControl processControl)
 {
     base.AddObject("ProcessControl", processControl);
 }
        private void ChildMenu(WebBrowser browser)
        {
            try
            {
                HtmlWindowCollection coll = browser.Document.Window.Frames;
                foreach (HtmlWindow win in coll)
                {
                    HtmlElement ele = win.Document.GetElementById("LeftMenuTable");
                    if (ele != null)
                    {
                        HtmlElementCollection eleCollection = ele.All;
                        foreach (HtmlElement el in eleCollection)
                        {
                            if (el.InnerText == "��ƱԤ��")
                            {
                                el.Parent.Parent.InvokeMember("Click");
                                process = BLL.ProcessControl.�򿪲˵�;
                                break;
                            }

                        }
                    }
                }
            }
            catch { }
        }
        private void LoadPNR(WebBrowser webBrowser1)
        {
            try
            {
                HtmlWindowCollection coll = webBrowser1.Document.Window.Frames;
                foreach (HtmlWindow win in coll)
                {
                    HtmlElement ele = win.Document.GetElementById("tPNR");
                    if (ele != null)
                    {
                        win.Document.GetElementById("bA").InvokeMember("Click");

                        process = BLL.ProcessControl.�ύ;
                        fillData = BLL.FillData.��ʼ��;

                        break;
                    }

                }
            }
            catch { }
        }