public Rectangles_GUI(byte size = 0) { rectangles = new Rectangle_GUI[size]; for (int i = 0; i < size; i++) { rectangles[i] = new Rectangle_GUI(); } }
public void Load(string filePath) { FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read); BinaryReader binaryReader = new BinaryReader(fileStream, Encoding.UTF8); rectangles = new Rectangle_GUI[fileStream.Length / sizeof(double) / 2]; for (int i = 0; i < rectangles.Length; i++) { rectangles[i] = new Rectangle_GUI(); rectangles[i].Load(ref binaryReader); } currentElement = (byte)rectangles.Length; binaryReader.Close(); fileStream.Close(); }