Click here to Skip to main content
15,914,795 members
Home / Discussions / C#
   

C#

 
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 
I have been researching a solution to this and have not found an answer so I thought I would ask it here.

I have an application that derives from System.Windows.Forms.TreeNode for a few of the classes. I want to create a "lockable" tree node for the base nodes of my tree which ensures that programmers don't accidentally (or purposefully) modify the nodes once they are "locked" because the base nodes are "immutable" while the rest of the tree is not. However, since I cannot derive from TreeNodeCollection and there is no c# equivalent of the C++ const method contract (that I have been able to find for properties), I am having trouble coming up with a way to prevent the following from happening:
C#
someInstanceOfMyLockableTreeNodeClass.Nodes.Add("newNode")

The only thing I can think of is possibly hiding the original Nodes Property (using the new keyword) with a less accessible one (if that would even work). The problem is that I would no longer be able to access the node indexer either... so I would have to create a less intuitive wrapper for that as well. Is there a different approach that I could use?
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 
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 
GeneralRe: Prevent adding of nodes to a TreeNode? Pin
primem0ver9-Feb-18 1:21
primem0ver9-Feb-18 1:21 
GeneralRe: Prevent adding of nodes to a TreeNode? Pin
BillWoodruff10-Feb-18 19:48
professionalBillWoodruff10-Feb-18 19:48 
QuestionHow to debug a WndProc function with multiple listviews ? Pin
Member 245846727-Jan-18 22:48
Member 245846727-Jan-18 22:48 
QuestionUpdate bound WPF controls from another thread Pin
je-wo25-Jan-18 7:14
je-wo25-Jan-18 7:14 
AnswerRe: Update bound WPF controls from another thread Pin
Richard Deeming25-Jan-18 9:02
mveRichard Deeming25-Jan-18 9:02 
AnswerRe: Update bound WPF controls from another thread Pin
Pete O'Hanlon25-Jan-18 22:41
mvePete O'Hanlon25-Jan-18 22:41 
QuestionEliminate LINQ for List<int> ? Pin
Member 245846724-Jan-18 19:50
Member 245846724-Jan-18 19:50 
AnswerRe: Eliminate LINQ for List<int> ? Pin
OriginalGriff24-Jan-18 20:16
mveOriginalGriff24-Jan-18 20:16 
SuggestionRe: Eliminate LINQ for List<int> ? Pin
Richard Deeming25-Jan-18 8:56
mveRichard Deeming25-Jan-18 8:56 
AnswerRe: Eliminate LINQ for List<int> ? Pin
BillWoodruff25-Jan-18 23:58
professionalBillWoodruff25-Jan-18 23:58 
GeneralRe: Eliminate LINQ for List<int> ? Pin
#realJSOP30-Jan-18 3:39
professional#realJSOP30-Jan-18 3:39 
GeneralRe: Eliminate LINQ for List<int> ? Pin
BillWoodruff30-Jan-18 6:07
professionalBillWoodruff30-Jan-18 6:07 
QuestionPaint Image on Form with BitBlt? Pin
Darla Fanbridge24-Jan-18 3:12
Darla Fanbridge24-Jan-18 3:12 
AnswerRe: Paint Image on Form with BitBlt? Pin
OriginalGriff24-Jan-18 4:05
mveOriginalGriff24-Jan-18 4:05 
QuestionSQL Connection string ignoring UserID Pin
Member 1240626023-Jan-18 2:02
Member 1240626023-Jan-18 2:02 
AnswerRe: SQL Connection string ignoring UserID Pin
Jochen Arndt23-Jan-18 2:25
professionalJochen Arndt23-Jan-18 2:25 

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.