/// <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); } }
protected virtual void OnStarting(RadServiceStartingEventArgs e) { EventHandler <RadServiceStartingEventArgs> eventHandler = this.Events[RadService.StartingEventKey] as EventHandler <RadServiceStartingEventArgs>; if (eventHandler == null) { return; } eventHandler((object)this, e); }
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(); }