public virtual void WriteTo(TranslationWriter writer)
 {
     writer.WriteToTranslation(" (");
     _exceptionTypeTranslation.WriteTo(writer);
     writer.WriteSpaceToTranslation();
     writer.WriteToTranslation(_variableName, Variable);
     writer.WriteToTranslation(')');
 }
예제 #2
0
            public void WriteTo(TranslationWriter writer)
            {
                if (_typeNameTranslation != null)
                {
                    _typeNameTranslation.WriteTo(writer);
                    writer.WriteSpaceToTranslation();
                }

                writer.WriteToTranslation(_parameterName, Variable);
            }
예제 #3
0
        public void WriteTo(TranslationWriter writer)
        {
            writer.WriteKeywordToTranslation(_throw);

            if (_thrownItemTranslation == null)
            {
                return;
            }

            writer.WriteSpaceToTranslation();
            _thrownItemTranslation.WriteTo(writer);
        }
예제 #4
0
            public override void WriteTo(TranslationWriter writer)
            {
                WriteIfStatement(writer);
                writer.WriteNewLineToTranslation();
                writer.WriteControlStatementToTranslation("else");

                if (_isElseIf)
                {
                    writer.WriteSpaceToTranslation();
                }

                IfFalseTranslation.WriteTo(writer);
            }
예제 #5
0
        public void WriteTo(TranslationWriter writer)
        {
            _initializers.IsLongTranslation = TranslationSize > 40;

            writer.WriteNewToTranslation();

            if (_typeName.Length != 0)
            {
                writer.WriteTypeNameToTranslation(_typeName);
                writer.WriteSpaceToTranslation();
            }

            _initializers.WriteTo(writer);
        }
            protected override void WriteStatementTo(TranslationWriter writer)
            {
                if (_typeNameTranslation != null)
                {
                    _typeNameTranslation.WriteTo(writer);
                }
                else
                {
                    writer.WriteKeywordToTranslation(_var);
                }

                writer.WriteSpaceToTranslation();

                base.WriteStatementTo(writer);
            }
        public void WriteTo(TranslationWriter writer)
        {
            if (_isEmpty)
            {
                return;
            }

            if (_hasVariables)
            {
                foreach (var parametersByType in _variables)
                {
                    var parametersType = parametersByType.Key;
                    var parameters     = parametersByType.Value;

                    parametersType.WriteTo(writer);
                    writer.WriteSpaceToTranslation();
                    parameters.WriteTo(writer);
                    writer.WriteToTranslation(';');
                    writer.WriteNewLineToTranslation();
                }

                switch (_statements[0].NodeType)
                {
                case Conditional when !_statements[0].Expression.IsTernary():
                case Switch:
                    writer.WriteNewLineToTranslation();
                    break;
                }
            }

            for (var i = 0; ;)
            {
                _statements[i].WriteTo(writer);

                ++i;

                if (i == _statementCount)
                {
                    break;
                }

                writer.WriteNewLineToTranslation();
            }
        }
예제 #8
0
            public void WriteTo(TranslationWriter writer)
            {
                writer.WriteKeywordToTranslation(_out);

                if (_declareParameterInline)
                {
                    if (_typeNameTranslation != null)
                    {
                        _typeNameTranslation.WriteTo(writer);
                        writer.WriteSpaceToTranslation();
                    }
                    else
                    {
                        writer.WriteKeywordToTranslation(_var);
                    }
                }

                _parameterTranslation.WriteTo(writer);
            }
 public void WriteTo(TranslationWriter writer)
 {
     writer.WriteSpaceToTranslation();
     _exceptionTypeTranslation.WriteInParentheses(writer);
 }