For more examples check out the Tests in the source code.

Array example

string path = AppDomain.CurrentDomain.BaseDirectory;
var testList = new mAdcOW.DataStructures.Array<int>(10, path); // 10 items
testList[5] = 12;
int num = testList[5];
testList.AutoGrow = true;
testList[200] = 200; // will grow the array


List example

string path = AppDomain.CurrentDomain.BaseDirectory;
var testList = new mAdcOW.DataStructures.List<int>(1024, path);
testList.Add(12);
int num = testList[0];


Dictionary example

string path = AppDomain.CurrentDomain.BaseDirectory;
var dict = new mAdcOW.DataStructures.Dictionary<int, int>(path);
dict[0] = 0;
int num;
dict.TryGetValue(0, out num);


Serializer Factory

Factory<UnknownSizeClass> factory = new Factory<UnknownSizeClass>();
var serializer = factory.GetSerializer();
var myObj = new UnknownSizeClass();
byte[] bytes = serializer.ObjectToBytes(myObj);
var newObj = serializer.BytesToObject(bytes);

Last edited Nov 12, 2009 at 7:57 PM by Wobba, version 2

Comments

No comments yet.