Click here to Skip to main content
15,891,372 members
Home / Discussions / C#
   

C#

 
GeneralRe: managed DLL error with C# Pin
Doom-Child22-Feb-05 9:26
Doom-Child22-Feb-05 9:26 
GeneralRe: managed DLL error with C# Pin
Heath Stewart22-Feb-05 13:10
protectorHeath Stewart22-Feb-05 13:10 
GeneralRe: managed DLL error with C# Pin
Heath Stewart22-Feb-05 13:06
protectorHeath Stewart22-Feb-05 13:06 
QuestionIs it possible??? Pin
students552 university21-Feb-05 8:27
students552 university21-Feb-05 8:27 
AnswerRe: Is it possible??? Pin
Heath Stewart21-Feb-05 12:27
protectorHeath Stewart21-Feb-05 12:27 
Questionhow to connect to Net without voilating security issues Pin
Samar Aarkotti21-Feb-05 7:34
Samar Aarkotti21-Feb-05 7:34 
AnswerRe: how to connect to Net without voilating security issues Pin
leppie21-Feb-05 11:12
leppie21-Feb-05 11:12 
GeneralGetting notification of alteration to a collection Pin
FocusedWolf21-Feb-05 7:08
FocusedWolf21-Feb-05 7:08 
Ok, i did it like everyone does it and extended collection base...and have all the usual functions: add, remove, insert, etc. In all these i trip an action ...like OnItemsAdded, OnItemsRemoved, etc.

Now the problem i see occurs when the control collection is altered through a property grid (doesnt matter if its in vs.net or the property grid on my test form).

In this situation i get no notification through any of my other collection actions...for ex. when you add something with property grid...you would assume that it used your insert function...or indexer "this[ int index ]"...but placing a action tripwire in both locals did not generate any response...and i need these actions to go off so i can determine if my control should refresh when an item is added to the collection.

I did some googling that revealed the possibility of overriding some of collectionbase's actions:

i tried all of them, but OnInsertComplete was the only one that fired when items in the collection were altered or added through a property grid

problem with this approach is it fires to much! i can add an item to the collection, and it will fire for every item in the collection! this results in my control looking like trash everytime a item is changed or added with tons of extra refreshing occuring. A way i could stop this is only allowing it to set off a refresh while in designmode so i don't have to worry about extra refresh calls during the time when my collection is solely modified through actions i implemented...i.e.

<br />
public void Add(string text)<br />
{<br />
 List.Add(new SimpleListItem(text));<br />
 OnItemsAdded(this, new System.EventArgs(), List.Count - 1);<br />
}<br />


and the rest...but thats alot of performance lost with the OnInsert function calling my collection's action...which then notifies subscribers...and then in my control having to check if its in designmode and needs to be refreshed...everytime an item is added or changed, and for every single item in the collection over and over until this whole process occurs once for each item...thats just wrong!!!

Maybe i can get away with making my own collection that doesn't inherit collectionbase...this way i can control it way better...i wonder if anyones done this already?...that would help alot.
GeneralRe: I need a collection thats threadsafe and doesn't inherit collectionbase Pin
Heath Stewart21-Feb-05 7:19
protectorHeath Stewart21-Feb-05 7:19 
GeneralRe: I need a collection thats threadsafe and doesn't inherit collectionbase Pin
FocusedWolf21-Feb-05 9:52
FocusedWolf21-Feb-05 9:52 
GeneralRe: I need a collection thats threadsafe and doesn't inherit collectionbase Pin
Heath Stewart21-Feb-05 12:03
protectorHeath Stewart21-Feb-05 12:03 
GeneralUserControl Pin
Exenten21-Feb-05 6:43
Exenten21-Feb-05 6:43 
GeneralRe: UserControl Pin
Dave Kreskowiak21-Feb-05 15:35
mveDave Kreskowiak21-Feb-05 15:35 
GeneralSorting in DataGrid Pin
Anonymous21-Feb-05 6:01
Anonymous21-Feb-05 6:01 
GeneralRe: Sorting in DataGrid Pin
Heath Stewart21-Feb-05 12:18
protectorHeath Stewart21-Feb-05 12:18 
GeneralRe: Sorting in DataGrid Pin
Anonymous21-Feb-05 17:25
Anonymous21-Feb-05 17:25 
Generaladding reference to cdoex on a remote server Pin
Member 169690721-Feb-05 5:16
Member 169690721-Feb-05 5:16 
GeneralRe: adding reference to cdoex on a remote server Pin
Heath Stewart21-Feb-05 12:11
protectorHeath Stewart21-Feb-05 12:11 
Generalpager dialer question Pin
daddion21-Feb-05 3:13
daddion21-Feb-05 3:13 
GeneralRe: pager dialer question Pin
Heath Stewart21-Feb-05 12:09
protectorHeath Stewart21-Feb-05 12:09 
GeneralFind Today&#8217; Date Using Code Pin
Anonymous21-Feb-05 3:02
Anonymous21-Feb-05 3:02 
GeneralRe: Find Today&#8217; Date Using Code Pin
Rob Graham21-Feb-05 3:16
Rob Graham21-Feb-05 3:16 
GeneralRe: Find Today&#8217; Date Using Code Pin
Heath Stewart21-Feb-05 12:07
protectorHeath Stewart21-Feb-05 12:07 
GeneralRe: Find Today&#8217; Date Using Code Pin
Sebastian Schneider23-Feb-05 1:43
Sebastian Schneider23-Feb-05 1:43 
GeneralRe: Find Today&#8217; Date Using Code Pin
Heath Stewart23-Feb-05 7:42
protectorHeath Stewart23-Feb-05 7:42 

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.