C# Class BLL.Common.Utils

Show file Open project: evercam/Timelapse

Public Properties

Property Type Description
SQLMaxDate System.DateTime
SQLMinDate System.DateTime
SiteServer string
WatermarkMargin int
WatermarkPrefix string

Public Methods

Method Description
AppLog ( string message ) : void
AppLog ( string message, Exception x ) : void
ConvertFromUtc ( System.DateTime dt, string timezone ) : System.DateTime
ConvertHourToUtc ( int hour, string timezone ) : int
ConvertToUtc ( System.DateTime dt, string timezone, bool useTryCatch = false ) : System.DateTime
CopyTimelapsesToAzure ( ) : void
DoDownload ( string url, string username, string password, bool useCredentials ) : SnapshotData
DoDownload ( string url, string path ) : string
FileLog ( string msg ) : void
GeneratePassCode ( int length ) : string
GenerateRandomString ( int length ) : string
GetBaseUtcOffsetMilliseconds ( string timezone ) : double
GetCameraDayEndTimeInUtc ( System.DateTime time, string timeZone ) : string
GetNiceTime ( System.DateTime dt ) : string
GetSpace ( long size ) : string
GetTimeZoneInfo ( string tz ) : TimeZoneInfo
GetTimeZoneOffSetHours ( string timezone ) : double
GetTimeZoneOffSetMilliseconds ( string timezone ) : double
IsTimeBetween ( System.DateTime time, System.DateTime fromTime, System.DateTime toTime ) : bool
KillProcess ( int pid, int tid ) : bool
KillProcess ( string processName ) : void
ProcessRunning ( string processName ) : int
RemoveSymbols ( string str ) : string
StartTimelapse ( Timelapse timelapse ) : bool

Checks if given timelapse needs to be started

StopTimelapse ( Timelapse timelapse ) : bool

Checks if given timelapse needs to be stopped

TimelapseLog ( Timelapse timelapse, Exception x ) : void
TimelapseLog ( Timelapse timelapse, string message ) : void
TimelapseLog ( Timelapse timelapse, string message, Exception x ) : void
TimelapseLog ( int timelapseId, string message ) : void
TimelapseRunning ( int timelapseId ) : int
UpdateTimelapsesOnAzure ( ) : void
WatermarkImage ( int timelapseId, byte imagedata, string output, string logofile, int logoposition ) : byte[]
WatermarkImage ( string input, string output, string logofile, int logoposition ) : byte[]

Private Methods

Method Description
InsertLogo ( Graphics g, string watermark, int position, int width, int height ) : void
InsertLogo ( int timelapseId, Graphics g, string watermark, int position, int width, int height ) : void

Method Details

AppLog() public static method

public static AppLog ( string message ) : void
message string
return void

AppLog() public static method

public static AppLog ( string message, Exception x ) : void
message string
x System.Exception
return void

ConvertFromUtc() public static method

public static ConvertFromUtc ( System.DateTime dt, string timezone ) : System.DateTime
dt System.DateTime
timezone string
return System.DateTime

ConvertHourToUtc() public static method

public static ConvertHourToUtc ( int hour, string timezone ) : int
hour int
timezone string
return int

ConvertToUtc() public static method

public static ConvertToUtc ( System.DateTime dt, string timezone, bool useTryCatch = false ) : System.DateTime
dt System.DateTime
timezone string
useTryCatch bool
return System.DateTime

CopyTimelapsesToAzure() public static method

public static CopyTimelapsesToAzure ( ) : void
return void

DoDownload() public static method

public static DoDownload ( string url, string username, string password, bool useCredentials ) : SnapshotData
url string
username string
password string
useCredentials bool
return SnapshotData

DoDownload() public static method

public static DoDownload ( string url, string path ) : string
url string
path string
return string

FileLog() public static method

public static FileLog ( string msg ) : void
msg string
return void

GeneratePassCode() public static method

public static GeneratePassCode ( int length ) : string
length int
return string

GenerateRandomString() public static method

public static GenerateRandomString ( int length ) : string
length int
return string

GetBaseUtcOffsetMilliseconds() public static method

public static GetBaseUtcOffsetMilliseconds ( string timezone ) : double
timezone string
return double

GetCameraDayEndTimeInUtc() public static method

public static GetCameraDayEndTimeInUtc ( System.DateTime time, string timeZone ) : string
time System.DateTime
timeZone string
return string

GetNiceTime() public static method

public static GetNiceTime ( System.DateTime dt ) : string
dt System.DateTime
return string

GetSpace() public static method

public static GetSpace ( long size ) : string
size long
return string

GetTimeZoneInfo() public static method

public static GetTimeZoneInfo ( string tz ) : TimeZoneInfo
tz string
return System.TimeZoneInfo

GetTimeZoneOffSetHours() public static method

public static GetTimeZoneOffSetHours ( string timezone ) : double
timezone string
return double

GetTimeZoneOffSetMilliseconds() public static method

public static GetTimeZoneOffSetMilliseconds ( string timezone ) : double
timezone string
return double

IsTimeBetween() public static method

public static IsTimeBetween ( System.DateTime time, System.DateTime fromTime, System.DateTime toTime ) : bool
time System.DateTime
fromTime System.DateTime
toTime System.DateTime
return bool

KillProcess() public static method

public static KillProcess ( int pid, int tid ) : bool
pid int
tid int
return bool

KillProcess() public static method

public static KillProcess ( string processName ) : void
processName string
return void

ProcessRunning() public static method

public static ProcessRunning ( string processName ) : int
processName string
return int

RemoveSymbols() public static method

public static RemoveSymbols ( string str ) : string
str string
return string

StartTimelapse() public static method

Checks if given timelapse needs to be started
public static StartTimelapse ( Timelapse timelapse ) : bool
timelapse BLL.Entities.Timelapse
return bool

StopTimelapse() public static method

Checks if given timelapse needs to be stopped
public static StopTimelapse ( Timelapse timelapse ) : bool
timelapse BLL.Entities.Timelapse
return bool

TimelapseLog() public static method

public static TimelapseLog ( Timelapse timelapse, Exception x ) : void
timelapse BLL.Entities.Timelapse
x System.Exception
return void

TimelapseLog() public static method

public static TimelapseLog ( Timelapse timelapse, string message ) : void
timelapse BLL.Entities.Timelapse
message string
return void

TimelapseLog() public static method

public static TimelapseLog ( Timelapse timelapse, string message, Exception x ) : void
timelapse BLL.Entities.Timelapse
message string
x System.Exception
return void

TimelapseLog() public static method

public static TimelapseLog ( int timelapseId, string message ) : void
timelapseId int
message string
return void

TimelapseRunning() public static method

public static TimelapseRunning ( int timelapseId ) : int
timelapseId int
return int

UpdateTimelapsesOnAzure() public static method

public static UpdateTimelapsesOnAzure ( ) : void
return void

WatermarkImage() public static method

public static WatermarkImage ( int timelapseId, byte imagedata, string output, string logofile, int logoposition ) : byte[]
timelapseId int
imagedata byte
output string
logofile string
logoposition int
return byte[]

WatermarkImage() public static method

public static WatermarkImage ( string input, string output, string logofile, int logoposition ) : byte[]
input string
output string
logofile string
logoposition int
return byte[]

Property Details

SQLMaxDate public static property

public static DateTime,System SQLMaxDate
return System.DateTime

SQLMinDate public static property

public static DateTime,System SQLMinDate
return System.DateTime

SiteServer public static property

public static string SiteServer
return string

WatermarkMargin public static property

public static int WatermarkMargin
return int

WatermarkPrefix public static property

public static string WatermarkPrefix
return string