Özel montaj niteliklerini tanımlayıp tanımlayamayacağımı bilmek istiyorum. Mevcut özellikler şu şekilde tanımlanmıştır:Özel Montaj Özellikleri
[assembly: MyCustomAssemblyAttribute("Hello World! This is a custom attribute.")]
Özel montaj niteliklerini tanımlayıp tanımlayamayacağımı bilmek istiyorum. Mevcut özellikler şu şekilde tanımlanmıştır:Özel Montaj Özellikleri
[assembly: MyCustomAssemblyAttribute("Hello World! This is a custom attribute.")]
Evet yapabilirsiniz:
[assembly: AssemblyTitle("MyApplication")]
[assembly: AssemblyDescription("This application is a sample application.")]
[assembly: AssemblyCopyright("Copyright © MyCompany 2009")]
ben aşağıdakileri yapabilirsiniz bir yolu var mı. Biz böyle bir şey yaparız.
[AttributeUsage(AttributeTargets.Assembly)]
public class MyCustomAttribute : Attribute {
string someText;
public MyCustomAttribute() : this(string.Empty) {}
public MyCustomAttribute(string txt) { someText = txt; }
...
}
Bu tür linq stmt dosyasını okumak için.
var attributes = assembly
.GetCustomAttributes(typeof(MyCustomAttribute), false)
.Cast<MyCustomAttribute>();
Evet, AttributeTargets.Assembly kullanın:
[AttributeUsage(AttributeTargets.Assembly)]
public class AssemblyAttribute : Attribute { ... }