C# Class Minimod.PrettyText.PrettyTextMinimod

Minimod.PrettyText, Version 2.0.1, Copyright © Lars Corneliussen 2011

A minimod with string extensions, helping whereever you have to shape text to fit into a box.

Licensed under the Apache License, Version 2.0; you may not use this file except in compliance with the License. http://www.apache.org/licenses/LICENSE-2.0
Datei anzeigen Open project: minimod/minimods

Public Methods

Method Description
IndentBy ( this lines, int leadingSpaces ) : IEnumerable

Indents each line by specified number of spaces.

IndentBy ( this lines, int leadingSpaces, IndentOptions options ) : IEnumerable

Indents each line by specified number of spaces.

IndentLinesBy ( this lines, int leadingSpaces ) : string

Indents each line by specified number of spaces.

IndentLinesBy ( this lines, int leadingSpaces, IndentOptions options ) : string

Indents each line by specified number of spaces.

JoinLines ( this lines ) : string

Join lines by using Environment.NewLine.

ShortenTo ( this text, int length ) : string

Fits the text into length, appending ... if it is too long.

ShortenTo ( this text, int length, string hint ) : string

Fits the text into length, appending hint if it is too long.

SplitLines ( this input ) : IEnumerable

Splits into lines by using Environment.NewLine.

WrapAt ( this input, int margin ) : IEnumerable

Wraps lines exceeding a certain margin. For each line, the indentation is maintained.

based on: http://blueonionsoftware.com/blog.aspx?p=6091173d-6bdb-498c-9d57-c0da43319839

Private Methods

Method Description
HasAnyFlag ( this value, Enum flags ) : bool copied from http://www.mmowned.com/forums/world-of-warcraft/bots-programs/memory-editing/297201-net-4-0-enum-hasflag-not-what-you-might-expect.html

Method Details

IndentBy() public static method

Indents each line by specified number of spaces.
public static IndentBy ( this lines, int leadingSpaces ) : IEnumerable
lines this
leadingSpaces int
return IEnumerable

IndentBy() public static method

Indents each line by specified number of spaces.
public static IndentBy ( this lines, int leadingSpaces, IndentOptions options ) : IEnumerable
lines this
leadingSpaces int
options IndentOptions
return IEnumerable

IndentLinesBy() public static method

Indents each line by specified number of spaces.
public static IndentLinesBy ( this lines, int leadingSpaces ) : string
lines this
leadingSpaces int
return string

IndentLinesBy() public static method

Indents each line by specified number of spaces.
public static IndentLinesBy ( this lines, int leadingSpaces, IndentOptions options ) : string
lines this
leadingSpaces int
options IndentOptions
return string

JoinLines() public static method

Join lines by using Environment.NewLine.
public static JoinLines ( this lines ) : string
lines this
return string

ShortenTo() public static method

Fits the text into length, appending ... if it is too long.
public static ShortenTo ( this text, int length ) : string
text this
length int
return string

ShortenTo() public static method

Fits the text into length, appending hint if it is too long.
public static ShortenTo ( this text, int length, string hint ) : string
text this
length int
hint string
return string

SplitLines() public static method

Splits into lines by using Environment.NewLine.
public static SplitLines ( this input ) : IEnumerable
input this
return IEnumerable

WrapAt() public static method

Wraps lines exceeding a certain margin. For each line, the indentation is maintained.
based on: http://blueonionsoftware.com/blog.aspx?p=6091173d-6bdb-498c-9d57-c0da43319839
public static WrapAt ( this input, int margin ) : IEnumerable
input this
margin int
return IEnumerable