indent() public static method

Indent a String that contains newlines.
public static indent ( System ident, System instr ) : System.String
ident System
instr System
return System.String
Ejemplo n.º 1
0
        /// <summary> Return an appropriate String representation of this Resampler instance.</summary>
        public override System.String ToString()
        {
            System.Text.StringBuilder rep  = new System.Text.StringBuilder("[Resampler: ncomps= " + ncomps);
            System.Text.StringBuilder body = new System.Text.StringBuilder("  ");
            for (int i = 0; i < ncomps; ++i)
            {
                body.Append(eol);
                body.Append("comp[");
                body.Append(i);
                body.Append("] xscale= ");
                body.Append(imgdatasrc.getCompSubsX(i));
                body.Append(", yscale= ");
                body.Append(imgdatasrc.getCompSubsY(i));
            }

            rep.Append(ColorSpace.indent("  ", body));
            return(rep.Append("]").ToString());
        }
        /// <summary>Return a suitable String representation of the class instance, e.g.
        /// <p>
        /// [PalettizedColorSpaceMapper
        /// ncomps= 3, scomp= 1, nentries= 1024
        /// column=0, 7 bit signed entry
        /// column=1, 7 bit unsigned entry
        /// column=2, 7 bit signed entry]
        /// <p>
        ///
        /// </summary>
        public override System.String ToString()
        {
            int c;

            System.Text.StringBuilder rep  = new System.Text.StringBuilder("[PalettizedColorSpaceMapper ");
            System.Text.StringBuilder body = new System.Text.StringBuilder("  " + eol);

            if (pbox != null)
            {
                body.Append("ncomps= ").Append(NumComps).Append(", scomp= ").Append(srcChannel);
                for (c = 0; c < NumComps; ++c)
                {
                    body.Append(eol).Append("column= ").Append(c).Append(", ").Append(pbox.getBitDepth(c)).Append(" bit ").Append(pbox.isSigned(c)?"signed entry":"unsigned entry");
                }
            }
            else
            {
                body.Append("image does not contain a palette box");
            }

            rep.Append(ColorSpace.indent("  ", body));
            return(rep.Append("]").ToString());
        }