Click here to Skip to main content
15,917,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: TreeView drag and drop Pin
Heath Stewart15-Apr-04 11:18
protectorHeath Stewart15-Apr-04 11:18 
GeneralRe: TreeView drag and drop Pin
Pete Burgess15-Apr-04 11:35
Pete Burgess15-Apr-04 11:35 
GeneralRe: TreeView drag and drop Pin
Pete Burgess15-Apr-04 12:05
Pete Burgess15-Apr-04 12:05 
Questioncollections or methods? Pin
Judah Gabriel Himango15-Apr-04 9:39
sponsorJudah Gabriel Himango15-Apr-04 9:39 
AnswerRe: collections or methods? Pin
Heath Stewart15-Apr-04 9:59
protectorHeath Stewart15-Apr-04 9:59 
GeneralRe: collections or methods? Pin
Judah Gabriel Himango15-Apr-04 10:22
sponsorJudah Gabriel Himango15-Apr-04 10:22 
GeneralRe: collections or methods? Pin
Heath Stewart15-Apr-04 10:51
protectorHeath Stewart15-Apr-04 10:51 
GeneralRe: collections or methods? Pin
Judah Gabriel Himango15-Apr-04 11:23
sponsorJudah Gabriel Himango15-Apr-04 11:23 
By breaking it, I meant manipulating the collection in such a way as to cause the collection to either throw an exception, display incorrect data, function improperly, open a security hole, etc. You bring up an interesting point in reassignment, that's something I didn't consider.

I suppose as long as FooCollection stores only Foo types, you'd only be able to reassign a Foo instance to another Foo instance. That is not a problem, since there is already checking going on to ensure each Foo can belong to only one FooBar control or other Foo item at a time. However, assigning a new Foo instance to an existing Foo in the FooCollection might not display correctly until the FooBar is repainted. I noticed the Sys.Win.Form.TreeView has such a case (bug?) in which the following code makes 2 nodes show up:

this.Show();
TreeView v = new TreeView();
this.Controls.Add(v);

v.Nodes.Add("hello");
	
TreeNodeCollection tnc = v.Nodes;
tnc[0] = new TreeNode("hello again");
MessageBox.Show(tnc.Count.ToString()); // outputs 1, despite 2 nodes showing up in the tree


On the security side, currently there are no plans to use FooBar and Foo outside the main application. The only caller will be our main application. Still, it might be a good idea to eventually use CAS to ensure only fully trusted callers can manipulate the collection in the event other callers will use it.

Thanks again Heath for the response, you've been quite helpful as always.


---------------------------
He who knows that enough is enough will always have enough.

-Lao Tsu

GeneralRe: collections or methods? Pin
Steven Campbell15-Apr-04 11:17
Steven Campbell15-Apr-04 11:17 
GeneralRe: collections or methods? Pin
Judah Gabriel Himango15-Apr-04 16:41
sponsorJudah Gabriel Himango15-Apr-04 16:41 
AnswerRe: collections or methods? Pin
scadaguy15-Apr-04 11:42
scadaguy15-Apr-04 11:42 
GeneralRe: collections or methods? Pin
Judah Gabriel Himango15-Apr-04 16:53
sponsorJudah Gabriel Himango15-Apr-04 16:53 
AnswerRe: collections or methods? Pin
bjoernen24-Apr-04 23:06
bjoernen24-Apr-04 23:06 
GeneralHotkeys Pin
rickrf15-Apr-04 7:43
rickrf15-Apr-04 7:43 
GeneralRe: Hotkeys Pin
Tom Clement15-Apr-04 7:51
professionalTom Clement15-Apr-04 7:51 
GeneralRe: Hotkeys Pin
Heath Stewart15-Apr-04 8:41
protectorHeath Stewart15-Apr-04 8:41 
GeneralRe: Hotkeys Pin
Mazdak15-Apr-04 9:24
Mazdak15-Apr-04 9:24 
GeneralRe: Hotkeys Pin
Heath Stewart15-Apr-04 9:25
protectorHeath Stewart15-Apr-04 9:25 
GeneralRe: Hotkeys Pin
rickrf16-Apr-04 4:36
rickrf16-Apr-04 4:36 
GeneralRe: Hotkeys Pin
rickrf16-Apr-04 5:16
rickrf16-Apr-04 5:16 
GeneralRe: Hotkeys Pin
Bee Master16-Apr-04 17:46
Bee Master16-Apr-04 17:46 
QuestionWinForms bug? Pin
Tom Clement15-Apr-04 7:02
professionalTom Clement15-Apr-04 7:02 
GeneralC#: Question referring Generics Pin
SJ_Phoenix15-Apr-04 6:46
SJ_Phoenix15-Apr-04 6:46 
GeneralRe: C#: Question referring Generics Pin
Heath Stewart15-Apr-04 6:55
protectorHeath Stewart15-Apr-04 6:55 
GeneralRe: C#: Question referring Generics Pin
Heath Stewart15-Apr-04 7:02
protectorHeath Stewart15-Apr-04 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.