public void LOAD(MyFigureFactory factory, string filename, XmlReader rdr) { StreamReader reader = new StreamReader(filename); /*int count = System.IO.File.ReadAllLines(filename).Length; * for (int i = 0; i < count; i++) * { * string read; * read = reader.ReadLine(); * bool flag1 = false; * Figure figure = factory.createFigure(read, 0, 0); * if (figure != null) * { * * figure.load(reader, factory); * setFigure(figure); * } * * }*/ //int count = System.IO.File.ReadAllLines(filename)- 5; //for (int i = 0; i < count; i++) //{ //Строка для чтения string read = ""; read = reader.ReadLine(); //Пока файл читается while (rdr.Read()) { //Если встретился тег, тогда создаем соответвующую фигуру и загружаем ее в хранилище if (rdr.NodeType == XmlNodeType.Element && rdr.LocalName != "svg") { Figure figure = factory.createFigure(rdr.LocalName, 0, 0); figure.load(reader, factory, rdr); //Помещаем фигуру в хранилище setFigure(figure); } } notifyEveryine(); }
public override void load(StreamReader reader, FigureFactory factory, XmlReader rdr) { string count_; count_ = reader.ReadLine(); for (int i = 0; i < Convert.ToInt32(count_) * 6; i++) { string read; read = reader.ReadLine(); bool flag1 = false; Figure figure = factory.createFigure(read, 0, 0); if (figure == null) { flag1 = true; } if (flag1 == false) { { figure.load(reader, factory, rdr); add_toGroup(figure); } } } }
public override void load(StreamReader reader, FigureFactory factory, XmlReader rdr) { sticky.load(reader, factory, rdr); }