public void Deserealize(SerializationInfo info, StreamingContext context) { BeginPoint = (Point)info.GetValue("BeginPoint", BeginPoint.GetType()); LastLocation = (Point)info.GetValue("LastLocation", LastLocation.GetType()); EndPoint = (Point)info.GetValue("EndPoint", EndPoint.GetType()); // calculate = (ICalculate)info.GetValue("calculate", calculate.GetType()); // variable = (IVariable)info.GetValue("variable", variable.GetType()); }
public Edge(SerializationInfo info, StreamingContext context) { FlagVisible = 0; region = new Region(); ForInvalidate = new GraphicsPath(); variable = null; calculate = null; pen = new Pen(Color.Black, 7); PathLine = new GraphicsPath(); BeginEllips = new GraphicsPath(); EndEllips = new GraphicsPath(); BeginPoint = (Point)info.GetValue("BeginPoint", BeginPoint.GetType()); EndPoint = (Point)info.GetValue("EndPoint", EndPoint.GetType()); LastLocation = (Point)info.GetValue("LastLocation", LastLocation.GetType()); try { calculate = (ICalculate)info.GetValue("calculate", ((BaseControl)calculate).GetType()); } catch { calculate = null; } try { variable = (IVariable)info.GetValue("variable", variable.GetType()); } catch { variable = null; } BeginEllips.AddEllipse(BeginPoint.X - 10, BeginPoint.Y - 10, 20, 20); PathLine.AddLine(BeginPoint, EndPoint); EndEllips.AddEllipse(EndPoint.X - 10, EndPoint.Y - 10, 20, 20); if (Move != null) { Move(this, BeginPoint, EndPoint); } }