private void openFileDialog_FileOk(object sender, CancelEventArgs e) { XmlSerializer reader = new XmlSerializer(typeof(FigureList)); StreamReader file = new StreamReader(openFileDialog.FileName); figlst = (FigureList)reader.Deserialize(file); figlst.holst = GpanelHolst; figlst.DrawList(); }
private void panelHolst_MouseUp(object sender, MouseEventArgs e) { pointEnd.X = MousePosition.X - this.Location.X - panelHolst.Location.X - 4; pointEnd.Y = MousePosition.Y - this.Location.Y - panelHolst.Location.Y - 19; ConstructorInfo inf = currentFigure.GetConstructor(new Type[] { }); var instance = (Figure)inf.Invoke(new object[] { }); instance.pointBegin = pointBegin; instance.pointEnd = pointEnd; figlst.addToList(instance); figlst.DrawList(); }