Microsoft.JScript.TypedArray.ToRankString C# (CSharp) Method

ToRankString() static private method

static private ToRankString ( int rank ) : String
rank int
return String
      static internal String ToRankString(int rank){
        switch(rank){
          case 1 : return "[]";
          case 2 : return "[,]";
          case 3 : return "[,,]";
          default:
            StringBuilder str = new StringBuilder(rank+1);
            str.Append('[');
            for (int i = 1; i < rank; i++) str.Append(',');
            str.Append(']');
            return str.ToString();
        }
      }
      

Usage Example

Example #1
0
        internal Type ToType()
        {
            if (!(this.expression is ConstantWrapper))
            {
                this.PartiallyEvaluate();
            }
            Object value  = this.expression.Evaluate();
            Type   result = null;

            if (value is ClassScope)
            {
                result = ((ClassScope)value).GetTypeBuilderOrEnumBuilder();
            }
            else if (value is TypedArray)
            {
                result = Convert.ToType((TypedArray)value);
            }
            else
            {
                result = (Type)value;
            }
            if (this.isArray)
            {
                return(Convert.ToType(TypedArray.ToRankString(this.rank), result));
            }
            else
            {
                return(result);
            }
        }
All Usage Examples Of Microsoft.JScript.TypedArray::ToRankString