Exemple #1
0
        public override void ToSource(StringBuilder sb)
        {
            identifier.ToSource(sb);

            if (IsGeneric)
            {
                generic.ToSource(sb);
            }

            if (isNullableType)
            {
                sb.Append("?");
            }

            if (rankSpecifiers.Count > 0)
            {
                foreach (int val in rankSpecifiers)
                {
                    sb.Append("[");
                    for (int i = 0; i < val; i++)
                    {
                        sb.Append(",");
                    }
                    sb.Append("]");
                }
            }
        }
        public override void ToSource(StringBuilder sb)
        {
            sb.Append("[");
            if (modifiers != Modifier.Empty)
            {
                TraceModifiers(Modifiers, sb);
                sb.Append(": ");
            }
            name.ToSource(sb);

            if (arguments != null)
            {
                sb.Append("(");
                arguments.ToSource(sb, ", ");
                sb.Append(")");
            }
            sb.Append("]");
            NewLine(sb);
        }
        public override void ToSource(StringBuilder sb)
        {
            sb.Append(IdentNewLine(DocComment));

            if (name != null)
            {
                if (attributes != null)
                {
                    attributes.ToSource(sb);
                }

                sb.Append("namespace ");
                name.ToSource(sb);
                NewLine(sb);
                sb.Append("{");
                indent++;
                NewLine(sb);
            }

            if (ExternAliases.Count > 0)
            {
                ExternAliases.ToSource(sb);
                NewLine(sb);
            }

            if (UsingDirectives.Count > 0)
            {
                UsingDirectives.ToSource(sb);
                NewLine(sb);
            }

            if (name == null)
            {
                if (attributes != null)
                {
                    attributes.ToSource(sb);
                }
            }

            if (namespaces != null)
            {
                namespaces.ToSource(sb);
            }

            if (interfaces != null)
            {
                interfaces.ToSource(sb);
            }

            if (classes != null)
            {
                classes.ToSource(sb);
            }

            if (structs != null)
            {
                structs.ToSource(sb);
            }

            if (delegates != null)
            {
                delegates.ToSource(sb);
            }

            if (enums != null)
            {
                enums.ToSource(sb);
            }

            if (name != null)
            {
                indent--;
                NewLine(sb);
                sb.Append("}");
                NewLine(sb);
            }
        }