|
using System;
using System.Collections.Generic;
using System.Web;
/// <summary>
/// Summary description for MyObjectsList
/// </summary>
public class MyObjectsList
{
private static List<MyObject> _myObjects;
static MyObjectsList()
{
_myObjects = new List<MyObject>();
Random rnd = new Random();
for (int i = 0; i < 5; i++)
{
_myObjects.Add(new MyObject(i, rnd.Next(10, 100) ,rnd.Next(10, 100), rnd.Next(10, 100)));
}
}
public List<MyObject> GetObjects()
{
return _myObjects;
}
public void UpdateObject(MyObject obj)
{
MyObject o = _myObjects.Find(delegate(MyObject myO) { return myO.ID == obj.ID; });
o.Height = obj.Height;
o.Width = obj.Width;
o.Depth = obj.Depth;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Fascinated by good architectures, well thought classes and clean code. I work as a software developer since 2004.