コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DelegateCommand" /> class.
 /// </summary>
 /// <param name="execute">The execute.</param>
 public DelegateCommand(Action execute)
 {
     execute.Guard("execute");
     this.execute = execute;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThreadedWorker" /> class.
 /// </summary>
 /// <param name="target">The target.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="apartmentState">State of the apartment.</param>
 /// <param name="isBackgroundThread"></param>
 public ThreadedWorker(Action target, ILogger logger, ApartmentState apartmentState = ApartmentState.MTA, bool isBackgroundThread = true)
     : base(logger, apartmentState, isBackgroundThread)
 {
     target.Guard("target");
     this.target = target;
 }
コード例 #3
0
ファイル: HotKey.cs プロジェクト: Melamew/iLynx.Common
 /// <summary>
 /// Registers the callback.
 /// </summary>
 /// <param name="callback">The callback.</param>
 public void RegisterCallback(Action callback)
 {
     callback.Guard("callback");
     callbacks.Remove(callback);
     callbacks.Add(callback);
 }