09 2016 档案

asp.net webform过滤器(注意我们可以在拦截请求的同时设置回调函数)
摘要:1.过滤器代码 public class PageFilter : IHttpModule { public String ModuleName { get { return "PageFilter"; } } public void Dispose() { } ... 阅读全文

posted @ 2016-09-30 11:45 听哥哥的话 阅读(1105) 评论(1) 推荐(2)

Spring.net页面属性注入
摘要:<object type="~/admin/Sys/SysDictTypeEdit.aspx"> <property name="Psvc" ref="SysDictTypeService"/> </object> <object id="SysDictTypeService" type="Bll. 阅读全文

posted @ 2016-09-30 00:01 听哥哥的话 阅读(260) 评论(0) 推荐(0)

Spring.net 表达式解析ExpressionEvaluator
摘要:1.类定义 public class Company { private string name; private Employee managingDirector; public string Name { get { return this.name; } se... 阅读全文

posted @ 2016-09-29 22:11 听哥哥的话 阅读(2100) 评论(0) 推荐(0)

Spring.net ObjectWrapper对象的包装(反射机制)有点明晰方便
摘要:Company c = new Company(); List ps = c.GetType().GetProperties().ToList(); var pname = ps.First(x => x.Name == "Name"); IObjectWrapper owComp = new Obj... 阅读全文

posted @ 2016-09-29 21:43 听哥哥的话 阅读(277) 评论(0) 推荐(0)

Spring.net 容器注入是替换(后处理器appConfigPropertyHolder)
摘要:1.定义节点 下面两个都定义为键值对 The IoC container Spring Framework (Version 1.3.2) 68 2.应用替换 第二种方法,spring环境变量模式 The IoC container Spring Framework (Version 1.3.2) 70 ... 阅读全文

posted @ 2016-09-29 17:02 听哥哥的话 阅读(292) 评论(0) 推荐(0)

Spring.net 后处理器 可用来切换实例
摘要:1.xml配置 2.代码 namespace CnblogLesson_4_7 { public class HexuObjectPostProcessor : IObjectPostProcessor { public object PostProcessAfterInitialization(object instance, s... 阅读全文

posted @ 2016-09-29 16:51 听哥哥的话 阅读(269) 评论(0) 推荐(0)

spring.net 继承
摘要:1. 2. public interface IPerson { void pr(); } public class Parent:IPerson { public void Initialize() { Console.WriteLine("init");... 阅读全文

posted @ 2016-09-29 13:44 听哥哥的话 阅读(150) 评论(0) 推荐(0)

Spring.net init-method destroy-method
摘要:[C#] public class ExampleObject {public void cleanup(){ // do some destruction work (such as closing any open connection (s))} public void Init() { // do some initialization work } } 这样spring创... 阅读全文

posted @ 2016-09-29 13:13 听哥哥的话 阅读(183) 评论(0) 推荐(0)

Spring.net方法的替换
摘要:1.为什么有时候你再执行某个方法的时候比如某个操作 a.权限验证 b.任务执行 当我执行到这个方法的时候,我可以先验证权限,如果验证不通过则替换到另一个方法去执行 public class MyValueCalculator { public virtual string ComputeValue(string input) { // ... some real code } // 2.... 阅读全文

posted @ 2016-09-29 11:53 听哥哥的话 阅读(285) 评论(0) 推荐(0)

1.spring.net Look-up Method 查找方法的注入(方法是抽象的需要spring.net注入)
摘要:1.为什么需要查找方法的注入 当Object依赖另一个生命周期不同的Object,尤其是当singleton依赖一个non-singleton时,常会遇到不少问题,Lookup Method Injection正是对付这些问题而出现的,在上述情况中,setter和构造注入都会导致singleton去维护一个non-singleton bean的单个实例,某些情况下,我们希望让singleton ... 阅读全文

posted @ 2016-09-29 11:44 听哥哥的话 阅读(263) 评论(0) 推荐(0)

spring.net事件的注入
摘要:1.c#代码 TestObject source = new TestObject(); TestEventHandler eventListener1 = new TestEventHandler(); TestEventHandler eventListener2 = new TestEventHandler(); source.Click += eventListener1.Handle... 阅读全文

posted @ 2016-09-29 11:20 听哥哥的话 阅读(185) 评论(0) 推荐(0)

框架草稿
摘要:136069244401586072156418359241319 阅读全文

posted @ 2016-09-15 16:39 听哥哥的话 阅读(140) 评论(0) 推荐(0)

EF配置文件初始化数据库 codefirst
摘要:1. using ConsoleApplication42; using System.Data.Entity; using System.Data.Entity.ModelConfiguration.Conventions; namespace ConsoleApplication42 { using System; using System.Collections.Gene... 阅读全文

posted @ 2016-09-13 07:42 听哥哥的话 阅读(448) 评论(0) 推荐(0)

NPOI读写Excel sheet操作
摘要:QueryInfo dataInfo = new QueryInfo(); dataInfo.CustomSQL = $@" select t1.name name,t1.url url from sys_menu t1 start with t1.parent... 阅读全文

posted @ 2016-09-07 18:06 听哥哥的话 阅读(967) 评论(0) 推荐(0)

.net 自定义AOP,透明代理与真实代理
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.Remoting.Messaging; using System.Runtime.Remoting.Activation; using System.Runtime.Remoting;... 阅读全文

posted @ 2016-09-04 13:32 听哥哥的话 阅读(1360) 评论(0) 推荐(0)

导航