Ejemplo n.º 1
0
        public SetFirstCommand(List <PrimitiveBox> realPrims, PrimitiveBox prim)
        {
            Primitive = prim;
            var prim0 = realPrims.FirstOrDefault(x => x.InstPtr == 0);

            Old0       = prim0;
            OldPtr     = Primitive.InstPtr;
            FromFalse  = new List <PrimitiveBox>();
            FromTrue   = new List <PrimitiveBox>();
            FromFalse0 = new List <PrimitiveBox>();
            FromTrue0  = new List <PrimitiveBox>();

            foreach (var from in realPrims)
            {
                if (from.TrueUI == prim)
                {
                    FromTrue.Add(from);
                }
                if (from.FalseUI == prim)
                {
                    FromFalse.Add(from);
                }
                if (from.TrueUI == prim0)
                {
                    FromTrue0.Add(from);
                }
                if (from.FalseUI == prim0)
                {
                    FromFalse0.Add(from);
                }
            }
        }
Ejemplo n.º 2
0
        public void SetActivePrimitive(PrimitiveBox prim)
        {
            if (InvokeRequired)
            {
                //HasGameThread = true;

                new Thread(() =>
                {
                    var del = new SetActiveDelegate(SetActivePrimitive);
                    Invoke(del, new object[] { prim });
                }).Start();
                //HasGameThread = false;
            }
            else
            {
                if (prim == ActivePrim)
                {
                    return;
                }
                var panel = OperandEditTable;
                panel.Controls.Clear();
                panel.RowCount = 0;
                panel.RowStyles.Clear();
                if (prim == null || prim.Descriptor == null)
                {
                    return;
                }
                ActivePrim = prim;
                for (int i = 0; i < 10; i++)
                {
                    panel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
                }
                prim.Descriptor.PopulateOperandView(this, EditorCont.Scope, panel);
            }
        }
Ejemplo n.º 3
0
 public ChangePointerCommand(PrimitiveBox instUI, PrimitiveBox destUI, bool trueBranch)
 {
     InstUI     = instUI;
     DestUI     = destUI;
     OldDestUI  = trueBranch ? instUI.TrueUI : instUI.FalseUI;
     TrueBranch = trueBranch;
 }
Ejemplo n.º 4
0
 public UpdateBoxPosCommand(PrimitiveBox box)
 {
     Box        = box;
     BeforePos  = new Point(box.TreeBox.X, box.TreeBox.Y);
     BeforeSize = new Point(box.TreeBox.Width, box.TreeBox.Height);
     AfterPos   = box.Position.ToPoint();
     AfterSize  = new Point(box.Width, box.Height);
 }
Ejemplo n.º 5
0
        public RemovePrimCommand(List <PrimitiveBox> prims, PrimitiveBox prim)
        {
            Primitive = prim;
            FromFalse = new List <PrimitiveBox>();
            FromTrue  = new List <PrimitiveBox>();

            foreach (var from in prims)
            {
                if (from.TrueUI == prim)
                {
                    FromTrue.Add(from);
                }
                if (from.FalseUI == prim)
                {
                    FromFalse.Add(from);
                }
            }
        }
Ejemplo n.º 6
0
 public OpModifyCommand(PrimitiveBox prim, byte[] newOp)
 {
     Prim  = prim;
     NewOp = newOp;
     OldOp = prim.Instruction.Operand;
 }
Ejemplo n.º 7
0
 public AddPrimCommand(PrimitiveBox prim)
 {
     NewPrimitive = prim;
 }
Ejemplo n.º 8
0
 public ToggleBreakpointCommand(PrimitiveBox instUI)
 {
     InstUI = instUI;
 }
Ejemplo n.º 9
0
 public CommentModifyCommand(PrimitiveBox box, string value)
 {
     Box        = box;
     OldComment = box.TreeBox.Comment;
     NewComment = value;
 }