Interface that should be implemented to receive the result of any commands issued.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public interface ICommandListener
Public Interface ICommandListener
public interface class ICommandListener
Members
All Members | Methods | ||||
Icon | Member | Description |
---|---|---|
CommandError(ICommandResultEvent) |
Provides information about a command that hasn't been successfully completed.
| |
CommandSuccess(ICommandResultEvent) |
Provides information about a command being successfully completed.
|
Remarks
An implementation of this interface should be supplied to the Command methods on
the IStreamLinkProvider object.
Examples
CopyC#
using System; using System.Collections.Generic; using System.Text; using Caplin.StreamLink.Command; namespace StreamLinkExamples.Commands { /// <summary> /// Example implementation of ICommandListener /// </summary> public class ExampleCommandListener: ICommandListener { #region ICommandListener Members /// <summary> /// Called when a command has successfully executed. /// </summary> public void CommandSuccess(ICommandResultEvent ev) { Console.WriteLine("Received success for command " + ev.Type.ToString()); } /// <summary> /// Called when an error occured whilst executing the command. /// </summary> public void CommandError(ICommandResultEvent ev) { Console.WriteLine( "Received an error for command " + ev.Type.ToString() + " : " + ev.Result.ToString()); } #endregion } }