123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- using Update.Core.Events;
- namespace Update.Core
- {
- partial class Updater
- {
-
- private static readonly object EVENT_ERROR = new object();
-
-
-
- public event ErrorEventHandler Error
- {
- add
- {
- this.Events.AddHandler(EVENT_ERROR, value);
- }
- remove
- {
- this.Events.RemoveHandler(EVENT_ERROR, value);
- }
- }
-
-
-
-
- protected virtual void OnError(ErrorEventArgs e)
- {
- ErrorEventHandler handler = this.Events[EVENT_ERROR] as ErrorEventHandler;
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object EVENT_NOTIFY = new object();
-
-
-
- public event NotifyEventHandler Notify
- {
- add
- {
- this.Events.AddHandler(EVENT_NOTIFY, value);
- }
- remove
- {
- this.Events.RemoveHandler(EVENT_NOTIFY, value);
- }
- }
-
-
-
-
- protected virtual void OnNotify(NotifyEventArgs e)
- {
- NotifyEventHandler handler = this.Events[EVENT_NOTIFY] as NotifyEventHandler;
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object EVENT_PROGRESS = new object();
-
-
-
- public event ProgressEventHandler Progress
- {
- add
- {
- this.Events.AddHandler(EVENT_PROGRESS, value);
- }
- remove
- {
- this.Events.RemoveHandler(EVENT_PROGRESS, value);
- }
- }
-
-
-
-
- protected virtual void OnProgress(ProgressEventArgs e)
- {
- ProgressEventHandler handler = this.Events[EVENT_PROGRESS] as ProgressEventHandler;
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object EVENT_CHECK_STARTED = new object();
-
-
-
- public event CheckStartedEventHandler CheckStarted
- {
- add
- {
- this.Events.AddHandler(EVENT_CHECK_STARTED, value);
- }
- remove
- {
- this.Events.RemoveHandler(EVENT_CHECK_STARTED, value);
- }
- }
-
-
-
-
- protected virtual void OnCheckStarted(CheckStartedEventArgs e)
- {
- CheckStartedEventHandler handler = this.Events[EVENT_CHECK_STARTED] as CheckStartedEventHandler;
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object EVENT_CHECK_COMPLETED = new object();
-
-
-
- public event CheckCompletedEventHandler CheckCompleted
- {
- add
- {
- this.Events.AddHandler(EVENT_CHECK_COMPLETED, value);
- }
- remove
- {
- this.Events.RemoveHandler(EVENT_CHECK_COMPLETED, value);
- }
- }
-
-
-
-
- protected virtual void OnCheckCompleted(CheckCompletedEventArgs e)
- {
- CheckCompletedEventHandler handler = this.Events[EVENT_CHECK_COMPLETED] as CheckCompletedEventHandler;
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object EVENT_UPDATE_STARTED = new object();
-
-
-
- public event UpdateStartedEventHandler UpdateStarted
- {
- add
- {
- this.Events.AddHandler(EVENT_UPDATE_STARTED, value);
- }
- remove
- {
- this.Events.RemoveHandler(EVENT_UPDATE_STARTED, value);
- }
- }
-
-
-
-
- protected virtual void OnUpdateStarted(UpdateStartedEventArgs e)
- {
- UpdateStartedEventHandler handler = this.Events[EVENT_UPDATE_STARTED] as UpdateStartedEventHandler;
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object EVENT_UPDATE_COMPLETED = new object();
-
-
-
- public event UpdateCompletedEventHandler UpdateCompleted
- {
- add
- {
- this.Events.AddHandler(EVENT_UPDATE_COMPLETED, value);
- }
- remove
- {
- this.Events.RemoveHandler(EVENT_UPDATE_COMPLETED, value);
- }
- }
-
-
-
-
- protected virtual void OnUpdateCompleted(UpdateCompletedEventArgs e)
- {
- UpdateCompletedEventHandler handler = this.Events[EVENT_UPDATE_COMPLETED] as UpdateCompletedEventHandler;
- if (handler != null)
- handler(this, e);
- }
- }
- }
|