Click here to Skip to main content
15,888,085 members
Home / Discussions / C#
   

C#

 
GeneralRe: KeyValuePair from reference dll Pin
Isaksson4-Jan-13 0:41
Isaksson4-Jan-13 0:41 
Questionhow to connect and disconnect to internet by Exist connection Pin
apadana_19892-Jan-13 17:44
apadana_19892-Jan-13 17:44 
QuestionRe: how to connect and disconnect to internet by Exist connection Pin
Richard MacCutchan2-Jan-13 22:15
mveRichard MacCutchan2-Jan-13 22:15 
AnswerRe: how to connect and disconnect to internet by Exist connection Pin
jschell3-Jan-13 8:11
jschell3-Jan-13 8:11 
QuestionHow to create a colletion of properties in a C# class Pin
bnath0012-Jan-13 12:59
bnath0012-Jan-13 12:59 
AnswerRe: How to create a colletion of properties in a C# class Pin
PIEBALDconsult2-Jan-13 13:34
mvePIEBALDconsult2-Jan-13 13:34 
AnswerRe: How to create a colletion of properties in a C# class Pin
Abhinav S2-Jan-13 15:42
Abhinav S2-Jan-13 15:42 
AnswerRe: How to create a colletion of properties in a C# class Pin
OriginalGriff2-Jan-13 21:16
mveOriginalGriff2-Jan-13 21:16 
Yes you can.
When you create a property, you can return anything you want - including objects you create as required.
For example, if you want to return only those values which are below 1000:
C#
public Dictionary<string, int> LowValues
    {
    get
        {
        Dictionary<string, int> dict = new Dictionary<string, int>();
        if (_countAdvanceCurve < 1000) dict.Add("AdvanceCurve", _countAdvanceCurve);
        if (_countAdvancesSBCAgencyCurve < 1000) dict.Add("AdvancesSBCAgencyCurve", _countAdvancesSBCAgencyCurve);
        if (_countAdvancesSBCAAACurve < 1000) dict.Add("AdvancesSBCAAACurve", _countAdvancesSBCAAACurve);
        if (_countFhlbsfTreasuryCurve < 1000) dict.Add("FhlbsfTreasuryCurve", _countFhlbsfTreasuryCurve);
        if (_countDNCOCurve < 1000) dict.Add("DNCOCurve", _countDNCOCurve);
        return dict;
        }
    }
This is one of the big advantages of Properties over fields - you do not have to store anything in a way that makes sense to the outside world. You can store in the best way for your class, and provide the outside world with the info it want, how it wants it, only when it asks for it.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.

GeneralRe: How to create a colletion of properties in a C# class Pin
bnath0013-Jan-13 5:59
bnath0013-Jan-13 5:59 
GeneralRe: How to create a colletion of properties in a C# class Pin
OriginalGriff3-Jan-13 8:24
mveOriginalGriff3-Jan-13 8:24 
GeneralIf I use Dictionary, I am not able to serialize it Pin
bnath0013-Jan-13 9:08
bnath0013-Jan-13 9:08 
GeneralRe: If I use Dictionary, I am not able to serialize it Pin
OriginalGriff3-Jan-13 9:50
mveOriginalGriff3-Jan-13 9:50 
GeneralRe: If I use Dictionary, I am not able to serialize it Pin
bnath0013-Jan-13 10:44
bnath0013-Jan-13 10:44 
QuestionCA2214 Do not call overridable methods in constructors Pin
DaveyM692-Jan-13 12:35
professionalDaveyM692-Jan-13 12:35 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
PIEBALDconsult2-Jan-13 13:38
mvePIEBALDconsult2-Jan-13 13:38 
AnswerRe: CA2214 Do not call overridable methods in constructors Pin
Alan N2-Jan-13 14:28
Alan N2-Jan-13 14:28 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM692-Jan-13 22:33
professionalDaveyM692-Jan-13 22:33 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
Pete O'Hanlon2-Jan-13 22:53
mvePete O'Hanlon2-Jan-13 22:53 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
BobJanova3-Jan-13 1:36
BobJanova3-Jan-13 1:36 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
Pete O'Hanlon3-Jan-13 1:42
mvePete O'Hanlon3-Jan-13 1:42 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM693-Jan-13 3:22
professionalDaveyM693-Jan-13 3:22 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM693-Jan-13 12:10
professionalDaveyM693-Jan-13 12:10 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
jschell3-Jan-13 8:16
jschell3-Jan-13 8:16 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
DaveyM693-Jan-13 11:36
professionalDaveyM693-Jan-13 11:36 
GeneralRe: CA2214 Do not call overridable methods in constructors Pin
Bernhard Hiller3-Jan-13 22:48
Bernhard Hiller3-Jan-13 22:48 

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.