コード例 #1
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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
     };
 }
コード例 #2
0
ファイル: WakeableTimer.cs プロジェクト: 0xrofi/Cube.Core
 /* ----------------------------------------------------------------- */
 ///
 /// 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);
 }
コード例 #3
0
 public DisposableCore(Action src)
 {
     _dispose = new OnceAction(src);
 }
コード例 #4
0
 /* ----------------------------------------------------------------- */
 ///
 /// DisposableBase
 ///
 /// <summary>
 /// Creates a new instance of the DisposableBase class.
 /// </summary>
 ///
 /* ----------------------------------------------------------------- */
 protected DisposableBase()
 {
     _dispose = new OnceAction <bool>(Dispose);
 }
コード例 #5
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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);
 }
コード例 #6
0
ファイル: Disposable.cs プロジェクト: orf53975/Cube.Core
 /* ----------------------------------------------------------------- */
 ///
 /// 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);
 }
コード例 #7
0
ファイル: OnceInitializer.cs プロジェクト: orf53975/Cube.Core
 /* ----------------------------------------------------------------- */
 ///
 /// 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);
 }