Click here to Skip to main content
15,894,646 members
Home / Discussions / C#
   

C#

 
AnswerRe: Form flicks when resize on Timer_Tick Pin
CWIZO2-May-06 8:42
CWIZO2-May-06 8:42 
QuestionObject Reference Error while accessing a treenode from a context menu event Pin
Jonathen Scalet2-May-06 5:57
Jonathen Scalet2-May-06 5:57 
AnswerRe: Object Reference Error while accessing a treenode from a context menu event Pin
Judah Gabriel Himango2-May-06 6:03
sponsorJudah Gabriel Himango2-May-06 6:03 
GeneralRe: Object Reference Error while accessing a treenode from a context menu event Pin
J0nScalet2-May-06 6:14
J0nScalet2-May-06 6:14 
GeneralRe: Object Reference Error while accessing a treenode from a context menu event Pin
Judah Gabriel Himango2-May-06 6:33
sponsorJudah Gabriel Himango2-May-06 6:33 
Questionvedio and powerpoint Pin
walaa ibraheem2-May-06 5:26
walaa ibraheem2-May-06 5:26 
AnswerRe: vedio and powerpoint Pin
Judah Gabriel Himango2-May-06 5:55
sponsorJudah Gabriel Himango2-May-06 5:55 
QuestionRefactoring question (performance) Pin
gantww2-May-06 5:25
gantww2-May-06 5:25 
Hello all,
I wanted to run this by some other folks for a sanity check before I do it.

I have an application (written by a friend) that deals with a heirarchy of objects. Each of the objects in the heirarchy implements an interface called IValidation. IValidation exposes an event that indicates when the validation state of an object has changed, and also has a property called ValidationIssues, which is List<validationissue>. Each validation issue returned contains a description of the issue, the severity, and a reference to the object with the problem. I control this interface completely and it is not used anywhere else, so I can alter it as needed.

Currently, the application loads the object heirarchy into a treeview control on the left side of a form. Context menus in the treeview allow the addition and removal of items in the heirarchy. At the bottom of the form is a list box that contains a list of all the validation issues. The rest of the form is a property grid that allows you to edit the properties of the item selected in the treeview. Double-clicking on an item in the listbox will also bring up the associated object in the property grid.

When something happens that changes the validation state of any object in the heirarchy, an event is fired that works its way all the way back to the root of the heirarchy. The form listens for that event coming from the root object. When this occurs, the form pulls back the new list of validation issues, sorts it and binds it to the listbox.

Anyway, this approach is slowed (horribly) by a couple of problems:
1) The entire set of validation issues is rerun anytime something changes in any object in the heirarchy.
2) Each object's ValidationIssues property returns a List<validationissues>. If an object contains child objects, then the validation issues from those objects are added to the list returned using AddRange.

I was thinking of doing a few things to speed this up:
1) Caching. Each object should maintain its list of validation issues, instead of requiring them to be regenerated each time the property is accessed.
2) Better use of the list. Maybe I could add a method to the interface to allow passing in a List<validationissue> reference to cut back on the copying between lists.
3) Maybe I could extend the List<validationissue> class to make it so that it has a method for removing only validation issues from a particular object. Then, when I got a ValidationChanged event, I could just add the validation issues for that particular object.

Any thoughts?
AnswerRe: Refactoring question (performance) Pin
Judah Gabriel Himango2-May-06 6:01
sponsorJudah Gabriel Himango2-May-06 6:01 
AnswerRe: Refactoring question (performance) Pin
Josh Smith2-May-06 7:32
Josh Smith2-May-06 7:32 
GeneralRe: Refactoring question (performance) Pin
gantww2-May-06 8:02
gantww2-May-06 8:02 
QuestionFire a generic event on enter of item on a tab control page Pin
oracleConvert2-May-06 5:00
oracleConvert2-May-06 5:00 
AnswerRe: Fire a generic event on enter of item on a tab control page Pin
Josh Smith2-May-06 5:04
Josh Smith2-May-06 5:04 
GeneralRe: Fire a generic event on enter of item on a tab control page Pin
oracleConvert2-May-06 5:11
oracleConvert2-May-06 5:11 
GeneralRe: Fire a generic event on enter of item on a tab control page Pin
Josh Smith2-May-06 5:48
Josh Smith2-May-06 5:48 
GeneralRe: Fire a generic event on enter of item on a tab control page Pin
oracleConvert2-May-06 6:07
oracleConvert2-May-06 6:07 
QuestionCrystal Report Matter Pin
ventomito2-May-06 4:31
ventomito2-May-06 4:31 
Questionwebdav exchange server Pin
mhusleag2-May-06 4:25
mhusleag2-May-06 4:25 
QuestionToolStripTextBox disappearing in context menu Pin
Wjousts2-May-06 4:11
Wjousts2-May-06 4:11 
QuestionError while Calling WebService Pin
Jax_qqq2-May-06 3:45
Jax_qqq2-May-06 3:45 
AnswerRe: Error while Calling WebService Pin
Paddy Boyd2-May-06 4:47
Paddy Boyd2-May-06 4:47 
GeneralRe: Error while Calling WebService Pin
Jax_qqq2-May-06 18:05
Jax_qqq2-May-06 18:05 
Questionwindows based application querry ! Pin
meer_Lx2-May-06 3:37
meer_Lx2-May-06 3:37 
AnswerRe: windows based application querry ! Pin
Paddy Boyd2-May-06 4:45
Paddy Boyd2-May-06 4:45 
GeneralRe: windows based application querry ! Pin
meer_Lx2-May-06 19:13
meer_Lx2-May-06 19:13 

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.