Exemple #1
0
 public virtual void VisitStructDeclaration(StructDeclaration structDeclaration)
 {
     VisitTypeDeclaration(structDeclaration);
     VisitMemberContainer(structDeclaration);
     VisitParametrableType(structDeclaration);
     VisitTypeDeclarationContainer(structDeclaration);
     VisitCollection(structDeclaration.Implements);
 }
        protected virtual void Write(IndentedTextWriter writer, StructDeclaration type)
        {
            writer.Write("struct ");
            WriteIdentifier(writer, type.Name);
            WriteGenericParameters(writer, type);

            var baseTypes = type.Implements;

            if (baseTypes.Any())
            {
                writer.Write(" : ");
                Write(writer, baseTypes, ", ");
            }

            writer.WriteLine();
            WriteGenericParameterConstraints(writer, type);

            writer.WriteLine("{");
            writer.Indent++;
            WriteLines(writer, type.Members.Cast <CodeObject>().Concat(type.Types), endOfLine: null);
            writer.Indent--;
            writer.WriteLine("}");
        }
 public override void VisitStructDeclaration(StructDeclaration structDeclaration)
 {
     structDeclaration.Members.Sort(MemberComparer.Instance);
     base.VisitStructDeclaration(structDeclaration);
 }