我在想如果一个条件方法可以在类属性上有他的条件。 例如: class Class1
{
public bool _doStuff;
[Conditional(_doStuff)]
public static void Stuff() {
// Do the stuff
}
}
像[Conditonal("DEBUG")]。 有人知道吗?
我有一个名为国防部使用静态函数调用的地图静态类: public static class Mod<TModel>
{
public static string Map<TValue>(Expression<Func<TModel, TValue>> expression)
{
throw new Exception("Not implemented");
新手PostSharp时失踪。考虑以下代码: using System;
using PostSharp.Aspects;
namespace PostSharp1 {
[AttributeUsage(AttributeTargets.Property)][Serializable]public class Field1Attribute : System.Attribute {