Example #1
0
 void AddNestedSiblingTypes(InterfaceGen iface, CodeGenerationOptions opt, CodeGeneratorContext context, GenerationInfo genInfo)
 {
     // Generate sibling types for nested types we don't want to nest
     foreach (var nest in iface.NestedTypes.Where(t => t.Unnest))
     {
         pre_sibling_types.Add(SourceWriterExtensions.BuildManagedTypeModel(nest, opt, context, genInfo));
     }
 }
Example #2
0
 void AddNestedTypes(InterfaceGen iface, CodeGenerationOptions opt, CodeGeneratorContext context, GenerationInfo genInfo)
 {
     // Generate nested types for supported nested types.  This is a new addition in C#8.
     // Prior to this, types nested in an interface had to be generated as sibling types.
     // The "Unnest" property is used to support backwards compatibility with pre-C#8 bindings.
     foreach (var nest in iface.NestedTypes.Where(t => !t.Unnest))
     {
         NestedTypes.Add(SourceWriterExtensions.BuildManagedTypeModel(nest, opt, context, genInfo));
     }
 }
Example #3
0
        void AddNestedTypes(ClassGen klass, CodeGenerationOptions opt, CodeGeneratorContext context, GenerationInfo genInfo)
        {
            foreach (var nest in klass.NestedTypes)
            {
                if (klass.BaseGen?.ContainsNestedType(nest) == true && nest is ClassGen c)
                {
                    c.NeedsNew = true;
                }

                NestedTypes.Add(SourceWriterExtensions.BuildManagedTypeModel(nest, opt, context, genInfo));
            }
        }