Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
AnswerRe: Reading in Unicode text Pin
Luc Pattyn29-Dec-09 5:20
sitebuilderLuc Pattyn29-Dec-09 5:20 
GeneralRe: Reading in Unicode text Pin
elmernite29-Dec-09 5:56
elmernite29-Dec-09 5:56 
QuestionC# and Open Gl Pin
awaistariq28-Dec-09 7:44
awaistariq28-Dec-09 7:44 
AnswerMessage Closed Pin
28-Dec-09 7:51
stancrm28-Dec-09 7:51 
GeneralRe: C# and Open Gl Pin
harold aptroot28-Dec-09 8:54
harold aptroot28-Dec-09 8:54 
AnswerRe: C# and Open Gl Pin
#realJSOP28-Dec-09 9:41
mve#realJSOP28-Dec-09 9:41 
QuestionRegistry Pin
sanforjackass28-Dec-09 7:39
sanforjackass28-Dec-09 7:39 
QuestionCreating a Class that can be a list? Pin
bbranded28-Dec-09 5:20
bbranded28-Dec-09 5:20 
Hello,

I'm a little lost as to how to write a class that will take in arguments from the .Add function of a List<>.

With reference to this thread, I have written the following class.


public class SnapShot
   {
       private DateTime m_SnapShotDateTime;

       public DateTime SnapShotDateTime
       {
           get
           {
               return m_SnapShotDateTime;
           }
           set
           {
               m_SnapShotDateTime = value;
           }

       }

       private long m_BPSAverage;

       public long BPSAverage
       {
           get
           {
               return m_BPSAverage;
           }
           set
           {
               m_BPSAverage = value;
           }
       }

       public SnapShot(DateTime snapshotdatetime, long bpsaverage)
       {
           m_SnapShotDateTime = snapshotdatetime;
           m_BPSAverage = bpsaverage;
       }

   }



I have created a List and would like to use the .Add function to add "entries" for .SnapShot(DateTime snapshotdatetime, long bpsaverage).

SnapShot LiveSnapshot;
List<SnapShot> LiveSnapshotList = new List<SnapShot>();

//LiveSnapshotList.Add();



How do I properly write the class so that it handles the .Add function of the List? Or should I be calling .Add with some other overload value?


Thanks,

Matt
AnswerRe: Creating a Class that can be a list? Pin
Luc Pattyn28-Dec-09 5:37
sitebuilderLuc Pattyn28-Dec-09 5:37 
GeneralRe: Creating a Class that can be a list? Pin
bbranded28-Dec-09 5:40
bbranded28-Dec-09 5:40 
GeneralRe: Creating a Class that can be a list? Pin
Luc Pattyn28-Dec-09 7:13
sitebuilderLuc Pattyn28-Dec-09 7:13 
GeneralRe: Creating a Class that can be a list? Pin
DaveyM6928-Dec-09 10:23
professionalDaveyM6928-Dec-09 10:23 
GeneralRe: Creating a Class that can be a list? Pin
ProtoBytes28-Dec-09 12:14
ProtoBytes28-Dec-09 12:14 
GeneralRe: Creating a Class that can be a list? Pin
Luc Pattyn28-Dec-09 12:19
sitebuilderLuc Pattyn28-Dec-09 12:19 
AnswerRe: Creating a Class that can be a list? Pin
Saksida Bojan28-Dec-09 5:37
Saksida Bojan28-Dec-09 5:37 
AnswerRe: Creating a Class that can be a list? Pin
#realJSOP28-Dec-09 9:44
mve#realJSOP28-Dec-09 9:44 
QuestionFew questions Pin
Saksida Bojan28-Dec-09 5:04
Saksida Bojan28-Dec-09 5:04 
AnswerRe: Few questions Pin
ProtoBytes28-Dec-09 6:48
ProtoBytes28-Dec-09 6:48 
GeneralRe: Few questions Pin
Saksida Bojan28-Dec-09 8:50
Saksida Bojan28-Dec-09 8:50 
GeneralRe: Few questions Pin
ProtoBytes28-Dec-09 9:15
ProtoBytes28-Dec-09 9:15 
AnswerRe: Few questions Pin
DaveyM6928-Dec-09 10:42
professionalDaveyM6928-Dec-09 10:42 
GeneralRe: Few questions Pin
Saksida Bojan28-Dec-09 11:33
Saksida Bojan28-Dec-09 11:33 
GeneralRe: Few questions Pin
ProtoBytes28-Dec-09 12:12
ProtoBytes28-Dec-09 12:12 
QuestionNetwork permission for Windows service Pin
Priya Prk28-Dec-09 4:56
Priya Prk28-Dec-09 4:56 
AnswerRe: Network permission for Windows service Pin
Blikkies28-Dec-09 5:33
professionalBlikkies28-Dec-09 5:33 

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.