IEnumerable <MemberDeclarationSyntax> GetClassMemberDeclarations() { foreach (var d in NestedTypeInfos.SelectMany(x => x.Declarations)) { yield return(d); } foreach (var d in FieldInfos.SelectMany(x => x.Declarations)) { yield return(d); } if (HasDefaultConstructor) { yield return(DefaultConstructor); } if (IsGTypeStruct) { // taking advantage of the face that interfaces can't inherit, // so parent will always be GISharp.GObject.TypeInterface for // interfaces. if (GTypeStructParent == typeof(GISharp.GObject.TypeInterface)) { yield return(GetGTypeStructCreateInterfaceInfoMethod()); yield return(GetGTypeStructInterfaceInitMethod()); foreach (var m in GetGTypeInterfaceMethodImpls()) { yield return(m); } } else { yield return(GetGTypeStructGetInfoMethod()); } } foreach (var d in MethodInfos.SelectMany(x => x.Declarations)) { yield return(d); } }
IEnumerable <MemberDeclarationSyntax> GetStructMemberDeclarations() { return(NestedTypeInfos.SelectMany(x => x.Declarations) .Concat(FieldInfos.SelectMany(x => x.Declarations)) .Concat(MethodInfos.SelectMany(x => x.Declarations))); }