Click here to Skip to main content
15,356,720 members
Home / Discussions / C#
   

C#

 
QuestionWhat is the best way to practice unit testing in C#? Pin
Hila Berger30-Jan-18 0:33
MemberHila 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
MemberHila 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
MemberHila 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
MemberGregoryPres5-Feb-18 2:16 
QuestionPrevent adding of nodes to a TreeNode? Pin
primem0ver29-Jan-18 23:46
Memberprimem0ver29-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
mveBillWoodruff3-Feb-18 7:03 
GeneralRe: Prevent adding of nodes to a TreeNode? Pin
primem0ver3-Feb-18 22:52
Memberprimem0ver3-Feb-18 22:52 
GeneralRe: Prevent adding of nodes to a TreeNode? Pin
BillWoodruff5-Feb-18 18:34
mveBillWoodruff5-Feb-18 18:34 
GeneralRe: Prevent adding of nodes to a TreeNode? Pin
primem0ver9-Feb-18 1:21
Memberprimem0ver9-Feb-18 1:21 
GeneralRe: Prevent adding of nodes to a TreeNode? Pin
BillWoodruff10-Feb-18 19:48
mveBillWoodruff10-Feb-18 19:48 
QuestionHow to debug a WndProc function with multiple listviews ? Pin
Member 245846727-Jan-18 22:48
MemberMember 245846727-Jan-18 22:48 
QuestionUpdate bound WPF controls from another thread Pin
je-wo25-Jan-18 7:14
Memberje-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
mvaPete O'Hanlon25-Jan-18 22:41 
QuestionEliminate LINQ for List<int> ? Pin
Member 245846724-Jan-18 19:50
MemberMember 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
mveBillWoodruff25-Jan-18 23:58 
GeneralRe: Eliminate LINQ for List<int> ? Pin
#realJSOP30-Jan-18 3:39
mva#realJSOP30-Jan-18 3:39 
GeneralRe: Eliminate LINQ for List<int> ? Pin
BillWoodruff30-Jan-18 6:07
mveBillWoodruff30-Jan-18 6:07 
QuestionPaint Image on Form with BitBlt? Pin
Darla Fanbridge24-Jan-18 3:12
MemberDarla Fanbridge24-Jan-18 3:12 

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.