Click here to Skip to main content
12,629,493 members (35,560 online)
   

C#

 
QuestionRe: how to connect and disconnect to internet by Exist connection Pin
Richard MacCutchan2-Jan-13 23:15
mvpRichard MacCutchan2-Jan-13 23:15 
AnswerRe: how to connect and disconnect to internet by Exist connection Pin
jschell3-Jan-13 9:11
memberjschell3-Jan-13 9:11 
QuestionHow to create a colletion of properties in a C# class Pin
bnath0012-Jan-13 13:59
memberbnath0012-Jan-13 13:59 
AnswerRe: How to create a colletion of properties in a C# class Pin
PIEBALDconsult2-Jan-13 14:34
memberPIEBALDconsult2-Jan-13 14:34 
AnswerRe: How to create a colletion of properties in a C# class Pin
Abhinav S2-Jan-13 16:42
mvpAbhinav S2-Jan-13 16:42 
AnswerRe: How to create a colletion of properties in a C# class Pin
OriginalGriff2-Jan-13 22:16
mvpOriginalGriff2-Jan-13 22:16 
GeneralRe: How to create a colletion of properties in a C# class Pin
bnath0013-Jan-13 6:59
memberbnath0013-Jan-13 6:59 
GeneralRe: How to create a colletion of properties in a C# class Pin
OriginalGriff3-Jan-13 9:24
mvpOriginalGriff3-Jan-13 9:24 
GeneralIf I use Dictionary, I am not able to serialize it Pin
bnath0013-Jan-13 10:08
memberbnath0013-Jan-13 10:08 
GeneralRe: If I use Dictionary, I am not able to serialize it Pin
OriginalGriff3-Jan-13 10:50
mvpOriginalGriff3-Jan-13 10:50 
GeneralRe: If I use Dictionary, I am not able to serialize it Pin
bnath0013-Jan-13 11:44
memberbnath0013-Jan-13 11:44 
QuestionCA2214 Do not call overridable methods in constructors Pin
DaveyM692-Jan-13 13:35
mentorDaveyM692-Jan-13 13:35 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
PIEBALDconsult2-Jan-13 14:38
memberPIEBALDconsult2-Jan-13 14:38 
AnswerRe: CA2214 Do not call overridable methods in constructors Pin
Alan N2-Jan-13 15:28
memberAlan N2-Jan-13 15:28 
This is one of those 'well it depends' rules. Think about the order in which chained constructors are called. The first thing derived class B's constructor does is call base class A's constructor.

If A's constructor now calls a virtual instance method defined in class B, it is accessing a partially initialised class. Remember that B's constructor has not run yet and all of B's instance data will be in an unknown state but it will be perfectly safe to call the instance method as long as it does not rely on instance data.

Examples of situations where this technique is used can be seen in the System.Windows.Forms class. Here you will find the protected bool ShowWithoutActivation property which is called internally and in the base class returns the constant value false. Overriding to return constant true changes the behaviour of a derived class. Similarly the property CreateParams can also be overridden to supply non default parameters to the base class.

So my feeling is it's OK to ignore CA2214 as long as you treat the overridden method or property as if it were static and don't do anything naughty.

Alan.
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM692-Jan-13 23:33
mentorDaveyM692-Jan-13 23:33 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
Pete O'Hanlon2-Jan-13 23:53
protectorPete O'Hanlon2-Jan-13 23:53 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
BobJanova3-Jan-13 2:36
memberBobJanova3-Jan-13 2:36 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
Pete O'Hanlon3-Jan-13 2:42
protectorPete O'Hanlon3-Jan-13 2:42 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM693-Jan-13 4:22
mentorDaveyM693-Jan-13 4:22 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM693-Jan-13 13:10
mentorDaveyM693-Jan-13 13:10 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
jschell3-Jan-13 9:16
memberjschell3-Jan-13 9:16 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM693-Jan-13 12:36
mentorDaveyM693-Jan-13 12:36 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
Bernhard Hiller3-Jan-13 23:48
memberBernhard Hiller3-Jan-13 23:48 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
jschell4-Jan-13 14:08
memberjschell4-Jan-13 14:08 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM695-Jan-13 4:00
mentorDaveyM695-Jan-13 4:00 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
jschell6-Jan-13 5:42
memberjschell6-Jan-13 5:42 
AnswerRe: CA2214 Do not call overridable methods in constructors Pin
BobJanova3-Jan-13 2:41
memberBobJanova3-Jan-13 2:41 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM693-Jan-13 13:29
mentorDaveyM693-Jan-13 13:29 
QuestionBind listview row color to active index Pin
bornefalk2-Jan-13 10:50
memberbornefalk2-Jan-13 10:50 
QuestionUI Automation and MMC Pin
RonNYC22-Jan-13 6:57
memberRonNYC22-Jan-13 6:57 
Questionmove a newfolder form a system on other system on the network by c# Pin
a2bj2-Jan-13 0:39
membera2bj2-Jan-13 0:39 
AnswerRe: move a newfolder form a system on other system on the network by c# Pin
jibesh2-Jan-13 0:46
memberjibesh2-Jan-13 0:46 
AnswerRe: move a newfolder form a system on other system on the network by c# Pin
Simon_Whale2-Jan-13 4:02
memberSimon_Whale2-Jan-13 4:02 
Questiondata Set Not Coming In GridView Pin
aman11241-Jan-13 18:50
memberaman11241-Jan-13 18:50 
AnswerRe: data Set Not Coming In GridView Pin
jibesh1-Jan-13 22:25
memberjibesh1-Jan-13 22:25 
GeneralRe: data Set Not Coming In GridView Pin
aman11242-Jan-13 0:35
memberaman11242-Jan-13 0:35 
GeneralRe: data Set Not Coming In GridView Pin
jibesh2-Jan-13 0:36
memberjibesh2-Jan-13 0:36 
GeneralRe: data Set Not Coming In GridView Pin
GugliMugli2-Jan-13 0:40
memberGugliMugli2-Jan-13 0:40 
GeneralRe: data Set Not Coming In GridView Pin
jibesh2-Jan-13 0:42
memberjibesh2-Jan-13 0:42 
GeneralRe: data Set Not Coming In GridView Pin
GugliMugli2-Jan-13 0:57
memberGugliMugli2-Jan-13 0:57 
GeneralRe: data Set Not Coming In GridView Pin
jibesh2-Jan-13 1:02
memberjibesh2-Jan-13 1:02 
GeneralRe: data Set Not Coming In GridView Pin
GugliMugli2-Jan-13 2:27
memberGugliMugli2-Jan-13 2:27 
GeneralRe: data Set Not Coming In GridView Pin
jibesh2-Jan-13 2:29
memberjibesh2-Jan-13 2:29 
AnswerRe: data Set Not Coming In GridView Pin
Richard MacCutchan2-Jan-13 2:47
mvpRichard MacCutchan2-Jan-13 2:47 
GeneralRe: data Set Not Coming In GridView Pin
jibesh2-Jan-13 3:06
memberjibesh2-Jan-13 3:06 
GeneralRe: data Set Not Coming In GridView Pin
GugliMugli2-Jan-13 3:18
memberGugliMugli2-Jan-13 3:18 
GeneralRe: data Set Not Coming In GridView Pin
Richard MacCutchan2-Jan-13 5:15
mvpRichard MacCutchan2-Jan-13 5:15 
QuestionHow to show file association icon,one button and a progress bar on webbrowser control c# Pin
Tridip Bhattacharjee1-Jan-13 7:50
memberTridip Bhattacharjee1-Jan-13 7:50 
Question"sendkeys" does not work KnightOnline Pin
ismail2031-Dec-12 4:09
memberismail2031-Dec-12 4:09 
AnswerRe: "sendkeys" does not work KnightOnline Pin
Dave Kreskowiak31-Dec-12 4:28
mvpDave Kreskowiak31-Dec-12 4:28 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.161205.3 | Last Updated 7 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid