Exemple #1
0
        private void lbInstructions_SelectedIndexChanged(object sender, EventArgs e)
        {
            lbOverloads.Items.Clear();
            lblInstructionName.Text = "Instruction: ";

            if (lbInstructions.SelectedIndex != -1)
            {
                string inst = lbInstructions.SelectedItem.ToString();
                if (inst.StartsWith("(INCOMPATIBLE)"))
                {
                    inst = inst.Remove(0, "(INCOMPATIBLE)".Length);
                }

                FLInstructionCreator c = FindCreator(inst);
                string args            = c.GetArgumentSignatureForInstruction(inst);

                bool ret = SignatureParser.ParseCreatorSig(args, out List <InstructionArgumentSignature> sig);

                lblInstructionName.Text = "Instruction: " + inst;

                rtbInstructionDescription.Text = c.GetDescriptionForInstruction(inst);

                lbOverloads.Items.Clear();
                for (int i = 0; i < sig.Count; i++)
                {
                    lbOverloads.Items.Add(sig[i]);
                }
            }
        }
        private InstructionObject FormatInstruction(string name)
        {
            FLInstructionCreator creator = FindCreator(name);

            if (creator == null)
            {
                return(new InstructionObject
                {
                    Name = name,
                    Description = "unknown",
                    Parameters = ""
                });
            }

            return(new InstructionObject
            {
                Name = name,
                Description = creator.GetDescriptionForInstruction(name),
                Parameters = creator.GetArgumentSignatureForInstruction(name)
            });
        }