R
reviswami78
Hi :
I wanted to know if the following is possible in C# ( .NET Framework
1.x):
I want to add an attribute to a class in a separate file i.e. in a file
other than which the class itself is declared/defined.
So:
//File A.cs
///////// [TypeConverter(typeof(DateConverter))]
public class Date : MyDate
{
}
//File B.cs
public class DateConverter : TypeConverter
{
}
I want to associate the type converter ( using the
[TypeConverter(typeof(DateConverter))] ) attribute outside in File
A.cs, perhaps in File B.cs or other file.
The reason is the File A.cs contains auto-generated code from a custom
tool, and I dont want the autogenerated code files to be touched by a
developer. I want the flexibility of replacing the auto-generated code
by the tool, without losing developer custom additions. Hence I want
any additions (specifically TypeConverter additions) to be in a
separate file.
Is this possible? Any other ideas on how to achieve this?
Thanks.
Revi
I wanted to know if the following is possible in C# ( .NET Framework
1.x):
I want to add an attribute to a class in a separate file i.e. in a file
other than which the class itself is declared/defined.
So:
//File A.cs
///////// [TypeConverter(typeof(DateConverter))]
public class Date : MyDate
{
}
//File B.cs
public class DateConverter : TypeConverter
{
}
I want to associate the type converter ( using the
[TypeConverter(typeof(DateConverter))] ) attribute outside in File
A.cs, perhaps in File B.cs or other file.
The reason is the File A.cs contains auto-generated code from a custom
tool, and I dont want the autogenerated code files to be touched by a
developer. I want the flexibility of replacing the auto-generated code
by the tool, without losing developer custom additions. Hence I want
any additions (specifically TypeConverter additions) to be in a
separate file.
Is this possible? Any other ideas on how to achieve this?
Thanks.
Revi