Class Utilities
- Namespace
- Oqtane.Shared
- Assembly
- Oqtane.Shared.dll
public static class Utilities
- Inheritance
-
object
Utilities
Methods
AddUrlParameters(params object[])
public static string AddUrlParameters(params object[] parameters)
Parameters
parameters
object[]
Returns
- string
ContentUrl(Alias, int)
[Obsolete("ContentUrl(Alias alias, int fileId) is deprecated. Use FileUrl(Alias alias, int fileId) instead.", false)]
public static string ContentUrl(Alias alias, int fileId)
Parameters
alias
Alias
fileId
int
Returns
- string
ContentUrl(Alias, int, bool)
[Obsolete("ContentUrl(Alias alias, int fileId, bool asAttachment) is deprecated. Use FileUrl(Alias alias, int fileId, bool download) instead.", false)]
public static string ContentUrl(Alias alias, int fileId, bool asAttachment)
Parameters
alias
Alias
fileId
int
asAttachment
bool
Returns
- string
CreateQueryString(Dictionary<string, string>)
public static string CreateQueryString(Dictionary<string, string> parameters)
Parameters
parameters
Dictionary<string, string>
Returns
- string
EditUrl(string, string, int, string, string)
public static string EditUrl(string alias, string path, int moduleid, string action, string parameters)
Parameters
alias
string
path
string
moduleid
int
action
string
parameters
string
Returns
- string
FileUrl(Alias, int)
public static string FileUrl(Alias alias, int fileid)
Parameters
alias
Alias
fileid
int
Returns
- string
FileUrl(Alias, int, bool)
public static string FileUrl(Alias alias, int fileid, bool download)
Parameters
alias
Alias
fileid
int
download
bool
Returns
- string
FileUrl(Alias, string, string)
public static string FileUrl(Alias alias, string folderpath, string filename)
Parameters
alias
Alias
folderpath
string
filename
string
Returns
- string
FileUrl(Alias, string, string, bool)
public static string FileUrl(Alias alias, string folderpath, string filename, bool download)
Parameters
alias
Alias
folderpath
string
filename
string
download
bool
Returns
- string
FormatContent(string, Alias, string)
public static string FormatContent(string content, Alias alias, string operation)
Parameters
content
string
alias
Alias
operation
string
Returns
- string
GetAssemblyName(string)
public static string GetAssemblyName(string fullyqualifiedtypename)
Parameters
fullyqualifiedtypename
string
Returns
- string
GetFriendlyUrl(string)
public static string GetFriendlyUrl(string url)
Parameters
url
string
Returns
- string
GetFullTypeName(string)
public static string GetFullTypeName(string fullyqualifiedtypename)
Parameters
fullyqualifiedtypename
string
Returns
- string
GetTypeName(string)
public static string GetTypeName(string fullyqualifiedtypename)
Parameters
fullyqualifiedtypename
string
Returns
- string
GetTypeNameLastSegment(string, int)
public static string GetTypeNameLastSegment(string typename, int segment)
Parameters
typename
string
segment
int
Returns
- string
ImageUrl(Alias, int, int, int, string)
public static string ImageUrl(Alias alias, int fileId, int width, int height, string mode)
Parameters
alias
Alias
fileId
int
width
int
height
int
mode
string
Returns
- string
ImageUrl(Alias, int, int, int, string, string, string, int, bool)
public static string ImageUrl(Alias alias, int fileId, int width, int height, string mode, string position, string background, int rotate, bool recreate)
Parameters
alias
Alias
fileId
int
width
int
height
int
mode
string
position
string
background
string
rotate
int
recreate
bool
Returns
- string
IsEffectiveAndNotExpired(DateTime?, DateTime?)
public static bool IsEffectiveAndNotExpired(DateTime? effectiveDate, DateTime? expiryDate)
Parameters
effectiveDate
DateTime?
expiryDate
DateTime?
Returns
- bool
IsFileValid(File)
public static bool IsFileValid(this File file)
Parameters
file
File
Returns
- bool
IsPageModuleVisible(DateTime?, DateTime?)
[Obsolete("IsPageModuleVisible(DateTime?, DateTime?) is deprecated. Use IsEffectiveAndNotExpired(DateTime?, DateTime?) instead.", false)]
public static bool IsPageModuleVisible(DateTime? effectiveDate, DateTime? expiryDate)
Parameters
effectiveDate
DateTime?
expiryDate
DateTime?
Returns
- bool
IsPathOrFileValid(string)
public static bool IsPathOrFileValid(this string name)
Parameters
name
string
Returns
- bool
IsPathValid(Folder)
public static bool IsPathValid(this Folder folder)
Parameters
folder
Folder
Returns
- bool
IsValidEmail(string)
public static bool IsValidEmail(string email)
Parameters
email
string
Returns
- bool
LocalDateAndTimeAsUtc(DateTime?, DateTime?, TimeZoneInfo)
public static DateTime? LocalDateAndTimeAsUtc(DateTime? date, DateTime? time, TimeZoneInfo localTimeZone = null)
Parameters
date
DateTime?
time
DateTime?
localTimeZone
TimeZoneInfo
Returns
- DateTime?
LocalDateAndTimeAsUtc(DateTime?, string, TimeZoneInfo)
public static DateTime? LocalDateAndTimeAsUtc(DateTime? date, string time, TimeZoneInfo localTimeZone = null)
Parameters
date
DateTime?
time
string
localTimeZone
TimeZoneInfo
Returns
- DateTime?
LocalDateAndTimeAsUtc(DateTime?, TimeZoneInfo)
public static DateTime? LocalDateAndTimeAsUtc(DateTime? date, TimeZoneInfo localTimeZone = null)
Parameters
date
DateTime?
localTimeZone
TimeZoneInfo
Returns
- DateTime?
LogMessage(object, string)
public static string LogMessage(object @class, string message)
Parameters
class
object
message
string
Returns
- string
NavigateUrl(string, string, string)
public static string NavigateUrl(string alias, string path, string parameters)
Parameters
alias
string
path
string
parameters
string
Returns
- string
ParseParameters(string)
public static (string UrlParameters, string Querystring, string Fragment) ParseParameters(string parameters)
Parameters
parameters
string
Returns
- (string UrlParameters, string Querystring, string Fragment)
ParseQueryString(string)
public static Dictionary<string, string> ParseQueryString(string query)
Parameters
query
string
Returns
- Dictionary<string, string>
PathCombine(params string[])
public static string PathCombine(params string[] segments)
Parameters
segments
string[]
Returns
- string
TenantUrl(Alias, string)
public static string TenantUrl(Alias alias, string url)
Parameters
alias
Alias
url
string
Returns
- string
ToModuleDefinitionName(Type)
public static string ToModuleDefinitionName(this Type type)
Parameters
type
Type
Returns
- string
TryGetQueryValue(Uri, string, out string, string)
public static bool TryGetQueryValue(this Uri uri, string key, out string value, string defaultValue = null)
Parameters
uri
Uri
key
string
value
string
defaultValue
string
Returns
- bool
TryGetQueryValueInt(Uri, string, out int, int)
public static bool TryGetQueryValueInt(this Uri uri, string key, out int value, int defaultValue = 0)
Parameters
uri
Uri
key
string
value
int
defaultValue
int
Returns
- bool
UrlCombine(params string[])
public static string UrlCombine(params string[] segments)
Parameters
segments
string[]
Returns
- string
UtcAsLocalDate(DateTime?, TimeZoneInfo)
public static DateTime? UtcAsLocalDate(DateTime? dateTime, TimeZoneInfo timeZone = null)
Parameters
dateTime
DateTime?
timeZone
TimeZoneInfo
Returns
- DateTime?
UtcAsLocalDateAndTime(DateTime?, TimeZoneInfo)
public static (DateTime? date, string time) UtcAsLocalDateAndTime(DateTime? dateTime, TimeZoneInfo timeZone = null)
Parameters
dateTime
DateTime?
timeZone
TimeZoneInfo
Returns
- (DateTime? date, string time)
UtcAsLocalDateTime(DateTime?, TimeZoneInfo)
public static DateTime? UtcAsLocalDateTime(DateTime? dateTime, TimeZoneInfo timeZone = null)
Parameters
dateTime
DateTime?
timeZone
TimeZoneInfo
Returns
- DateTime?
ValidateEffectiveExpiryDates(DateTime?, DateTime?)
public static bool ValidateEffectiveExpiryDates(DateTime? effectiveDate, DateTime? expiryDate)
Parameters
effectiveDate
DateTime?
expiryDate
DateTime?
Returns
- bool