calculatetest.cs
来自「应用AOP」· CS 代码 · 共 46 行
CS
46 行
//
// Write by Peopleyl 2007-04-13
//
using System;
using System.Data;
using Aspect.AopBase;
using Aspect.Exception;
namespace AspectTest
{
[ExceptionAttribute]
public class CalculateTest : AspectObject
{
[ExceptionAttribute("I Love You to")]
public string CalculateLog(int a)
{
//Thread.Sleep(5000);
throw new ArgumentOutOfRangeException();
return Convert.ToString(checked(a*a));
}
public object CalculateLog(int a,int b)
{
//Thread.Sleep(5000);
throw new ArgumentException();
return checked(a / b);
}
[ExceptionAttribute(123456789)]
public int CalculateLog(int a,int b,int c)
{
//Thread.Sleep(5000);
throw new ArithmeticException();
return checked(a+b+c);
}
public DataSet TestForDataSet(string tableName)
{
//Thread.Sleep(5000);
DataSet ds = new DataSet(tableName);
throw new ConstraintException();
return ds;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?