init
This commit is contained in:
58
DataPRO/ICommand/ICommand.cs
Normal file
58
DataPRO/ICommand/ICommand.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DTS.DASLib.Command
|
||||
{
|
||||
public enum CommandStatus
|
||||
{
|
||||
Success,
|
||||
Failure,
|
||||
Canceled
|
||||
}
|
||||
|
||||
public enum CommandErrorReason
|
||||
{
|
||||
SendFailed,
|
||||
ReceiveFailed,
|
||||
InvalidMode,
|
||||
Canceled
|
||||
}
|
||||
|
||||
public class CommandException : ApplicationException
|
||||
{
|
||||
public CommandErrorReason Error { get; set; }
|
||||
|
||||
public CommandException(CommandErrorReason _err)
|
||||
{
|
||||
Error = _err;
|
||||
}
|
||||
|
||||
public CommandException(CommandErrorReason _err, string msg)
|
||||
: base(msg)
|
||||
{
|
||||
Error = _err;
|
||||
}
|
||||
}
|
||||
|
||||
public enum CommandReceiveAction
|
||||
{
|
||||
StopReceiving,
|
||||
ContinueReceiving
|
||||
}
|
||||
|
||||
public interface ICommandReport
|
||||
{
|
||||
object CallbackObject { get; set; }
|
||||
CommandStatus Status { get; set; }
|
||||
}
|
||||
|
||||
public delegate CommandReceiveAction CommandCallback(ICommandReport report);
|
||||
|
||||
public interface ICommand
|
||||
{
|
||||
void Execute(CommandCallback Callback,
|
||||
object CallbackObject);
|
||||
void SyncExecute();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user