Example #1
0
        /// <summary>
        /// Set the access flags of the created field.
        /// </summary>
        protected virtual void SetAccessFlags(DexLib.FieldDefinition dfield, FieldDefinition field)
        {
            // subclass accesses have already been fixed on an actual use basis.
            if (field.IsPrivate)
                dfield.IsPrivate = true;
            else if (field.IsFamily || field.IsFamilyOrAssembly) 
                dfield.IsProtected = true;
            else
                dfield.IsPublic = true;

            if (field.IsInitOnly) dfield.IsFinal = true;
            if (field.IsStatic) dfield.IsStatic = true;

            if (field.IsCompilerGenerated())
                dfield.IsSynthetic = true;

            dfield.IsVolatile = field.IsUsedInInterlocked || IsVolatile(field); ;
        }