Show / Hide Table of Contents

    Class StorageConnectionString

    Holds a parsed connection string to the storage

    Inheritance
    System.Object
    StorageConnectionString
    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)
    Namespace: Bayat.SaveSystem.Storage
    Assembly: Bayat.SaveSystem.Runtime.dll
    Syntax
    public class StorageConnectionString

    Constructors

    | Improve this Doc View Source

    StorageConnectionString(String)

    Creates a new instance of StorageConnectionString

    Declaration
    public StorageConnectionString(string connectionString)
    Parameters
    Type Name Description
    System.String connectionString

    Fields

    | Improve this Doc View Source

    NativeParameterName

    Declaration
    public static string NativeParameterName
    Field Value
    Type Description
    System.String

    Properties

    | Improve this Doc View Source

    ConnectionString

    Original connection string

    Declaration
    public string ConnectionString { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    IsNative

    Determines if this is a native connection string

    Declaration
    public bool IsNative { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Item[String]

    Gets or sets connection string parameters

    Declaration
    public string this[string key] { get; set; }
    Parameters
    Type Name Description
    System.String key
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Native

    Returns native connection string, or null if connection string is not native

    Declaration
    public string Native { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Parameters

    Connection string parameters exposed as key-value pairs

    Declaration
    public Dictionary<string, string> Parameters { get; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.String>
    | Improve this Doc View Source

    Prefix

    Prefix of this connection string, excluding prefix separator, i.e. for 'disk://something' the prefix is 'disk'

    Declaration
    public string Prefix { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    Get(String, String, String[])

    Get connection string parameter by name

    Declaration
    public string Get(string parameterName, string defaultValue, params string[] aliases)
    Parameters
    Type Name Description
    System.String parameterName
    System.String defaultValue
    System.String[] aliases
    Returns
    Type Description
    System.String

    Parameter value. If parameter is not set returns an empty string

    | Improve this Doc View Source

    GetBoolean(String, Boolean, String[])

    Get connection string parameter by name

    Declaration
    public bool GetBoolean(string parameterName, bool defaultValue, params string[] aliases)
    Parameters
    Type Name Description
    System.String parameterName
    System.Boolean defaultValue
    System.String[] aliases
    Returns
    Type Description
    System.Boolean

    Parameter value. If parameter is not set returns an empty string

    | Improve this Doc View Source

    GetFloat(String, Single, String[])

    Get connection string parameter by name

    Declaration
    public float GetFloat(string parameterName, float defaultValue, params string[] aliases)
    Parameters
    Type Name Description
    System.String parameterName
    System.Single defaultValue
    System.String[] aliases
    Returns
    Type Description
    System.Single

    Parameter value. If parameter is not set returns an empty string

    | Improve this Doc View Source

    GetInteger(String, Int32, String[])

    Get connection string parameter by name

    Declaration
    public int GetInteger(string parameterName, int defaultValue, params string[] aliases)
    Parameters
    Type Name Description
    System.String parameterName
    System.Int32 defaultValue
    System.String[] aliases
    Returns
    Type Description
    System.Int32

    Parameter value. If parameter is not set returns an empty string

    | Improve this Doc View Source

    GetRequired(String, Boolean, out String, String[])

    Gets the value of the parameter as when it's required. When parameter is not present, throws standard System.ArgumentException

    Declaration
    public void GetRequired(string parameterName, bool requireNonEmptyValue, out string value, params string[] aliases)
    Parameters
    Type Name Description
    System.String parameterName

    Parameter name

    System.Boolean requireNonEmptyValue

    When true, checks that parameter value is not null or empty and throws System.ArgumentException

    System.String value

    Result value

    System.String[] aliases
    | Improve this Doc View Source

    GetRequiredBoolean(String, Boolean, out Boolean, String[])

    Gets the value of the parameter as when it's required. When parameter is not present, throws standard System.ArgumentException

    Declaration
    public void GetRequiredBoolean(string parameterName, bool requireNonEmptyValue, out bool value, params string[] aliases)
    Parameters
    Type Name Description
    System.String parameterName

    Parameter name

    System.Boolean requireNonEmptyValue

    When true, checks that parameter value is not null or empty and throws System.ArgumentException

    System.Boolean value

    Result value

    System.String[] aliases
    | Improve this Doc View Source

    GetRequiredFloat(String, Boolean, out Single, String[])

    Gets the value of the parameter as when it's required. When parameter is not present, throws standard System.ArgumentException

    Declaration
    public void GetRequiredFloat(string parameterName, bool requireNonEmptyValue, out float value, params string[] aliases)
    Parameters
    Type Name Description
    System.String parameterName

    Parameter name

    System.Boolean requireNonEmptyValue

    When true, checks that parameter value is not null or empty and throws System.ArgumentException

    System.Single value

    Result value

    System.String[] aliases
    | Improve this Doc View Source

    GetRequiredInteger(String, Boolean, out Int32, String[])

    Gets the value of the parameter as when it's required. When parameter is not present, throws standard System.ArgumentException

    Declaration
    public void GetRequiredInteger(string parameterName, bool requireNonEmptyValue, out int value, params string[] aliases)
    Parameters
    Type Name Description
    System.String parameterName

    Parameter name

    System.Boolean requireNonEmptyValue

    When true, checks that parameter value is not null or empty and throws System.ArgumentException

    System.Int32 value

    Result value

    System.String[] aliases
    | Improve this Doc View Source

    ToString()

    Returns a string representation of the connection string

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()
    • Improve this Doc
    • View Source
    • 0 Comments