System.Xml.Xsl.Runtime.StringConcat.GetResult C# (CSharp) Method

GetResult() public method

Get the result string.
public GetResult ( ) : string
return string
        public string GetResult() {
            switch (this.idxStr) {
                case 0: return string.Empty;
                case 1: return this.s1;
                case 2: return string.Concat(this.s1, this.s2);
                case 3: return string.Concat(this.s1, this.s2, this.s3);
                case 4: return string.Concat(this.s1, this.s2, this.s3, this.s4);
            }
            return string.Concat(this.strList.ToArray());
        }

Usage Example

        protected override QilNode VisitStrConcat(QilStrConcat local0) {
            QilNode local1 = local0[0];
            QilNode local2 = local0[1];
            if (this[XmlILOptimization.FoldNone]) {
                if ( (object) ( (local1).XmlType ) == (object) XmlQueryTypeFactory.None ) {
                    if (AllowReplace(XmlILOptimization.FoldNone, local0)) {
                        return Replace(XmlILOptimization.FoldNone, local0, VisitNop(f.Nop(local1)));
                    }
                }
            }
            if (this[XmlILOptimization.FoldNone]) {
                if ( (object) ( (local2).XmlType ) == (object) XmlQueryTypeFactory.None ) {
                    if (AllowReplace(XmlILOptimization.FoldNone, local0)) {
                        return Replace(XmlILOptimization.FoldNone, local0, VisitNop(f.Nop(local2)));
                    }
                }
            }
            if (( ( (local2).XmlType ).IsSingleton ) && (this[XmlILOptimization.EliminateStrConcatSingle])) {
                if (AllowReplace(XmlILOptimization.EliminateStrConcatSingle, local0)) {
                    return Replace(XmlILOptimization.EliminateStrConcatSingle, local0, VisitNop(f.Nop(local2)));
                }
            }
            if (this[XmlILOptimization.EliminateStrConcat]) {
                if (local1.NodeType == QilNodeType.LiteralString) {
                    string local3 = (string)((QilLiteral)local1).Value;
                    if (local2.NodeType == QilNodeType.Sequence) {
                        if ( AreLiteralArgs(local2) ) {
                            if (AllowReplace(XmlILOptimization.EliminateStrConcat, local0)) {
                                
    // Concatenate all constant arguments
    StringConcat concat = new StringConcat();
    concat.Delimiter = local3;

    foreach (QilLiteral lit in local2)
        concat.Concat((string) lit);
return Replace(XmlILOptimization.EliminateStrConcat, local0, VisitLiteralString(f.LiteralString( concat.GetResult() )));
                            }
                        }
                    }
                }
            }
            return NoReplace(local0);
        }