|
//
// PlugOne
//
// sample splugin containing two classes implementing 'IPlugInterface'
//
using System;
using MultiPlug.PlugInterface;
namespace MultiPlug.PlugOne
{
public class FirstClass : MarshalByRefObject, IPlugInterface
{
public FirstClass( string initString )
{
baseText = "FirstClass: " + initString;
}
public void Dispose()
{}
public string ModifyString( string inpString )
{
return baseText + " @ " + inpString;
}
public string CurrentText
{
get { return baseText; }
set { baseText = value; }
}
public bool StartThread( IPlugEvent eventCallback )
{ throw new NotSupportedException( "MultiPlug.PlugOne.FirstClass doesn't support events!" ); }
public void StopThread()
{ throw new NotSupportedException( "MultiPlug.PlugOne.FirstClass doesn't support events!" ); }
private string baseText;
}
// -------------------------------------------------------------------------------------
// ICustomInterface is a custom interface strictly for internal use only in this plugin
internal interface ICustomInterface
{
void CustomMethod( string anyString );
}
/// <summary> SecondClass is a plugin also implementing a custom interface besides IPlugInterface. </summary>
public class SecondClass : MarshalByRefObject, IPlugInterface, ICustomInterface
{
public SecondClass( string initString )
{
baseText = "SecondClass: " + initString;
}
public void Dispose()
{}
public string ModifyString( string inpString )
{
return baseText + " @ " + inpString;
}
public string CurrentText
{
get { return baseText; }
set { baseText = value; }
}
public bool StartThread( IPlugEvent eventCallback )
{ throw new NotSupportedException( "MultiPlug.PlugOne.SecondClass doesn't support events!" ); }
public void StopThread()
{ throw new NotSupportedException( "MultiPlug.PlugOne.SecondClass doesn't support events!" ); }
void ICustomInterface.CustomMethod( string anyString )
{
baseText = anyString;
}
private string baseText;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.