Beispiel #1
0
        private void AppendMembers(TypeScriptInterface tsInterface)
        {
            var appender = new MemberOutputAppender(Output, BaseIndentation + 4);

            foreach (var member in tsInterface.Members)
            {
                appender.AppendOutput(member);
            }
        }
Beispiel #2
0
        private void AppendMembers(TypeScriptInterface tsInterface, TypeScriptInterface owner = null)
        {
            int identation = 4;

            while (owner != null)
            {
                identation += 4;
                owner       = owner.Owner;
            }
            var appender = new MemberOutputAppender(Output, BaseIndentation + identation, Settings);

            foreach (TypeScriptInterfaceMember member in tsInterface.Members)
            {
                appender.AppendOutput(member);
            }
        }
        private void AppendMembers(
            StringBuilder output,
            int baseIndentation,
            TypeScriptInterface tsInterface)
        {
            var appender = new MemberOutputAppender(
                this.Settings,
                this.TypeContext);

            if (tsInterface.Fields != null)
            {
                foreach (var field in tsInterface.Fields)
                {
                    appender.AppendOutput(
                        output,
                        baseIndentation + 4,
                        field);
                }
            }

            if (tsInterface.Methods != null &&
                tsInterface.Methods.Any())
            {
                MethodAppender emptyAppender = new MethodAppender(
                    this.Settings,
                    this.TypeContext,
                    tsInterface.IsClass);
                foreach (TypeScriptMethod method in tsInterface.Methods)
                {
                    if (method.Appender != null)
                    {
                        method.Appender.AppendOutput(
                            output,
                            baseIndentation + 4,
                            method);
                    }
                    else
                    {
                        emptyAppender.AppendOutput(
                            output,
                            baseIndentation + 4,
                            method);
                    }
                }
            }
        }