public void execute(string _classname, int _x, int _y, MyStorage _storage) { classname = _classname; x = _x; y = _y; storage = _storage; p = factory.createPoint(classname, x, y); i = storage.setObject(p); }
public override void load(StreamReader reader, CMyPointFactory factory) { string line = reader.ReadLine(); string[] split = line.Split(new Char[] { ' ', ',', '(', ')', '\n' }); count = Convert.ToInt32(split[3]); group = new CPoint[count]; for (int i = 0; i < count; i++) { line = reader.ReadLine(); group[i] = factory.createPoint(line); group[i].load(reader, factory); } }
public void loadFromFile(string file) { StreamReader reader = new StreamReader(file, System.Text.Encoding.Default); string line; line = reader.ReadLine(); string[] split = line.Split(new Char[] { ' ', ',', '(', ')', '\n' }); Count = Convert.ToInt32(split[3]); arr = new CPoint[Count]; CMyPointFactory factory = new CMyPointFactory(); for (int i = 0; i < Count; i++) { line = reader.ReadLine(); arr[i] = factory.createPoint(line); arr[i].load(reader, factory); } reader.Close(); notifyEveryone(); }