|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ClassContract
{
public class Component : IComponent
{
#region IComponent Members
public IList<IComponent> DownstreamComponents { get; set; }
public bool IsUpgradable { get; set; }
public string Name { get; set; }
public string Downstreams { get; set; }
public virtual bool Start() { return true; }
public virtual bool Stop() { return true; }
public virtual bool DoBusiness(object obj = null)
{
Console.WriteLine("[{0}] DoBusiness, obj={1}", this.Name, obj);
OnAfterBusiness(obj);
return true;
}
protected virtual void OnAfterBusiness(object obj)
{
if (this.AfterBusiness != null)
{
this.AfterBusiness(this, new ComponentDataEventArgs(obj));
}
}
public virtual event EventHandler<ComponentDataEventArgs> AfterBusiness;
#endregion
}
}
|
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.
I started to programming in 2002, started when I was grade 2 in university, I participated some part-time projects at that time, I have much experiences on Windows, includes C#, ASP.NET, Visual Basic, Visual C++, AJAX, Power Shell Script, JavaScript, XML..etc, I am learning design and architect.