Example #1
0
        //================================================================IO===========================================================

        public override void SaveAll(IO.ComponentData Compound)
        {
            base.SaveAll(Compound);

            Compound.Add("J1", J1.ID);
            Compound.Add("J2", J2.ID);

            Compound.Add("Resistance", Resistance);
            Compound.Add("IsConnected", IsConnected);
            Compound.Add("Direction", direction.GetHashCode());

            Compound.Add("SendingVoltage", sendingVoltage);
            Compound.Add("SendingCurrent", sendingCurrent);
            Compound.Add("CanSendVoltage", CanSendVoltageOrCurrent);

            if (Graphics.Visible)
            {
                String d = "";
                var    g = Graphics as Graphics.WireGraphics;
                for (int i = 0; i < g.DrawPath.Count; i++)
                {
                    d += g.DrawPath[i].X.ToString() + ";" + g.DrawPath[i].Y.ToString() + ";";
                }
                d = d.Substring(0, d.Length - 1);
                Compound.Add("DrawPath", d);
            }
        }