示例#1
0
        void ChildStateChanged(object sender, ServiceStateChangedEventArgs e)
        {
            ServiceInstance child = (ServiceInstance)sender;

            if (_commChannel != null && _commChannel.State == CommunicationState.Opened)
            {
                _commChannel.Engine.ChildServiceStateChanged(_childServices[child], e.StateAfter);
            }
        }
示例#2
0
        void LegacyInstance_StateChanged(object sender, Edge.Core.Services.ServiceStateChangedEventArgs e)
        {
            legacy.ServiceInstance instance = (Edge.Core.Services.ServiceInstance)sender;
            GridUpdateInstance(instance);
            LogText(string.Format("{0}: {1} is {2}", instance.AccountID, instance.Configuration.Name, e.StateAfter));

            if (e.StateAfter == legacy.ServiceState.Ready)
            {
                try { instance.Start(); }
                catch (Exception ex)
                {
                    string msg = String.Format("{1}: Failed to start service {0}", instance.Configuration.Name, instance.AccountID);
                    LogText(msg);
                    Log.Write(Program.LS, msg, ex);
                }
            }
        }
示例#3
0
        void child_instance_StateChanged(object sender, Edge.Core.Services.ServiceStateChangedEventArgs e)
        {
            Edge.Core.Services.ServiceInstance instance = (Edge.Core.Services.ServiceInstance)sender;

            Invoke(_updateProgressBar, new object[] { this.progressBar, 0, true });
            Invoke(_updateProgressBar, new object[] { this.progressBar, 60, true });
            //Invoke(_setLabelText, new object[] { ProgressBarTxt, string.Format("{0}-{1}", instance.Configuration.Name, e.StateAfter) });

            string log = string.Format("State Changed : {0} - Account ID: {2} - Service Channel ID: {1} ", e.StateAfter, instance.Configuration.GetOption("ChannelList", false), instance.Configuration.GetOption("AccountsList", false) == null ? instance.AccountID.ToString() : instance.Configuration.GetOption("AccountsList", false));

            Invoke(_updateLogBox, new object[] { log });

            if (e.StateAfter == ServiceState.Ready)
            {
                instance.Start();
            }

            if (e.StateAfter == ServiceState.Ended)
            {
                //Update current running services counter
                //Invoke(_incCounter, new object[] { this._runnigServices, -1 });


                if (instance.Configuration.Options.ContainsKey("OnEnd") && (instance.Configuration.Options["OnEnd"].ToString().Equals("GetValidationResults")))
                {
                    //Get Validations Results
                    List <ValidationResult> newResults = DataChecksModelView.GetValidationResultsByInstance(instance);

                    //TO DO : Add results to validation results view.
                    if (newResults.Capacity > 0)
                    {
                        Invoke(_updateResults, new object[] { newResults });

                        //Invoke(_setButton, new object[]  { this.report_btn, true, true });
                    }
                    else
                    {
                        //Writing To PMS validation  log
                        Invoke(_updateLogBox, new object[] { "Validation results werent found in DB !!" });
                    }
                }
            }
        }
示例#4
0
        void LegacyInstance_StateChanged(object sender, Edge.Core.Services.ServiceStateChangedEventArgs e)
        {
            try
            {
                legacy.ServiceInstance instance = (Edge.Core.Services.ServiceInstance)sender;
                instance.OutcomeReported += new EventHandler(instance_OutcomeReported);

                this.Invoke(updateGridMethod, new Object[] { instance });


                this.Invoke(setLogMethod, new Object[] { string.Format("\n{0}: {1} is {2} {3}\r\n", instance.AccountID, instance.Configuration.Name, e.StateAfter, DateTime.Now.ToString("dd/MM/yy HH:mm")) });
                if (e.StateAfter == legacy.ServiceState.Ready)
                {
                    instance.Start();
                }
            }
            catch (Exception ex)
            {
                Edge.Core.Utilities.Log.Write("SchedulingControlForm", ex.Message, ex, Edge.Core.Utilities.LogMessageType.Error);
            }
        }
示例#5
0
        void instance_StateChanged(object sender, Edge.Core.Services.ServiceStateChangedEventArgs e)
        {
            Invoke(_updateProgressBar, new object[] { this.progressBar, 0, true });
            Invoke(_updateProgressBar, new object[] { this.progressBar, 60, true });

            Edge.Core.Services.ServiceInstance instance = (Edge.Core.Services.ServiceInstance)sender;

            string log = string.Format("State Changed : {0} - Account ID: {2} - Service Channel ID: {1} ", e.StateAfter, instance.Configuration.GetOption("ChannelList", false), instance.Configuration.GetOption("AccountsList", false) == null ? instance.AccountID.ToString() : instance.Configuration.GetOption("AccountsList", false));

            Invoke(_updateLogBox, new object[] { log });
            Invoke(_setLabelText, new object[] { ProgressBarTxt, string.Format("Account ID: {0}, Service Channel ID: {1}, State:{2}",
                                                                               instance.Configuration.GetOption("AccountsList", false) == null ? instance.AccountID.ToString() : instance.Configuration.GetOption("AccountsList", false),
                                                                               instance.Configuration.GetOption("ChannelList", false),
                                                                               e.StateAfter) });

            if (e.StateAfter == Edge.Core.Services.ServiceState.Ready)
            {
                instance.Start();
            }
            if (e.StateAfter == Edge.Core.Services.ServiceState.Ended)
            {
                Invoke(_updateProgressBar, new object[] { this.progressBar, 100, true });
            }
        }