Click here to Skip to main content
15,889,435 members
Home / Discussions / C#
   

C#

 
GeneralRe: time task scheduler class Pin
Member 136321711-Feb-18 2:45
Member 136321711-Feb-18 2:45 
AnswerRe: time task scheduler class Pin
#realJSOP1-Feb-18 4:52
mve#realJSOP1-Feb-18 4:52 
GeneralRe: time task scheduler class Pin
Member 136321711-Feb-18 4:54
Member 136321711-Feb-18 4:54 
AnswerRe: time task scheduler class Pin
#realJSOP2-Feb-18 0:54
mve#realJSOP2-Feb-18 0:54 
AnswerRe: time task scheduler class Pin
Pete O'Hanlon31-Jan-18 2:54
mvePete O'Hanlon31-Jan-18 2:54 
GeneralRe: time task scheduler class Pin
Member 1363217131-Jan-18 2:58
Member 1363217131-Jan-18 2:58 
Questionusing image button Pin
Member 1365319330-Jan-18 20:22
Member 1365319330-Jan-18 20:22 
AnswerRe: using image button Pin
OriginalGriff30-Jan-18 21:04
mveOriginalGriff30-Jan-18 21:04 
QuestionC# read the footer in a Microsoft Word document Pin
Member 1101829930-Jan-18 15:00
Member 1101829930-Jan-18 15:00 
AnswerRe: C# read the footer in a Microsoft Word document Pin
Richard MacCutchan30-Jan-18 21:39
mveRichard MacCutchan30-Jan-18 21:39 
QuestionPartial static class Pin
#realJSOP30-Jan-18 3:26
mve#realJSOP30-Jan-18 3:26 
AnswerRe: Partial static class Pin
Richard Deeming30-Jan-18 3:44
mveRichard Deeming30-Jan-18 3:44 
GeneralRe: Partial static class Pin
#realJSOP30-Jan-18 3:49
mve#realJSOP30-Jan-18 3:49 
QuestionWhat is the best way to practice unit testing in C#? Pin
Hila Berger30-Jan-18 0:33
Hila Berger30-Jan-18 0:33 
AnswerRe: What is the best way to practice unit testing in C#? Pin
Eddy Vluggen30-Jan-18 0:48
professionalEddy Vluggen30-Jan-18 0:48 
GeneralRe: What is the best way to practice unit testing in C#? Pin
Hila Berger31-Jan-18 23:14
Hila Berger31-Jan-18 23:14 
GeneralRe: What is the best way to practice unit testing in C#? Pin
Eddy Vluggen31-Jan-18 23:23
professionalEddy Vluggen31-Jan-18 23:23 
GeneralRe: What is the best way to practice unit testing in C#? Pin
Hila Berger31-Jan-18 23:48
Hila Berger31-Jan-18 23:48 
GeneralRe: What is the best way to practice unit testing in C#? Pin
Eddy Vluggen31-Jan-18 23:54
professionalEddy Vluggen31-Jan-18 23:54 
SuggestionRe: What is the best way to practice unit testing in C#? Pin
GregoryPres5-Feb-18 2:16
GregoryPres5-Feb-18 2:16 
QuestionPrevent adding of nodes to a TreeNode? Pin
primem0ver29-Jan-18 23:46
primem0ver29-Jan-18 23:46 
AnswerRe: Prevent adding of nodes to a TreeNode? Pin
Eddy Vluggen30-Jan-18 0:15
professionalEddy Vluggen30-Jan-18 0:15 
AnswerRe: Prevent adding of nodes to a TreeNode? Pin
BillWoodruff3-Feb-18 7:03
professionalBillWoodruff3-Feb-18 7:03 
Before I switched to using the Integral UI TreeView (Lidor Systems) [^], I used the following strategy to wrap the native WinForm TreeView in a way that let me do multiple selection:

1. a UserControl 'TreeXHost in which a WinForm TreeView 'WFTree is docked 'Full: 'WFTree is set to DrawMode 'OwnerDrawText. WFTree is declared 'private.

1.a when 'TreeXHost loads: the instance of the WinForm TreeView, is passed into a class 'TreeX, a pretty standard tree implementation.

2. in 'TreeX : event handlers are wired up for all the TreeView events

2.a a variety of Dictionaries and Lists were used to keep track of state and enable custom node (not inheriting from WF TreeNode) <=>to WF Node lookup:
public Dictionary<string, Node> AllNodes { set; get; }
public Dictionary<string, TreeNode> AllTreeNodes { set; get; }

public Dictionary<TreeNode, Node> TNodeToNode { set; get; }
public Dictionary<Node, TreeNode> NodeToTNode { set; get; }

public List<Node> DisabledNodes { set; get; }
public List<Node> SelectedNodes { set; get; }
So the basic idea was to isolate the WinForm TreeView completely, and present an API to use that behind the scenes inter-oped with the WinForm TreeView.

There were several reasons I chose not to sub-class the WF TreeView or TreeNode: of course, the issue/danger of exposing the "can't inherit from" TreeNodeCollection; the need to add some complex annotations to each node; ease of writing a serialize/deserialize facility, etc.

Yes, indeed. it got tricky: I ended up canceling every WF TV Event I could in the 'Before... Event Handlers; in the DrawNode Event you need to color the Node, or otherwise alter the TreeNode appearance based on its state. A design issue was whether disabling/enabling a Node with a non-empty TreeNodeCollection should recursively disable/enab;e every Node "under" it: I decided that was necessary. Not to mention issues of drag-drop Smile | :)

It got so tricky I went looking for a 3rd. party Treeview that I could afford ... and, I found the IntegralUI TreeView that was (and, still is) quite remarkable

Hope this is helpful.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12


modified 4-Feb-18 1:09am.

GeneralRe: Prevent adding of nodes to a TreeNode? Pin
primem0ver3-Feb-18 22:52
primem0ver3-Feb-18 22:52 
GeneralRe: Prevent adding of nodes to a TreeNode? Pin
BillWoodruff5-Feb-18 18:34
professionalBillWoodruff5-Feb-18 18:34 

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.