K
ktrvnbq02
Hi,
I have a WebControl that exposes various properties to the designer in
Visual Studio 2003.
One of these property setters may throw an exception depending on the
contents of some cached data held in a static class elsewhere in the
project (i.e. the property contents is looked up in the cache, which
may cause an exception)
The property setter code works exactly as intended at runtime. However,
it is also running at design-time which I don't want. The reason I
don't want it to run is that it will cause the cache initialization
code to run, which I don't want to happen at that point.
Just to be clear, the property is structured as follows:
public string DbField
{
get
{
return mDbField;
}
set
{
ValidateDbField(value); // <-- I do not want this to run when in
the designer
mDbField = value;
}
}
So is it possible to have the property available in the designer, but
for the designer to not invoke the actual setter code?
Let me know if this is at all unclear.
Regards,
Matt
I have a WebControl that exposes various properties to the designer in
Visual Studio 2003.
One of these property setters may throw an exception depending on the
contents of some cached data held in a static class elsewhere in the
project (i.e. the property contents is looked up in the cache, which
may cause an exception)
The property setter code works exactly as intended at runtime. However,
it is also running at design-time which I don't want. The reason I
don't want it to run is that it will cause the cache initialization
code to run, which I don't want to happen at that point.
Just to be clear, the property is structured as follows:
public string DbField
{
get
{
return mDbField;
}
set
{
ValidateDbField(value); // <-- I do not want this to run when in
the designer
mDbField = value;
}
}
So is it possible to have the property available in the designer, but
for the designer to not invoke the actual setter code?
Let me know if this is at all unclear.
Regards,
Matt