C# Class BF2Statistics.Web.Bf2Stats.BF2PageModel

This object acts as a base object for all Models used in the Bf2Stats views
Show file Open project: BF2Statistics/ControlCenter Class Usage Examples

Public Properties

Property Type Description
Root string
SearchBarValue string
SpecificCulture System.Globalization.CultureInfo
Title string

Public Methods

Method Description
BF2PageModel ( HttpClient Client ) : System
FormatDate ( int Time ) : string

Takes a timestamp and converts it to a data format that was used in BF2sClone

FormatNumber ( object Time ) : string

Formats an integer timestamp to a timespan format that was used in BF2sClone

FormatTime ( double Time ) : string

Formats an integer timestamp to a timespan format that was used in BF2sClone

Write ( string contents ) : string

Writes the plain contents to the template

WriteIf ( string contents, bool condition ) : string

Returns a string in the contents variable if the condition is met

WriteIfElse ( bool condition, string trueValue, string falseValue ) : string

Returns a string based on the value of the condition variable

Method Details

BF2PageModel() public method

public BF2PageModel ( HttpClient Client ) : System
Client HttpClient
return System

FormatDate() public method

Takes a timestamp and converts it to a data format that was used in BF2sClone
public FormatDate ( int Time ) : string
Time int
return string

FormatNumber() public method

Formats an integer timestamp to a timespan format that was used in BF2sClone
public FormatNumber ( object Time ) : string
Time object
return string

FormatTime() public method

Formats an integer timestamp to a timespan format that was used in BF2sClone
public FormatTime ( double Time ) : string
Time double
return string

Write() public method

Writes the plain contents to the template
public Write ( string contents ) : string
contents string The contents to be written
return string

WriteIf() public method

Returns a string in the contents variable if the condition is met
public WriteIf ( string contents, bool condition ) : string
contents string The contents to be returned if the condition is met
condition bool a bool indicating whether the condition is met
return string

WriteIfElse() public method

Returns a string based on the value of the condition variable
public WriteIfElse ( bool condition, string trueValue, string falseValue ) : string
condition bool a bool indicating whether the condition is met
trueValue string The value to return if the condition is met
falseValue string The value to return if the condition is NOT met
return string

Property Details

Root public property

Provides the Root url to the bf2stats pages
public string Root
return string

SearchBarValue public property

Gets or Sets the value in the Search bar
public string SearchBarValue
return string

SpecificCulture public static property

Indicates the specific culture formating for dates
public static CultureInfo,System.Globalization SpecificCulture
return System.Globalization.CultureInfo

Title public property

Contains the title of the page
public string Title
return string