Class SkyExtensions
Provides common extensions methods for Sky
Inheritance
System.Object
SkyExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Azos.Sky.dll
Syntax
public static class SkyExtensions
Methods
AsSky(IApplication)
Provides handy accessor to ISkyApplication context of the IApplication, e.g. in components: App.AsSky().ProcessManager....
Declaration
public static ISkyApplication AsSky(this IApplication app)
Parameters
Type |
Name |
Description |
IApplication |
app |
IApplication instance cast-able to ISkyApplication
|
Returns
Returns Metabank of this IApplication
Declaration
public static Metabank GetMetabase(this IApplication app)
Parameters
Returns
GetRegionPathHashCode(String)
Computes has code for region path string disregarding case and extensions (such as '.r' or '.noc')
Note: This function should be used in conjunction with IsSameRegionPath() while implementing Equals/GetHashCode
Ignores dynamic host name suffixes
Declaration
public static int GetRegionPathHashCode(this string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.Int32 |
|
Returns Metabank.SectionHost (metabase's information about this host)
Declaration
public static Metabank.SectionHost GetThisHostMetabaseSection(this IApplication app)
Parameters
Returns
GetThisHostName(IApplication)
Declaration
public static string GetThisHostName(this IApplication app)
Parameters
Returns
Type |
Description |
System.String |
|
Returns Metabank.SectionNOC (metabase's information about the NOC this host is in)
Declaration
public static Metabank.SectionNOC GetThisNOCMetabaseSection(this IApplication app)
Parameters
Returns
IsSameRegionPath(String, String)
Checks two strings for region paths that reference the same regional entity disregarding entity extensions (such as '.r' or '.noc').
Note: this method DOES NOT check whether this path resolves to actual catalog entity as it only compares names.
This function should be used in conjunction with GetRegionPathHashCode() while implementing Equals/GetHashCode.
Ignores dynamic host name suffixes
Declaration
public static bool IsSameRegionPath(this string path1, string path2)
Parameters
Type |
Name |
Description |
System.String |
path1 |
|
System.String |
path2 |
|
Returns
Type |
Description |
System.Boolean |
|
IsValidName(String)
Returns true if the supplied string is a valid name
a name that does not contain SysConsts.NAME_INVALID_CHARS
Declaration
public static bool IsValidName(this string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.Boolean |
|
ServiceNameToPort(String, Boolean, Boolean)
Translates mnemonic name of the major service (i.e. "hgov") into its default port
Declaration
public static int ServiceNameToPort(string service, bool sync, bool appTerminal)
Parameters
Type |
Name |
Description |
System.String |
service |
|
System.Boolean |
sync |
|
System.Boolean |
appTerminal |
|
Returns
Type |
Description |
System.Int32 |
|
StripPathOfRegionExtensions(String)
Deletes region extensions (such as '.r' or '.noc') from path
Ignores dynamic host name suffixes
Declaration
public static string StripPathOfRegionExtensions(this string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.String |
|
ToResolvedServiceNode(Node, Boolean)
Tries to resolve mnemonic name of the Sky service into port, i.e. "hgov" into int port number
Declaration
public static Node ToResolvedServiceNode(this Node node, bool appTerminal = false)
Parameters
Type |
Name |
Description |
Node |
node |
|
System.Boolean |
appTerminal |
|
Returns
ToResolvedServiceNode(String, Boolean)
Tries to resolve mnemonic name of the Sky service into port, i.e. "hgov" into int port number
Declaration
public static Node ToResolvedServiceNode(this string connectString, bool appTerminal = false)
Parameters
Type |
Name |
Description |
System.String |
connectString |
|
System.Boolean |
appTerminal |
|
Returns