Use of ISite


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I am not quite able to determine what the purpose of the following code is:





private ISite _Site;



[Browsable(false)]

public System.ComponentModel.ISite Site

{

get

{

return this._Site;

}

set

{

this._Site = value;

}

}





Since the _Site variable is private, and nothing in the class does anything with it, couldn't we do something like this:





[Browsable(false)]

public System.ComponentModel.ISite Site { get; set; }





My next question is, what outside of the class uses this property? I may find it as I am working on this...I'll post here as soon as I do.



Thanks,

Bill

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
This is added from the IComponent implementation. The components container uses this site reference to know what components have been added to any parent component container. This site reference is set through the designers and is required for proper component implementation. If you'll notice, when you add an action to any form, that action shows up in the component area of the form. This is how that is accomplished.
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Ok...that'll give me some things to study (components and how they live in their environment, next on Nat Geo!) BigGrin



I am still wondering whether the syntax, public System.ComponentModel.ISite Site { get; set; }, would still work. I have it setup in my test case. Seems to be running just fine.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I generally don't like to do that but prefer to define it explicitly, that way you always know exactly what is happening. But this is more of a personal preference thing. Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Bill Cunnien - 15 Years Ago
Greg McGuffey - 15 Years Ago
Bill Cunnien - 15 Years Ago
                 (bump)

:)
Bill Cunnien - 15 Years Ago
Trent L. Taylor - 15 Years Ago
                         Ok...that'll give me some things to study (components and how they...
Bill Cunnien - 15 Years Ago
                             I generally don't like to do that but prefer to define it explicitly,...
Trent L. Taylor - 15 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search