C# Class cloudscribe.Core.Models.CommonExtensions

Show file Open project: joeaudette/cloudscribe

Public Methods

Method Description
ConvertIpv4ToLong ( string ipv4Address ) : long
Forget ( this task ) : void

an extenstion method to avoid the warning when firing an async task without await from inside another async task for fire and forget scenarios where we don't need to wait for the task to complete http://stackoverflow.com/questions/22629951/suppressing-warning-cs4014-because-this-call-is-not-awaited-execution-of-the

SplitOnChar ( this s, char c ) : List
SplitOnCharAndTrim ( this s, char c ) : List
StartingSegment ( this path ) : string
StartingSegment ( this path, PathString &remaining ) : string
ToDatePickerFormat ( this t ) : string

in .NET M means month 1 -12 with no leading zero in javascript it means month name like Dec we need m for month with no leading zero, so we need to lower it also in C# yyyy means four digit year but in js yy means 4 digit year so we must replace yyyy with yy

ToDatePickerWithTimeFormat ( this t ) : string

this is needed to configure a datetime picker to match DateTime.ToString("g") http://trentrichardson.com/examples/timepicker/#tp-formatting the standard ShortTimePattern uses tt where this time picker expects TT in .NET tt means use AM or PM but in this js it means am or pm we need TT to get AM or PM

ToInvariantString ( this i ) : string
ToLong ( this ipAddress ) : long
ToStringList ( this chars ) : List

Method Details

ConvertIpv4ToLong() public static method

public static ConvertIpv4ToLong ( string ipv4Address ) : long
ipv4Address string
return long

Forget() public static method

an extenstion method to avoid the warning when firing an async task without await from inside another async task for fire and forget scenarios where we don't need to wait for the task to complete http://stackoverflow.com/questions/22629951/suppressing-warning-cs4014-because-this-call-is-not-awaited-execution-of-the
public static Forget ( this task ) : void
task this
return void

SplitOnChar() public static method

public static SplitOnChar ( this s, char c ) : List
s this
c char
return List

SplitOnCharAndTrim() public static method

public static SplitOnCharAndTrim ( this s, char c ) : List
s this
c char
return List

StartingSegment() public static method

public static StartingSegment ( this path ) : string
path this
return string

StartingSegment() public static method

public static StartingSegment ( this path, PathString &remaining ) : string
path this
remaining PathString
return string

ToDatePickerFormat() public static method

in .NET M means month 1 -12 with no leading zero in javascript it means month name like Dec we need m for month with no leading zero, so we need to lower it also in C# yyyy means four digit year but in js yy means 4 digit year so we must replace yyyy with yy
public static ToDatePickerFormat ( this t ) : string
t this
return string

ToDatePickerWithTimeFormat() public static method

this is needed to configure a datetime picker to match DateTime.ToString("g") http://trentrichardson.com/examples/timepicker/#tp-formatting the standard ShortTimePattern uses tt where this time picker expects TT in .NET tt means use AM or PM but in this js it means am or pm we need TT to get AM or PM
public static ToDatePickerWithTimeFormat ( this t ) : string
t this
return string

ToInvariantString() public static method

public static ToInvariantString ( this i ) : string
i this
return string

ToLong() public static method

public static ToLong ( this ipAddress ) : long
ipAddress this
return long

ToStringList() public static method

public static ToStringList ( this chars ) : List
chars this
return List