C# Class Rebel.Framework.HiveEntityUri

Inheritance: IEquatable, IEquatable, IEquatable
Datei anzeigen Open project: RebelCMS/rebelcmsxu5 Class Usage Examples

Public Methods

Method Description
CompareString ( string id1, string id2 ) : bool

Compares 2 strings that are hive ids and checks if they are equal

ConvertIntToGuid ( int id ) : HiveEntityUri

Equals ( other ) : bool

Indicates whether the current object is equal to another object of the same type.

Equals ( Guid other ) : bool

Indicates whether the current object is equal to another object of the same type.

Equals ( int other ) : bool
Equals ( object obj ) : bool
Equals ( string other ) : bool

Checks if the string is the same, if it is not, it checks if the UrlDecoded or Encoded version of the string is the same

FromUriString ( string baseUri ) : HiveEntityUri

Creates an entity Uri from a string base

GetAllStringParts ( char delimiter = '/' ) : string

Concatenates all non-empty string parts together with the specified char as the delimiter

GetHashCode ( ) : int

Generated by Resharper, though it seems like its good

GetHtmlId ( ) : string

Returns a string id that can be used for Html elements

HiveEntityUri ( ) : System

Constructor

HiveEntityUri ( Guid guid ) : System

Creates an entity Uri from a Guid

HiveEntityUri ( Int32 id ) : System

Creates an entity Uri from a Int32

HiveEntityUri ( string identifier ) : System

Creates an entity from a generic string identitfier

The usage of this constructor is for things such as file paths

HiveEntityUri ( string schemeName, string providerKey, Guid id ) : System
HiveEntityUri ( string schemeName, string providerKey, int id ) : System

Initializes a new instance of the HiveEntityUri class.

HiveEntityUri ( string schemeName, string providerKey, string id ) : System
IsNullOrEmpty ( id ) : bool

Checks if the uri is null or 'Empty'

IsSystem ( ) : bool

Determines if the HiveEntityUri is a system Uri, this is determined if the ConvertIntToGuid is called with a nagative int.

Parse ( string value ) : HiveEntityUri

Parses the string into a HiveEntityUri, if parsing fails and exception is thrown

ToFriendlyString ( ) : string

Outputs a string for use with display/presentation

ToString ( ) : string

Returns the string representation of the HiveEntityUri for use in URLs

This checks what type of SerializationType is being used, for most cases (GUIDs and Ints) the output will be formatted as a 'readable' string, for string types, the output will be formatted as a safely casted (for use in URLs) Base64 encoded string.

TryParse ( string value, &uri ) : bool

Attempts to parse the value into a HiveEntityUri, this will check for types

operator ( ) : bool

Equality operator between HiveEntityUri's

Private Methods

Method Description
FormatGuid ( Guid guid ) : string
FormatInt ( Int32 id ) : string
FormatString ( string id ) : string
GetGuidParts ( ) : IEnumerable
GetIntParts ( ) : IEnumerable
HiveEntityUri ( string identifier, bool isUri ) : System

Creates an entity from a string identitfier

The usage of this constructor is for things such as file paths

HiveEntityUriDecode ( string encoded ) : string

Decodes the string to a Uri string

HiveEntityUriEncode ( string decoded ) : string

Encodes the uri string to be used inside of Urls

InternalStaticParse ( string value ) : HiveEntityUri

Parses a string into a HiveEntityUri, returning null if parsing fails

Reset ( string baseUri = HiveRoot, bool detectSerialization = true ) : void
ResetAsFormattedString ( string baseUri = HiveRoot ) : void
ResetByParsing ( string value ) : bool
ValueEquals ( other ) : bool

Method Details

CompareString() public static method

Compares 2 strings that are hive ids and checks if they are equal
public static CompareString ( string id1, string id2 ) : bool
id1 string
id2 string
return bool

ConvertIntToGuid() public static method

public static ConvertIntToGuid ( int id ) : HiveEntityUri
id int
return HiveEntityUri

Equals() public method

Indicates whether the current object is equal to another object of the same type.
public Equals ( other ) : bool
other An object to compare with this object.
return bool

Equals() public method

Indicates whether the current object is equal to another object of the same type.
public Equals ( Guid other ) : bool
other Guid An object to compare with this object.
return bool

Equals() public method

public Equals ( int other ) : bool
other int
return bool

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool

Equals() public method

Checks if the string is the same, if it is not, it checks if the UrlDecoded or Encoded version of the string is the same
public Equals ( string other ) : bool
other string
return bool

FromUriString() public static method

Creates an entity Uri from a string base
public static FromUriString ( string baseUri ) : HiveEntityUri
baseUri string Base Uri.
return HiveEntityUri

GetAllStringParts() public method

Concatenates all non-empty string parts together with the specified char as the delimiter
public GetAllStringParts ( char delimiter = '/' ) : string
delimiter char The delimiter (defaults to /).
return string

GetHashCode() public method

Generated by Resharper, though it seems like its good
public GetHashCode ( ) : int
return int

GetHtmlId() public method

Returns a string id that can be used for Html elements
public GetHtmlId ( ) : string
return string

HiveEntityUri() public method

Constructor
public HiveEntityUri ( ) : System
return System

HiveEntityUri() public method

Creates an entity Uri from a Guid
public HiveEntityUri ( Guid guid ) : System
guid Guid Base .
return System

HiveEntityUri() public method

Creates an entity Uri from a Int32
public HiveEntityUri ( Int32 id ) : System
id Int32 Base .
return System

HiveEntityUri() public method

Creates an entity from a generic string identitfier
The usage of this constructor is for things such as file paths
public HiveEntityUri ( string identifier ) : System
identifier string
return System

HiveEntityUri() public method

public HiveEntityUri ( string schemeName, string providerKey, Guid id ) : System
schemeName string
providerKey string
id Guid
return System

HiveEntityUri() public method

Initializes a new instance of the HiveEntityUri class.
public HiveEntityUri ( string schemeName, string providerKey, int id ) : System
schemeName string Name of the scheme.
providerKey string The provider key.
id int The id.
return System

HiveEntityUri() public method

public HiveEntityUri ( string schemeName, string providerKey, string id ) : System
schemeName string
providerKey string
id string
return System

IsNullOrEmpty() public static method

Checks if the uri is null or 'Empty'
public static IsNullOrEmpty ( id ) : bool
return bool

IsSystem() public method

Determines if the HiveEntityUri is a system Uri, this is determined if the ConvertIntToGuid is called with a nagative int.
public IsSystem ( ) : bool
return bool

Parse() public static method

Parses the string into a HiveEntityUri, if parsing fails and exception is thrown
public static Parse ( string value ) : HiveEntityUri
value string
return HiveEntityUri

ToFriendlyString() public method

Outputs a string for use with display/presentation
public ToFriendlyString ( ) : string
return string

ToString() public method

Returns the string representation of the HiveEntityUri for use in URLs
This checks what type of SerializationType is being used, for most cases (GUIDs and Ints) the output will be formatted as a 'readable' string, for string types, the output will be formatted as a safely casted (for use in URLs) Base64 encoded string.
public ToString ( ) : string
return string

TryParse() public static method

Attempts to parse the value into a HiveEntityUri, this will check for types
public static TryParse ( string value, &uri ) : bool
value string
uri The HiveEntityUri that will be output if parsing is successful
return bool

operator() public static method

Equality operator between HiveEntityUri's
public static operator ( ) : bool
return bool