Beispiel #1
0
        public LoadedModule(ModuleImage image)
        {
            Code              = image.Code.ToArray();
            EntryMethodIndex  = image.EntryMethodIndex;
            MethodRefs        = image.MethodRefs.ToArray();
            VariableRefs      = image.VariableRefs.ToArray();
            Methods           = image.Methods.ToArray();
            Constants         = new IValue[image.Constants.Count];
            Variables         = new VariablesFrame(image.Variables);
            ExportedProperies = image.ExportedProperties.ToArray();
            ExportedMethods   = image.ExportedMethods.ToArray();
            ModuleInfo        = image.ModuleInfo;
            LoadAddress       = image.LoadAddress;
            for (int i = 0; i < image.Constants.Count; i++)
            {
                var def = image.Constants[i];
                Constants[i] = ValueFactory.Parse(def.Presentation, def.Type);
            }

            // Resolve annotation constants
            for (int i = 0; i < Methods.Length; i++)
            {
                EvaluateAnnotationParametersValues(Methods[i].Signature.Annotations);
                for (int j = 0; j < Methods[i].Signature.ArgCount; j++)
                {
                    EvaluateAnnotationParametersValues(Methods[i].Signature.Params[j].Annotations);
                }
            }
        }
Beispiel #2
0
 internal LoadedModule(ModuleImage image)
 {
     this.Code              = image.Code.ToArray();
     this.EntryMethodIndex  = image.EntryMethodIndex;
     this.MethodRefs        = image.MethodRefs.ToArray();
     this.VariableRefs      = image.VariableRefs.ToArray();
     this.Methods           = image.Methods.ToArray();
     this.Constants         = new IValue[image.Constants.Count];
     this.Variables         = new VariablesFrame(image.Variables);
     this.ExportedProperies = image.ExportedProperties.ToArray();
     this.ExportedMethods   = image.ExportedMethods.ToArray();
     this.ModuleInfo        = image.ModuleInfo;
     for (int i = 0; i < image.Constants.Count; i++)
     {
         var def = image.Constants[i];
         this.Constants[i] = ValueFactory.Parse(def.Presentation, def.Type);
     }
 }
Beispiel #3
0
        public LoadedModule(ModuleImage image)
        {
            Code              = image.Code.ToArray();
            EntryMethodIndex  = image.EntryMethodIndex;
            MethodRefs        = image.MethodRefs.ToArray();
            VariableRefs      = image.VariableRefs.ToArray();
            Methods           = image.Methods.ToArray();
            Constants         = new IValue[image.Constants.Count];
            Variables         = new VariablesFrame(image.Variables);
            ExportedProperies = image.ExportedProperties.ToArray();
            ExportedMethods   = image.ExportedMethods.ToArray();
            ModuleInfo        = image.ModuleInfo;
            LoadAddress       = image.LoadAddress;
            for (int i = 0; i < image.Constants.Count; i++)
            {
                var def = image.Constants[i];
                Constants[i] = ValueFactory.Parse(def.Presentation, def.Type);
            }

            ResolveAnnotationConstants();
        }
Beispiel #4
0
 public bool AsBoolean()
 {
     return(ValueFactory.Parse(_value, DataType.Boolean).AsBoolean());
 }
Beispiel #5
0
 public DateTime AsDate()
 {
     return(ValueFactory.Parse(_value, DataType.Date).AsDate());
 }
Beispiel #6
0
 public decimal AsNumber()
 {
     return(ValueFactory.Parse(_value, DataType.Number).AsNumber());
 }