Hi,
Im using Visual Studio 2005 and .Net 3.0. I wanted to apply Break Points in my Custom Attribute class. I and my falla both used number of sample code but Neither code is not executing Custom class nor break points work.
Here is someone sample code. Im not even able to apply Break point.
Can any Genious knows the answer
using
System;
using
System.Collections.Generic;
using
System.Text;
namespace
RegKeyAttributeTestor
{
[
AttributeUsage(AttributeTargets.Method|AttributeTargets.Struct,
AllowMultiple=
false,Inherited=false)]
public class MyAttribute:Attribute
{
private string regKey="a12nf";
public MyAttribute(string regKey)
{
if(this.regKey==regKey)
{
Console.WriteLine("Permitted to use this App");
}
else
{
Console.WriteLine("Not registered to use this App");
}
}
}
//End Attribute class code
class useAttrib
{
[
MyAttribute("hello")]
public static string SayHello(string str)
{
return str;
}
static void Main()
{
Console.WriteLine(SayHello("Hello to Sufyan"));
Console.ReadLine();
}
}
Thanks ,
sha