本文整理汇总了C#中NHExt.Runtime.Session.CallerTypeEnum类的典型用法代码示例。如果您正苦于以下问题:C# NHExt.Runtime.Session.CallerTypeEnum类的具体用法?C# NHExt.Runtime.Session.CallerTypeEnum怎么用?C# NHExt.Runtime.Session.CallerTypeEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NHExt.Runtime.Session.CallerTypeEnum类属于命名空间,在下文中一共展示了NHExt.Runtime.Session.CallerTypeEnum类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoTask
internal void DoTask(bool autoRun = false)
{
this._callerType = NHExt.Runtime.Session.CallerTypeEnum.Reflect;
NHExt.Runtime.Proxy.ProxyContext ctx = new NHExt.Runtime.Proxy.ProxyContext();
ctx.ProxyGuid = this._guid;
NHExt.Runtime.Logger.LoggerInstance.RuntimeLogger.Info("系统调度任务,使用线程调度服务");
NHExt.Runtime.Proxy.TaskThreadPool.ThreadPool.AddThreadItem((state) =>
{
NHExt.Runtime.Proxy.ProxyContext pCtx = state as NHExt.Runtime.Proxy.ProxyContext;
this.DoCommon(pCtx);
}, ctx , autoRun);
}
示例2: DoWCF
public override NHExt.Runtime.Model.WCFCallDTO DoWCF(NHExt.Runtime.Proxy.ProxyContext ctx)
{
string xml = string.Empty;
NHExt.Runtime.Model.WCFCallDTO callDTO = new NHExt.Runtime.Model.WCFCallDTO();
try
{
this._callerType = NHExt.Runtime.Session.CallerTypeEnum.WCF;
var obj = this.TypeConvert(this.DoCommon(ctx));
if (obj != null) {
xml = NHExt.Runtime.Serialize.XmlSerialize.Serialize(obj);
}else{
xml = string.Empty;
}
callDTO.Success = true;
}
catch(Exception ex){
xml = ex.Message;
}
callDTO.Result = xml;
return callDTO;
}
示例3: Do
public override object Do(NHExt.Runtime.Proxy.ProxyContext ctx)
{
this._callerType = NHExt.Runtime.Session.CallerTypeEnum.Reflect;
var obj = this.TypeConvert(this.DoCommon(ctx));
return obj;
}
示例4: ProxyInvoker
public ProxyInvoker()
{
this.CallerType = Session.CallerTypeEnum.None;
this.ParamList = new List<object>();
}
示例5: Do
public virtual object Do()
{
NHExt.Runtime.Logger.LoggerHelper.Info("开始创建服务工厂");
AbstractInvoker invoker = InvokerFactory.BuildInvoker(this);
NHExt.Runtime.Logger.LoggerHelper.Info("创建服务工厂完成");
ProxyContext ctx = new ProxyContext(this.Ctx);
//如果缓存中没有存来源单据页面的话则需要重bpproxy里面去取
NHExt.Runtime.Logger.LoggerHelper.Info("开始调用服务");
this.CallerType = invoker.CallerType;
ctx.ProxyGuid = this.Guid;
if (string.IsNullOrEmpty(this.Ctx.RemoteIP))
{
ctx.RemoteIP = this.RemoteIP;
}
if (string.IsNullOrEmpty(this.Ctx.SourcePage))
{
ctx.SourcePage = this.SourcePage;
}
//反射调用的话直接赋值就好了
if (invoker is ReflectInvoker)
{
ctx.ParamList = this.ParamList;
}
else
{//远程调用的话因为涉及到WCF序列化所以先要在本地将对象序列化成xml
if (ctx.ParamList == null)
{
ctx.ParamList = new List<object>();
}
foreach (object obj in this.ParamList)
{
ctx.ParamList.Add(NHExt.Runtime.Serialize.XmlSerialize.Serialize(obj));
}
//调用远程WCF的话必须进行数据权限过滤
ctx.IsDataAuth = true;
}
invoker.Ctx = ctx;
invoker.Ctx.UseReadDB = this.UseReadDB;
//只有第一层服务才能够用线程来解决
if (this.IsTask)
{
NHExt.Runtime.Logger.LoggerHelper.Info("系统调度任务,使用线程调度服务");
NHExt.Runtime.Proxy.TaskThreadPool.ThreadPool.AddThreadItem((state) =>
{
AbstractInvoker invokerObj = state as AbstractInvoker;
invokerObj.InvokeProxy();
}, invoker, this.AutoRun);
return null;
}
else
{
object obj = invoker.InvokeProxy();
NHExt.Runtime.Logger.LoggerHelper.Info("调用服务成功");
return obj;
}
}