Define an objectcollection

Source: Internet
Author: User

Using system;

Using system. collections;

Namespace livechain. CSW. commondata
{

Public class childdata

{

// Only property

}

Public class childdatacollection: system. Collections. collectionbase, system. componentmodel. ilistsource
{
// String fullname = "livechain. CSW. commondata. childdata ";
Public childdata this [int Index]
{
Get
{
Return (childdata) list [Index]);
}
Set
{
List [Index] = value;
}
}

Public childdata this [String childid]
{
Get
{
Foreach (childdata child in List)
{
If (child. childid = childid)
Return child;
}
// If can't find the child, return NULL;
Return new childdata ();
}
}

Public int add (childdata value)
{
Return (list. Add (value ));
}

Public int indexof (childdata value)
{
Return (list. indexof (value ));
}

Public void insert (INT index, childdata value)
{
List. insert (index, value );
}

Public void remove (childdata value)
{
List. Remove (value );
}

Public bool contains (childdata value)
{
// If value is not of Type childdata, this will return false.
Return (list. Contains (value ));
}

# Region ilistsource Member

Public ilist getlist ()
{
// Todo: Add studentdatacollection. getlist
Return this. List;
}

Public bool containslistcollection
{
Get
{
// Todo: Add studentdatacollection. containslistcollection getter implementation
Return false;
}
}

# Endregion
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.