SharpLibEar/Action.cs
author StephaneLenclud
Thu, 18 Aug 2016 14:35:50 +0200
changeset 238 c92587ddabcd
parent 231 4c706feaf706
child 239 dd7770b97916
permissions -rw-r--r--
Support for launch action and WMC HID events.
StephaneLenclud@210
     1
//
StephaneLenclud@210
     2
StephaneLenclud@210
     3
StephaneLenclud@210
     4
using System;
Stephane@212
     5
using System.Collections.Generic;
StephaneLenclud@210
     6
using System.Runtime.Serialization;
StephaneLenclud@210
     7
using System.Threading;
StephaneLenclud@210
     8
StephaneLenclud@210
     9
namespace SharpLib.Ear
StephaneLenclud@210
    10
{
StephaneLenclud@210
    11
    [DataContract]
StephaneLenclud@238
    12
    public abstract class Action: Object
StephaneLenclud@210
    13
    {
StephaneLenclud@228
    14
        protected abstract void DoExecute();
StephaneLenclud@223
    15
StephaneLenclud@231
    16
        /// <summary>
StephaneLenclud@231
    17
        /// Allows testing from generic edit dialog.
StephaneLenclud@231
    18
        /// </summary>
StephaneLenclud@231
    19
        public void Test()
StephaneLenclud@231
    20
        {
StephaneLenclud@231
    21
            Console.WriteLine("Action test");
StephaneLenclud@231
    22
            Execute();
StephaneLenclud@231
    23
        }
StephaneLenclud@231
    24
StephaneLenclud@223
    25
        public void Execute()
StephaneLenclud@223
    26
        {
StephaneLenclud@229
    27
            Console.WriteLine("Action executing: " + Brief());
StephaneLenclud@223
    28
            DoExecute();
StephaneLenclud@223
    29
        }
StephaneLenclud@210
    30
StephaneLenclud@210
    31
    }
StephaneLenclud@210
    32
StephaneLenclud@210
    33
StephaneLenclud@210
    34
}