惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
S
SegmentFault 最新的问题
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
U
Unit 42
GbyAI
GbyAI
B
Blog RSS Feed
博客园 - Franky
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - Martin XJ

windows2000 蓝色背景 楚留香mv2 楚留香mv cyberarticle Castle.Facilities.WebserviceIntegration Castle Windsor Wcf Facility的配置及调用IChannel的Close - Martin XJ SharpRush中的跨函数事务实现 - Martin XJ - 博客园 自己的ORMapping starcraft2 Spring.net的一个小例子 EnterpriseLibrary 数据访问组件windows98不能使用 使用EnterpriseLibrary碰到的问题 好久都没写blog了 MS推荐的命名指南 Sybase DataWindow.net 1.5(Beta) For .Net 发布 IEWebcontrol webctrl_client目录配置 CodeSmith使用心得 mywallop、orkut、gmail的邀请 无法打开Web项目
SharpRush中的AOP实现
Martin XJ · 2005-08-16 · via 博客园 - Martin XJ

//aspect code:
    [AttributeUsage(AttributeTargets.Class)]
 
public class SecurityAspectAttribute:AOPAttribute
 
{
  
public SecurityAspectAttribute()
  
{
  }


  
public override void PreProcess(System.Runtime.Remoting.Messaging.IMessage msg)
  
{
   System.Windows.Forms.MessageBox.Show(
"pre");
  }


  
public override void PostProcess(System.Runtime.Remoting.Messaging.IMessage msg)
  
{
   System.Windows.Forms.MessageBox.Show(
"post");
  }

 }

 
 
//client code:
 [SecurityAspect]
 
public class Class1:AOPObject
 
{
  
public Class1()
  
{
  }


  
public void test()
  
{
   System.Windows.Forms.MessageBox.Show(
"test");
  }

 }

posted @ 2005-08-16 16:13  Martin XJ  阅读(871)  评论(0)    收藏  举报