/* ----------------------------------------------------------------- */ /// /// OnceQuery /// /// <summary> /// Initializes a new instance of the Query class with the /// specified arguments. /// </summary> /// /// <param name="callback">Callback function.</param> /// <param name="invoker">Invoker object.</param> /// /* ----------------------------------------------------------------- */ public OnceQuery(Action <QueryMessage <T, U> > callback, Invoker invoker) { _invoker = invoker; _callback = new OnceAction <QueryMessage <T, U> >(callback) { IgnoreTwice = false }; }
/* ----------------------------------------------------------------- */ /// /// WakeableTimer /// /// <summary> /// オブジェクトを初期化します。 /// </summary> /// /// <param name="interval">実行周期</param> /// /* ----------------------------------------------------------------- */ public WakeableTimer(TimeSpan interval) { _interval = interval; _dispose = new OnceAction <bool>(Dispose); _core.AutoReset = false; _core.Elapsed += WhenPublished; Power.ModeChanged += (s, e) => OnPowerModeChanged(e); }
public DisposableCore(Action src) { _dispose = new OnceAction(src); }
/* ----------------------------------------------------------------- */ /// /// DisposableBase /// /// <summary> /// Creates a new instance of the DisposableBase class. /// </summary> /// /* ----------------------------------------------------------------- */ protected DisposableBase() { _dispose = new OnceAction <bool>(Dispose); }
/* ----------------------------------------------------------------- */ /// /// DisposableOnceAction /// /// <summary> /// Initializes a new instance of the DisposableOnceAction /// with the specified actions. /// </summary> /// /// <param name="action">Action to be invoked.</param> /// <param name="dispose">Action to be invoked when disposing.</param> /// /* ----------------------------------------------------------------- */ public DisposableOnceAction(Action action, Action <bool> dispose) { _dispose = dispose; _action = new OnceAction(action); }
/* ----------------------------------------------------------------- */ /// /// AnonymousDisposable /// /// <summary> /// Initializes a new instance of the AnonymousDisposable class /// with the specified action. /// </summary> /// /// <param name="dispose">Invoke when disposed.</param> /// /* ----------------------------------------------------------------- */ public AnonymousDisposable(Action dispose) { _dispose = new OnceAction(dispose); }
/* ----------------------------------------------------------------- */ /// /// OnceInitializer /// /// <summary> /// Initializes a new instance of the <c>OnceInitializer</c> /// with the specified actions. /// </summary> /// /// <param name="initialize"> /// Action when the Invoke method is invoked. /// </param> /// /// <param name="dispose"> /// Action when the Dispose method is invoked. /// </param> /// /* ----------------------------------------------------------------- */ public OnceInitializer(Action initialize, Action dispose) { _initializer = new OnceAction(initialize); _disposer = new OnceAction(dispose); }