PlugIn

//***********************接口定义

using System;

namespace PlugIn

{
/// <summary></summary>
/// AppService 的摘要说明。
///
public interface IHandle

{
string Execute(string xml);
}
}

**************plugin调用*********

using IHandle;

public class Process
{

private IHandle handler;

#region Handle
try
{
string plugStr=null;
newcom=Repository.XmlDecode(this.requestCommand,"Command");
classname=Repository.XmlDecode(this.requestCommand,"ClassName");
xml=Repository.XmlInsertValue(xml,"Command",newcom);

Assembly ass = null;
//--------
string path=AppDomain.CurrentDomain.BaseDirectory+@"dll/handle/"+this.sysObject+".dll";
ass=Assembly.LoadFrom(path);
if(ass!=null)
{
handler=(AppService)ass.CreateInstance(classname);
//
plugStr= handler.Execute(xml);//实现方法
}
//---------

returnString=this.FormatResponse(xml,"0","",plugStr);
Repository.Log(sysUserName,newcom,ipAddress,sysObject,"success");
return returnString;
}
catch (Exception ex)
{
string errMessage=ex.Message;
return errMessage;
}
}
#endregion

}

你可能感兴趣的:(xml)