Example #1
0
        /// <summary>
        /// Update names where needed
        /// </summary>
        protected void FinalizeNames(NetTypeDefinition typeDef, TargetFramework target, MethodRenamer methodRenamer)
        {
            if (methodBuilders != null)
            {
                methodBuilders.ForEach(x => x.FinalizeNames(target, methodRenamer));
            }
            nestedTypeBuilders.ForEach(x => x.FinalizeNames(target, methodRenamer));

            //FixMemberNames(typeDef, typeDef.Methods, typeDef.NestedTypes, (m, n) => methodRenamer.Rename(m, n));
            FixMemberNames(typeDef, typeDef.Fields, typeDef.NestedTypes, (m, n) => m.Name = n);
            FixMemberNames(typeDef, typeDef.Fields, typeDef.Methods, (m, n) => m.Name     = n);
            FixMemberNames(typeDef, typeDef.Fields, typeDef.Fields, (m, n) => m.Name      = n);

            // Build properties
            propertyBuilder = CreatePropertyBuilder(typeDef);
            propertyBuilder.BuildProperties(target, methodRenamer);

            typeDef.EnsureVisibility();
        }
Example #2
0
        /// <summary>
        /// Implement interface members
        /// </summary>
        protected void Finalize(NetTypeDefinition typeDef, TargetFramework target, FinalizeStates state)
        {
            if (typeDef.IsInterface)
            {
                return;
            }

            // Fixup visibility
            typeDef.EnsureVisibility();

            if (state != FinalizeStates.AddRemoveMembers)
            {
                return;
            }

            // Cleanup
            RemoveAbstractOverrides(typeDef);

            // Add interface methods
            AddAbstractInterfaceMethods(typeDef, target);
        }
Example #3
0
 /// <summary>
 /// Make sure that base types are visible.
 /// </summary>
 public override void FinalizeVisibility(TargetFramework target)
 {
     typeDef.EnsureVisibility();
 }