C# Class TwitchLib.Common

A common/utility class for frequently used functions and variables.
Show file Open project: swiftyspiffy/TwitchLib

Public Methods

Method Description
DateTimeStringToObject ( string dateTime ) : System.DateTime

Takes date time string received from Twitch API and converts it to DateTime object.

JsonIsNullOrEmpty ( JToken token ) : bool

Function to check if a jtoken is null. Credits: http://stackoverflow.com/questions/24066400/checking-for-empty-null-jtoken-in-a-jobject

Log ( string message, bool includeDate = false, bool includeTime = false, System.Enums type = Enums.LogType.Normal ) : void

Writes message to console output. Maintains foreground color while applying a temporary color. Locks output to ensure color is applied (may be incorrect way to go about it)

ParseQuotesAndNonQuotes ( string message ) : List

Parses out strings that have quotes, ideal for commands that use quotes for parameters

Method Details

DateTimeStringToObject() public static method

Takes date time string received from Twitch API and converts it to DateTime object.
public static DateTimeStringToObject ( string dateTime ) : System.DateTime
dateTime string
return System.DateTime

JsonIsNullOrEmpty() public static method

Function to check if a jtoken is null. Credits: http://stackoverflow.com/questions/24066400/checking-for-empty-null-jtoken-in-a-jobject
public static JsonIsNullOrEmpty ( JToken token ) : bool
token JToken JToken to check if null or not.
return bool

Log() public static method

Writes message to console output. Maintains foreground color while applying a temporary color. Locks output to ensure color is applied (may be incorrect way to go about it)
public static Log ( string message, bool includeDate = false, bool includeTime = false, System.Enums type = Enums.LogType.Normal ) : void
message string
includeDate bool
includeTime bool
type System.Enums
return void

ParseQuotesAndNonQuotes() public static method

Parses out strings that have quotes, ideal for commands that use quotes for parameters
public static ParseQuotesAndNonQuotes ( string message ) : List
message string Input string to attempt to parse.
return List