예제 #1
0
        void LegacyInstance_ChildServiceRequested(object sender, Edge.Core.Services.ServiceRequestedEventArgs e)
        {
            legacy.ServiceInstance instance = (legacy.ServiceInstance)sender;

            e.RequestedService.ChildServiceRequested += new EventHandler <legacy.ServiceRequestedEventArgs>(LegacyInstance_ChildServiceRequested);
            e.RequestedService.StateChanged          += new EventHandler <legacy.ServiceStateChangedEventArgs>(LegacyInstance_StateChanged);
            e.RequestedService.OutcomeReported       += new EventHandler(LegacyInstance_OutcomeReported);

            try { e.RequestedService.Initialize(); }
            catch (Exception ex)
            {
                string msg = String.Format("{1}: Failed to initialize child service {0}", instance.Configuration.Name, instance.AccountID);
                LogText(msg);
                Log.Write(Program.LS, msg, ex);
            }
        }
예제 #2
0
        void LegacyInstance_ChildServiceRequested(object sender, Edge.Core.Services.ServiceRequestedEventArgs e)
        {
            try
            {
                legacy.ServiceInstance instance = (legacy.ServiceInstance)sender;

                this.Invoke(setLogMethod, new Object[] { string.Format("\nChild Service: {0} requestedd {1}\r\n", e.RequestedService.Configuration.Name, DateTime.Now.ToString("dd/MM/yy HH:mm")) });

                e.RequestedService.ChildServiceRequested += new EventHandler <legacy.ServiceRequestedEventArgs>(LegacyInstance_ChildServiceRequested);
                e.RequestedService.StateChanged          += new EventHandler <legacy.ServiceStateChangedEventArgs>(LegacyInstance_StateChanged);
                e.RequestedService.Initialize();
            }
            catch (Exception ex)
            {
                Edge.Core.Utilities.Log.Write("SchedulingControlForm", ex.Message, ex, Edge.Core.Utilities.LogMessageType.Error);
            }
        }