当前位置: 首页>>代码示例>>C#>>正文


C# NHExt类代码示例

本文整理汇总了C#中NHExt的典型用法代码示例。如果您正苦于以下问题:C# NHExt类的具体用法?C# NHExt怎么用?C# NHExt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NHExt类属于命名空间,在下文中一共展示了NHExt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BeforeInvokeProxy

        protected override void BeforeInvokeProxy(NHExt.Runtime.Proxy.AgentInvoker invoker, NHExt.Runtime.Web.HttpHandler.DirectRequest req, HttpContext ctx)
        {
            base.BeforeInvokeProxy(invoker, req, ctx);
            NHExt.Runtime.Auth.AuthContext authCtx = NHExt.Runtime.Auth.AuthContext.GetInstance();
            Type authType = authCtx.GetType();

            NHExt.Runtime.GAIA.HttpHandler.DirectRequest reqExtend = req as NHExt.Runtime.GAIA.HttpHandler.DirectRequest;

            foreach (JToken token in reqExtend.Auth)
            {
                JProperty jp = token as JProperty;
                PropertyInfo pi = authType.GetProperty(jp.Name);
                if (token.Type != JTokenType.Null && pi != null)
                {
                    //调用序列化函数,序列化json对象
                    var desObj = NHExt.Runtime.Serialize.JsonSerialize.DeSerialize(jp.Value, pi.PropertyType);
                    pi.SetValue(authCtx, desObj, null);
                }
            }
            if (!NHExt.Runtime.Auth.AuthContext.IsAuthenticated(ctx))
            {
                authCtx.ValidateAuth();
            }

        }
开发者ID:zhouweigang01,项目名称:NHExt.Runtime,代码行数:25,代码来源:WCFHandler.cs

示例2: ValidateDirectParameter

 protected override void ValidateDirectParameter(NHExt.Runtime.Web.HttpHandler.DirectRequest req)
 {
     base.ValidateDirectParameter(req);
     if (string.IsNullOrEmpty(req.SourcePage))
     {
         throw new NHExt.Runtime.Exceptions.RuntimeException(req.Action + "服务调用失败,错误信息:来源页面不能为空");
     }
 }
开发者ID:zhouweigang01,项目名称:NHExt.Runtime,代码行数:8,代码来源:JsonHandler.cs

示例3: ProxyContext

 public ProxyContext(NHExt.Runtime.Auth.AuthContext ctx)
     : this()
 {
     if (ctx != null)
     {
         this.AuthContext = ctx.ToString();
     }
 }
开发者ID:zhouweigang01,项目名称:NHExt.Runtime,代码行数:8,代码来源:ProxyContext.cs

示例4: CreateDirectParameterExtend

 protected override void CreateDirectParameterExtend(NHExt.Runtime.Web.HttpHandler.DirectRequest req, NameValueCollection coll)
 {
     string strAuth = coll["Auth"];
     JToken jToken = JToken.Parse(strAuth);
     foreach (JToken t in jToken.Children())
     {
         req.Auth.Add(t);
     }
 }
开发者ID:zhouweigang01,项目名称:NHExt.Runtime,代码行数:9,代码来源:WCFHandler.cs

示例5: EvictEntity

 public void EvictEntity(NHExt.Runtime.Model.BaseEntity be)
 {
     if (be.EntityState == Enums.EntityState.UnKnow || be.EntityState == Enums.EntityState.UnChanged)
     {
         return;
     }
     lock (this.Factory)
     {
         this.Factory.EvictEntity(be.EntityName, be.ID);
         NHExt.Runtime.Logger.LoggerHelper.Debug("清除实体缓存,实体" + be.EntityName + ",ID" + be.ID, NHExt.Runtime.Logger.LoggerInstance.RuntimeLogger);
     }
 }
开发者ID:zhouweigang01,项目名称:NHExt.Runtime,代码行数:12,代码来源:SecondCache.cs

示例6: EvictCollection

 public void EvictCollection(NHExt.Runtime.Model.BaseEntity be)
 {
     NHibernate.Persister.Collection.OneToManyPersister persister = this.getParentEntityMetaData(be) as NHibernate.Persister.Collection.OneToManyPersister;
     if (persister != null)
     {
         lock (this.Factory)
         {
             if (persister != null)
             {
                 long entityKey = be.GetParentKey(persister.OwnerEntityName);
                 this.Factory.EvictCollection(persister.Role, entityKey);
                 NHExt.Runtime.Logger.LoggerHelper.Debug("清除聚合字段属性缓存,实体类型:" + persister.OwnerEntityName + ",实体KEY:" + entityKey, NHExt.Runtime.Logger.LoggerInstance.RuntimeLogger);
             }
         }
     }
 }
开发者ID:zhouweigang01,项目名称:NHExt.Runtime,代码行数:16,代码来源:SecondCache.cs

示例7: getParentEntityMetaData

 private NHibernate.Metadata.ICollectionMetadata getParentEntityMetaData(NHExt.Runtime.Model.BaseEntity be)
 {
     if (SecondCache.MetadataCollection == null)
     {
         lock (this.Factory)
         {
             // 初始化二级缓存对象
             SecondCache.MetadataCollection = this.Factory.GetAllCollectionMetadata();
         }
     }
     foreach (System.Collections.Generic.KeyValuePair<string, NHibernate.Metadata.ICollectionMetadata> kvp in SecondCache.MetadataCollection)
     {
         if (kvp.Value.ElementType.Name == be.EntityName)
         {
             return kvp.Value;
         }
     }
     return null;
 }
开发者ID:zhouweigang01,项目名称:NHExt.Runtime,代码行数:19,代码来源:SecondCache.cs

示例8: 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;
 }
开发者ID:AllanHao,项目名称:WebSystem,代码行数:21,代码来源:DeleteCounselorBP.cs

示例9: InitParameter

 protected override void InitParameter(NHExt.Runtime.Proxy.ProxyContext ctx)
 {
     base.InitParameter(ctx);
     if(ctx != null){
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._AttrubuteList = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<List<string >>(ctx.ParamList[0].ToString());
     ctx.ParamList[0] = this._AttrubuteList;
     }
     else{
     if(ctx.ParamList.Count > 0){
     this._AttrubuteList = (List<string >)ctx.ParamList[0];
      }else{
     ctx.ParamList.Add(this._AttrubuteList);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._SearchTxt = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<string >(ctx.ParamList[1].ToString());
     ctx.ParamList[1] = this._SearchTxt;
     }
     else{
     if(ctx.ParamList.Count > 1){
     this._SearchTxt = (string )ctx.ParamList[1];
     }else{
     ctx.ParamList.Add(this._SearchTxt);
     }
     }
     }
 }
开发者ID:zhouweigang01,项目名称:Study,代码行数:28,代码来源:SearchDeviceListBP.cs

示例10: InitParameter

 protected override void InitParameter(NHExt.Runtime.Proxy.ProxyContext ctx)
 {
     base.InitParameter(ctx);
     if(ctx != null){
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._Code = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<string >(ctx.ParamList[0].ToString());
     ctx.ParamList[0] = this._Code;
     }
     else{
     if(ctx.ParamList.Count > 0){
     this._Code = (string )ctx.ParamList[0];
     }else{
     ctx.ParamList.Add(this._Code);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._Password = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<string >(ctx.ParamList[1].ToString());
     ctx.ParamList[1] = this._Password;
     }
     else{
     if(ctx.ParamList.Count > 1){
     this._Password = (string )ctx.ParamList[1];
     }else{
     ctx.ParamList.Add(this._Password);
     }
     }
     }
 }
开发者ID:zhouweigang01,项目名称:Study,代码行数:28,代码来源:ValidateUserBP.cs

示例11: InitParameter

 protected override void InitParameter(NHExt.Runtime.Proxy.ProxyContext ctx)
 {
     base.InitParameter(ctx);
     if(ctx != null){
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._pageSize = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<int >(ctx.ParamList[0].ToString());
     ctx.ParamList[0] = this._pageSize;
     }
     else{
     if(ctx.ParamList.Count > 0){
     this._pageSize = (int )ctx.ParamList[0];
     }else{
     ctx.ParamList.Add(this._pageSize);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._pageIndex = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<int >(ctx.ParamList[1].ToString());
     ctx.ParamList[1] = this._pageIndex;
     }
     else{
     if(ctx.ParamList.Count > 1){
     this._pageIndex = (int )ctx.ParamList[1];
     }else{
     ctx.ParamList.Add(this._pageIndex);
     }
     }
     }
 }
开发者ID:AllanHao,项目名称:WebSystem,代码行数:28,代码来源:GetPreApplyStudentBP.cs

示例12: InitParameter

 protected override void InitParameter(NHExt.Runtime.Proxy.ProxyContext ctx)
 {
     base.InitParameter(ctx);
     if(ctx != null){
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._FileName = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<string >(ctx.ParamList[0].ToString());
     ctx.ParamList[0] = this._FileName;
     }
     else{
     if(ctx.ParamList.Count > 0){
     this._FileName = (string )ctx.ParamList[0];
     }else{
     ctx.ParamList.Add(this._FileName);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._HandleDate = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<DateTime >(ctx.ParamList[1].ToString());
     ctx.ParamList[1] = this._HandleDate;
     }
     else{
     if(ctx.ParamList.Count > 1){
     this._HandleDate = (DateTime )ctx.ParamList[1];
     }else{
     ctx.ParamList.Add(this._HandleDate);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._StartDate = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<DateTime >(ctx.ParamList[2].ToString());
     ctx.ParamList[2] = this._StartDate;
     }
     else{
     if(ctx.ParamList.Count > 2){
     this._StartDate = (DateTime )ctx.ParamList[2];
     }else{
     ctx.ParamList.Add(this._StartDate);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._EndDate = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<DateTime >(ctx.ParamList[3].ToString());
     ctx.ParamList[3] = this._EndDate;
     }
     else{
     if(ctx.ParamList.Count > 3){
     this._EndDate = (DateTime )ctx.ParamList[3];
     }else{
     ctx.ParamList.Add(this._EndDate);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._ExportType = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<int >(ctx.ParamList[4].ToString());
     ctx.ParamList[4] = this._ExportType;
     }
     else{
     if(ctx.ParamList.Count > 4){
     this._ExportType = (int )ctx.ParamList[4];
     }else{
     ctx.ParamList.Add(this._ExportType);
     }
     }
     }
 }
开发者ID:AllanHao,项目名称:WebSystem,代码行数:61,代码来源:ExportHandleExcelBP.cs

示例13: InitParameter

 protected override void InitParameter(NHExt.Runtime.Proxy.ProxyContext ctx)
 {
     base.InitParameter(ctx);
     if(ctx != null){
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._Year = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<int >(ctx.ParamList[0].ToString());
     ctx.ParamList[0] = this._Year;
     }
     else{
     if(ctx.ParamList.Count > 0){
     this._Year = (int )ctx.ParamList[0];
     }else{
     ctx.ParamList.Add(this._Year);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._Month = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<int >(ctx.ParamList[1].ToString());
     ctx.ParamList[1] = this._Month;
     }
     else{
     if(ctx.ParamList.Count > 1){
     this._Month = (int )ctx.ParamList[1];
     }else{
     ctx.ParamList.Add(this._Month);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._IsAppoint = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<bool >(ctx.ParamList[2].ToString());
     ctx.ParamList[2] = this._IsAppoint;
     }
     else{
     if(ctx.ParamList.Count > 2){
     this._IsAppoint = (bool )ctx.ParamList[2];
     }else{
     ctx.ParamList.Add(this._IsAppoint);
     }
     }
     }
 }
开发者ID:zhouweigang01,项目名称:Study,代码行数:39,代码来源:LoadDeviceUseDiagramBP.cs

示例14: InitParameter

 protected override void InitParameter(NHExt.Runtime.Proxy.ProxyContext ctx)
 {
     base.InitParameter(ctx);
     if(ctx != null){
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._ID = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<long >(ctx.ParamList[0].ToString());
     ctx.ParamList[0] = this._ID;
     }
     else{
     if(ctx.ParamList.Count > 0){
     this._ID = (long )ctx.ParamList[0];
     }else{
     ctx.ParamList.Add(this._ID);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._Fee = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<decimal >(ctx.ParamList[1].ToString());
     ctx.ParamList[1] = this._Fee;
     }
     else{
     if(ctx.ParamList.Count > 1){
     this._Fee = (decimal )ctx.ParamList[1];
     }else{
     ctx.ParamList.Add(this._Fee);
     }
     }
     if(this.CallerType == NHExt.Runtime.Session.CallerTypeEnum.WCF){
     this._Memo = NHExt.Runtime.Serialize.XmlSerialize.DeSerialize<string >(ctx.ParamList[2].ToString());
     ctx.ParamList[2] = this._Memo;
     }
     else{
     if(ctx.ParamList.Count > 2){
     this._Memo = (string )ctx.ParamList[2];
     }else{
     ctx.ParamList.Add(this._Memo);
     }
     }
     }
 }
开发者ID:zhouweigang01,项目名称:Study,代码行数:39,代码来源:RepairCompleteBP.cs

示例15: CreateAgentParameterExtend

 protected override void CreateAgentParameterExtend(Model.IBizAgent agent, NHExt.Runtime.Web.HttpHandler.DirectRequest dr)
 {
     base.CreateAgentParameterExtend(agent, dr);
     agent.SourcePage = dr.SourcePage;
 }
开发者ID:zhouweigang01,项目名称:NHExt.Runtime,代码行数:5,代码来源:JsonHandler.cs


注:本文中的NHExt类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。