Есть два случая, которые интересуют я сейчас:
Код: Выделить всё
[MyAttribute (typeof(MyClass)]
Код: Выделить всё
public MyAttribute (Type MyClassType)
{
System.Diagnostics.Debug.Assert(
typeof(MyInterface).IsAssignableFrom(MyClassType),
"Editor must implement interface: " + typeof(MyInterface).Name);
}
И.Е. if (MyClass.Implements(SomeInterface) && !Exists(SomeAttibute)) { Создать предупреждение
Код: Выделить всё
[MyAttribute(typeof(MyClass)]
// Comment next line to generate warning
[Foo ("Bar")]
Подробнее здесь: https://stackoverflow.com/questions/142 ... me-warning
Мобильная версия