Exemplo n.º 1
0
        /// <summary>
        /// Set the access flags of the created field.
        /// </summary>
        protected virtual void SetAccessFlags(DexLib.FieldDefinition dfield, FieldDefinition field)
        {
            if (field.IsPrivate) dfield.IsPrivate = true;
            if (field.IsProtected) dfield.IsProtected = true;
            if (field.IsPublic) dfield.IsPublic = true;

            if (field.IsFinal) dfield.IsFinal = true;
            if (field.IsStatic) dfield.IsStatic = true;
            if (field.IsTransient) dfield.IsTransient = true;
            if (field.IsVolatile) dfield.IsVolatile = true;
            if (field.IsSynthetic) dfield.IsSynthetic = true;
            if (field.IsEnum) dfield.IsEnum = true;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Set the access flags of the created field.
        /// </summary>
        protected virtual void SetAccessFlags(DexLib.FieldDefinition dfield, FieldDefinition field)
        {
            if (field.IsPrivate)
            {
                dfield.IsPrivate = true;
            }
            if (field.IsProtected)
            {
                dfield.IsProtected = true;
            }
            if (field.IsPublic)
            {
                dfield.IsPublic = true;
            }

            if (field.IsFinal)
            {
                dfield.IsFinal = true;
            }
            if (field.IsStatic)
            {
                dfield.IsStatic = true;
            }
            if (field.IsTransient)
            {
                dfield.IsTransient = true;
            }
            if (field.IsVolatile)
            {
                dfield.IsVolatile = true;
            }
            if (field.IsSynthetic)
            {
                dfield.IsSynthetic = true;
            }
            if (field.IsEnum)
            {
                dfield.IsEnum = true;
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Default ctor
 /// </summary>
 protected FieldBuilder(AssemblyCompiler compiler, FieldDefinition field)
 {
     this.compiler = compiler;
     this.field    = field;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public static FieldBuilder Create(AssemblyCompiler compiler, FieldDefinition field)
 {
     return(new FieldBuilder(compiler, field));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Set the value of the given dex field.
 /// </summary>
 protected virtual void SetFieldValue(DexLib.FieldDefinition dfield, FieldDefinition field)
 {
     dfield.Value = field.ConstantValue;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Set the field type of the given dex field.
 /// </summary>
 protected virtual void SetFieldType(DexLib.FieldDefinition dfield, FieldDefinition field, DexTargetPackage targetPackage)
 {
     dfield.Type = field.FieldType.GetReference(XTypeUsageFlags.FieldType, targetPackage, compiler.Module);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Default ctor
 /// </summary>
 protected FieldBuilder(AssemblyCompiler compiler, FieldDefinition field)
 {
     this.compiler = compiler;
     this.field = field;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public static FieldBuilder Create(AssemblyCompiler compiler, FieldDefinition field)
 {
     return new FieldBuilder(compiler, field);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Set the value of the given dex field.
 /// </summary>
 protected virtual void SetFieldValue(DexLib.FieldDefinition dfield, FieldDefinition field)
 {
     dfield.Value = field.ConstantValue;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Set the field type of the given dex field.
 /// </summary>
 protected virtual void SetFieldType(DexLib.FieldDefinition dfield, FieldDefinition field, DexTargetPackage targetPackage)
 {
     dfield.Type = field.FieldType.GetReference(XTypeUsageFlags.FieldType, targetPackage, compiler.Module);            
 }