コード例 #1
0
 private static void AppendInteger(ref ReverseStringBuilder builder, int value)
 {
     while (value > 9)
     {
         builder.Append(GetIntegerChar(value % 10));
         value /= 10;
     }
     builder.Append(GetIntegerChar(value));
 }
コード例 #2
0
        private static string GenerateInstancePathString(List <InstancePathItem> instancePath, int parentInstanceIndex)
        {
            if (instancePath == null || instancePath.Count == 0)
            {
                return("");
            }
            int count = instancePath.Count;
            ReverseStringBuilder builder = new ReverseStringBuilder(count * 2 + 4);
            bool flag  = true;
            bool flag2 = true;
            bool flag3 = parentInstanceIndex >= 0;

            for (int num = count - 1; num >= 0; num--)
            {
                InstancePathItem instancePathItem = instancePath[num];
                switch (instancePathItem.m_indexType)
                {
                case InstancePathItemType.ColumnMemberInstanceIndexTopMost:
                case InstancePathItemType.ColumnMemberInstanceIndex:
                    if (flag3)
                    {
                        flag3 = false;
                        AppendInteger(ref builder, parentInstanceIndex);
                    }
                    else
                    {
                        AppendInteger(ref builder, instancePathItem.m_instanceIndex);
                    }
                    if (flag)
                    {
                        flag = false;
                        builder.Append('x');
                        AppendInteger(ref builder, instancePathItem.m_indexInCollection);
                    }
                    builder.Append('C');
                    break;

                case InstancePathItemType.RowMemberInstanceIndex:
                    if (flag3)
                    {
                        flag3 = false;
                        AppendInteger(ref builder, parentInstanceIndex);
                    }
                    else
                    {
                        AppendInteger(ref builder, instancePathItem.m_instanceIndex);
                    }
                    if (flag2)
                    {
                        flag2 = false;
                        builder.Append('x');
                        AppendInteger(ref builder, instancePathItem.m_indexInCollection);
                    }
                    builder.Append('R');
                    break;

                case InstancePathItemType.DataRegion:
                    AppendInteger(ref builder, instancePathItem.m_indexInCollection);
                    builder.Append('T');
                    break;

                case InstancePathItemType.SubReport:
                    AppendInteger(ref builder, instancePathItem.m_indexInCollection);
                    builder.Append('S');
                    break;
                }
            }
            return(builder.ToString());
        }