Пример #1
0
        /// <summary>
        /// Notifies that a start request has occured. Cancelable.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnStarting(RadServiceStartingEventArgs e)
        {
            EventHandler <RadServiceStartingEventArgs> eh = this.Events[StartingEventKey] as EventHandler <RadServiceStartingEventArgs>;

            if (eh != null)
            {
                eh(this, e);
            }
        }
Пример #2
0
        protected virtual void OnStarting(RadServiceStartingEventArgs e)
        {
            EventHandler <RadServiceStartingEventArgs> eventHandler = this.Events[RadService.StartingEventKey] as EventHandler <RadServiceStartingEventArgs>;

            if (eventHandler == null)
            {
                return;
            }
            eventHandler((object)this, e);
        }
Пример #3
0
        public void Start(object context)
        {
            if (!this.CanStart(context))
            {
                return;
            }
            RadServiceStartingEventArgs e = new RadServiceStartingEventArgs(context);

            this.OnStarting(e);
            if (e.Cancel)
            {
                return;
            }
            this.SetContext(context);
            this.state = RadServiceState.Working;
            this.PerformStart();
            this.OnStarted();
        }