C# Класс BF2Statistics.Web.Bf2Stats.Controller

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
CacheFile System.IO.FileInfo
Client HttpClient

Открытые методы

Метод Описание
Controller ( HttpClient Client ) : System
FormatDate ( int Time ) : string

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

FormatTime ( int Time ) : string

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

HandleRequest ( MvcRoute Route ) : void

Processes the request, and sends a resonse back to the client

SendCachedResponse ( string CacheFileName ) : void

Fills the client response with the contents of the Cache file specified

Защищенные методы

Метод Описание
CacheFileExpired ( string CacheFileName, int CacheTime ) : bool

Returns whether or not the Cache file is expired

CorrectUrls ( string source, BF2PageModel Model ) : string

This method will reformat all base url's to point to the requested hostname and bf2stats querypath.

EnsureTemplate ( string Name ) : bool

Returns whether the template name provided has been compiled with the Razor Engine

SendTemplateResponse ( string TemplateName, Type ModelType, object Model, string CacheFileName = "" ) : void

Runs the specified Template through the RazorEngine and sends the contents back to the client in the Response

Описание методов

CacheFileExpired() защищенный Метод

Returns whether or not the Cache file is expired
protected CacheFileExpired ( string CacheFileName, int CacheTime ) : bool
CacheFileName string The Cache file name
CacheTime int The expire time of the cache file in Minutes
Результат bool

Controller() публичный Метод

public Controller ( HttpClient Client ) : System
Client HttpClient
Результат System

CorrectUrls() защищенный Метод

This method will reformat all base url's to point to the requested hostname and bf2stats querypath.
protected CorrectUrls ( string source, BF2PageModel Model ) : string
source string
Model BF2PageModel
Результат string

EnsureTemplate() защищенный Метод

Returns whether the template name provided has been compiled with the Razor Engine
protected EnsureTemplate ( string Name ) : bool
Name string The name of the template
Результат bool

FormatDate() публичный Метод

Takes a timestamp and converts it to a data format that was used in BF2sClone
public FormatDate ( int Time ) : string
Time int
Результат string

FormatTime() публичный Метод

Formats an integer timestamp to a timespan format that was used in BF2sClone
public FormatTime ( int Time ) : string
Time int
Результат string

HandleRequest() публичный абстрактный Метод

Processes the request, and sends a resonse back to the client
public abstract HandleRequest ( MvcRoute Route ) : void
Route MvcRoute
Результат void

SendCachedResponse() публичный Метод

Fills the client response with the contents of the Cache file specified
public SendCachedResponse ( string CacheFileName ) : void
CacheFileName string The name of the cache file
Результат void

SendTemplateResponse() защищенный Метод

Runs the specified Template through the RazorEngine and sends the contents back to the client in the Response
protected SendTemplateResponse ( string TemplateName, Type ModelType, object Model, string CacheFileName = "" ) : void
TemplateName string The name of the cshtml template file we are parsing
ModelType System.Type The Model type used in the template file
Model object The Model used in the template file
CacheFileName string The name of the Cached file if we are using one. Leave blank for no caching.
Результат void

Описание свойств

CacheFile защищенное свойство

Our cache file object if we need it. This will be NULL until
protected FileInfo,System.IO CacheFile
Результат System.IO.FileInfo

Client защищенное свойство

Gets the HttpClient object that made this request
protected HttpClient Client
Результат HttpClient