Exemple #1
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            var childIndex       = 0;
            var numberOfChildren = Children.Count;

            writer.Write("{{");

            if (numberOfChildren > 0)
            {
                writer.Newline();
                writer.Indent();

                foreach (var child in Children)
                {
                    child.Write(writer);
                    childIndex++;

                    if (childIndex > 0 && childIndex < numberOfChildren)
                    {
                        writer.Write(",");
                    }
                    writer.Newline();
                }

                writer.Unindent();
                writer.WriteWithIndentation("}}");
            }
            else
            {
                writer.Write("}}");
            }
        }
Exemple #2
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            base.Write(writer);
            if (_extensions.Count > 0)
            {
                writer.Newline();
                IndentMultiple(writer, 3);
                writer.WriteWithIndentation(".extend({{");
                writer.Newline();
                writer.Indent();

                foreach (var extension in _extensions)
                {
                    if (extension != _extensions[0])
                    {
                        writer.Write(",");
                        writer.Newline();
                    }
                    writer.WriteWithIndentation("{0} : {1}", extension.Name, extension.Options);
                }
                writer.Unindent();
                writer.Newline();
                writer.WriteWithIndentation("}})");
                UnindentMultiple(writer, 3);
            }
        }
Exemple #3
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            var childIndex = 0;
            var numberOfChildren = Children.Count;

            writer.Write("{{");

            if (numberOfChildren > 0)
            {
                writer.Newline();
                writer.Indent();

                foreach (var child in Children)
                {
                    child.Write(writer);
                    childIndex++;

                    if (childIndex > 0 && childIndex < numberOfChildren)
                        writer.Write(",");
                    writer.Newline();
                }

                writer.Unindent();
                writer.WriteWithIndentation("}}");
            }
            else
            {
                writer.Write("}}");
            }
        }
Exemple #4
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            base.Write(writer);
            if( _extensions.Count > 0 )
            {
                writer.Newline();
                IndentMultiple(writer, 3);
                writer.WriteWithIndentation(".extend({{");
                writer.Newline();
                writer.Indent();

                foreach (var extension in _extensions)
                {
                    if (extension != _extensions[0])
                    {
                        writer.Write(",");
                        writer.Newline();
                    }
                    writer.WriteWithIndentation("{0} : {1}", extension.Name, extension.Options);
                }
                writer.Unindent();
                writer.Newline();
                writer.WriteWithIndentation("}})");
                UnindentMultiple(writer, 3);
            }
        }
Exemple #5
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.WriteWithIndentation("{0} = ", Name);
            if( Value != null ) Value.Write(writer);
            writer.Write(";");
            writer.Newline();
        }
Exemple #6
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.WriteWithIndentation("Bifrost.namespace(\"{0}\", ", Name);
            Content.Write(writer);
            writer.WriteWithIndentation(");");
            writer.Newline();
        }
Exemple #7
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.WriteWithIndentation("Bifrost.namespace(\"{0}\", ", Name);
            Content.Write(writer);
            writer.WriteWithIndentation(");");
            writer.Newline();
        }
Exemple #8
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.WriteWithIndentation("this.{0} = ", Name);
            if (Value != null)
            {
                Value.Write(writer);
            }
            writer.Write(";");
            writer.Newline();
        }
Exemple #9
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            foreach (var child in Children)
            {
                writer.WriteWithIndentation("{0}.", Name);
                child.Write(writer);
                writer.Write(";");
                writer.Newline();
            }
        }
Exemple #10
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            foreach (var child in Children)
            {
                writer.WriteWithIndentation("{0}.", Name);
                child.Write(writer);
                writer.Write(";");
                writer.Newline();
            }
        }
Exemple #11
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.WriteWithIndentation("{0}", Name);
            if (Child != null)
            {
                writer.Write(".");
                Child.Write(writer);
            }

            writer.Newline();
        }
Exemple #12
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.WriteWithIndentation("{0}", Name);
            if (Child != null)
            {
                writer.Write(".");
                Child.Write(writer);
            }

            writer.Newline();
        }
Exemple #13
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.Write("function(");
            for (var parameterIndex = 0; parameterIndex < Parameters.Length; parameterIndex++)
            {
                if (parameterIndex != 0)
                    writer.Write(", ");

                writer.Write(Parameters[parameterIndex]);
            }
            writer.Write(") {{");
            writer.Newline();
            Body.Write(writer);
            writer.WriteWithIndentation("}}");
        }
Exemple #14
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.Write("function(");
            for (var parameterIndex = 0; parameterIndex < Parameters.Length; parameterIndex++)
            {
                if (parameterIndex != 0)
                {
                    writer.Write(", ");
                }

                writer.Write(Parameters[parameterIndex]);
            }
            writer.Write(") {{");
            writer.Newline();
            Body.Write(writer);
            writer.WriteWithIndentation("}}");
        }
Exemple #15
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.WriteWithIndentation("return ");
            ReturnValue.Write(writer);
            writer.Newline();
        }
Exemple #16
0
#pragma warning disable 1591
        public override void Write(ICodeWriter writer)
        {
            writer.WriteWithIndentation("return ");
            ReturnValue.Write(writer);
            writer.Newline();
        }