Hello,

I already wrote an email and then found this small discussion area...

I am looking for a simple way saving my method instructions into a file, so 
I can load them up and use them later on.


I found a solution to save the opcodes using basic reflection:


    [Serializable]

    public class Instruction

    {

        private string _opcode;

        

        public OpCode OpCode 

        {

            get

            {

                return

                    typeof (OpCodes).GetFields(BindingFlags.Static | 
BindingFlags.Public)

                        .Where(x => x.FieldType == typeof (OpCode))

                        .Select(x => (OpCode) x.GetValue(null))

                        .First(x => x.Name == _opcode);

            }

            set

            {

                _opcode = value.Name;

            } 

        }

    }


But since the operands can have multiple types, is it possible to save them?
Since the Instructions etc. are not serializable, I can’t save the raw 
property, I have to convert it somehow.

Thanks in advance! 


Jannik

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to