13 Mart 2018 Salı

Conditional Anotasyonu

Giriş
Açıklaması şöyle
A call to a conditional method is included if one or more of its associated conditional compilation symbols is defined at the point of call, otherwise the call is omitted. (§22.5.3)
Örnek
Şöyle yaparız
public class B {
  [System.Diagnostics.Conditional("DEBUG")]
  public void Hello() {
    Console.WriteLine("Hello");
  }
}

Hiç yorum yok:

Yorum Gönder