471,115 Members | 1,432 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,115 software developers and data experts.

Browsable property not in Properties window

I cannot see a browsable property I have added in the Properties
Window. Using C++ in Visual Studio .NET 2003 I have added a property to
my managed class:

[..]
public:
[Browsable(true)]
[Category(S"MyCategory")]
[DefaultValue(6)]
[Description(S"My description")]
__property int get_Foobar() { return m_foobar; }
__property void set_Foobar(int value) { m_foobar = value; }
private:
int m_foobar;
[..]

My understanding from the docs is that I should see "Foobar" show up on
the properties for this class.
http://msdn.microsoft.com/library/de...ClassTopic.asp

This class is a service inheriting from
System::ServiceProcess::ServiceBase. I go to the "MyService.h [Design]"
view, right click on the designer background and select properties. I
see inherited properties like "CanShutdown" and "CanStop" but I do not
see the category I defined ("MyCategory") nor the property I have made
browsable ("Foobar"). I even check to make sure I have set the
Browsable attribute correctly:
[..]
AttributeCollection* attributes =
TypeDescriptor::GetAttributes( __box(Foobar));
if(attributes->Item[__typeof(BrowsableAttribute)]->Equals(BrowsableAttribute::Yes))
{
EventLog::WriteEntry(S"MyService", S"Foobar is browsable");
}
else
{
EventLog::WriteEntry(S"MyService", S"Foobar is not browsable");
}
[..]
I indeed see "Foobar is browsable" in the Event Viewer for my service
so I conclude that I have successfully defined my property and set the
browsable attribute to true. So why can't I see the property in the
Properties window?

This is important because I want to make some properties dynamic so
they can be configured through the XML .config file thus making my
service easily configurable without a recompile. The only way I know
how to do this is to get the property visible in the Properties window
and then go to "(DynamicProperties)", click on the "..." and check
properties that I want to show up in the .config file. This works great
as long as the property is actually listed in the Properties window. If
there is an alternative way to mark my properties as dynamic that would
also solve my problem.

Thanks,
Stephen W. Carson
Dirxion Software

Nov 17 '05 #1
0 1459

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Flix | last post: by
1 post views Thread by Beeeeeeeeeeeeves | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.