C# Class Elastacloud.AzureManagement.Fluent.Types.CscfgFile

Used to encapsulate a .cscfg file and be able to pull properties from it
Inheritance: ConfigurationFile
Exibir arquivo Open project: azurecoder/fluent-management Class Usage Examples

Public Properties

Property Type Description
Instance ConfigurationFile

Public Methods

Method Description
DoesSettingExist ( string settingName, int roleIndex = 1 ) : bool

Checks to see whether a particular setting exists in the roleset

GetAdHocInstance ( System.Xml.Linq.XDocument doc ) : CscfgFile

Used to get an ad-hoc reference to the .cscfg file to parse out the settings

GetInstance ( string name ) : ConfigurationFile

Singleton for the file

GetInstanceCountForRole ( string roleName ) : int

Gets the instance count for a particular role name

GetRoleNameList ( ) : List

Gets a list of role names from the .cscfg file

GetSettingForRole ( string settingName, string roleName ) : string

Gets a setting value for a role given a rolename and settings name

GetSettingWithoutRole ( string settingName ) : string

Returns a setting without needing to have a role to look up

SetInstanceCountForRole ( string roleName, int instanceCount ) : void

Sets an instance count attribute value for a particular role

UpdateSettingForRole ( string settingName, string settingValue, string roleName ) : void

Updates an existing setting for a role with the predetermined value

Protected Methods

Method Description
GetFileExtension ( ) : string

Used to get the file instance

Private Methods

Method Description
CscfgFile ( System.Xml.Linq.XDocument doc ) : System.Collections.Generic

Used to generate ad-hoc instances of the .cscfg file

CscfgFile ( string name ) : System.Collections.Generic

Default constructor used to load and find the file

GetInstanceCountElementForRole ( string roleName ) : System.Xml.Linq.XElement

Gets the instance count for the role

GetSetting ( string settingName ) : System.Xml.Linq.XElement

Checks to see whether a particular setting exists in the roleset

Method Details

DoesSettingExist() public method

Checks to see whether a particular setting exists in the roleset
public DoesSettingExist ( string settingName, int roleIndex = 1 ) : bool
settingName string The name of the setting being checked
roleIndex int Not implemented but can be used to go to a particular role index based on the order of the XML Cscfg file
return bool

GetAdHocInstance() public static method

Used to get an ad-hoc reference to the .cscfg file to parse out the settings
public static GetAdHocInstance ( System.Xml.Linq.XDocument doc ) : CscfgFile
doc System.Xml.Linq.XDocument
return CscfgFile

GetFileExtension() protected method

Used to get the file instance
protected GetFileExtension ( ) : string
return string

GetInstance() public static method

Singleton for the file
public static GetInstance ( string name ) : ConfigurationFile
name string
return ConfigurationFile

GetInstanceCountForRole() public method

Gets the instance count for a particular role name
public GetInstanceCountForRole ( string roleName ) : int
roleName string
return int

GetRoleNameList() public method

Gets a list of role names from the .cscfg file
public GetRoleNameList ( ) : List
return List

GetSettingForRole() public method

Gets a setting value for a role given a rolename and settings name
public GetSettingForRole ( string settingName, string roleName ) : string
settingName string
roleName string
return string

GetSettingWithoutRole() public method

Returns a setting without needing to have a role to look up
public GetSettingWithoutRole ( string settingName ) : string
settingName string The name of the setting
return string

SetInstanceCountForRole() public method

Sets an instance count attribute value for a particular role
public SetInstanceCountForRole ( string roleName, int instanceCount ) : void
roleName string the name of the role
instanceCount int the number of instance of the role
return void

UpdateSettingForRole() public method

Updates an existing setting for a role with the predetermined value
public UpdateSettingForRole ( string settingName, string settingValue, string roleName ) : void
settingName string
settingValue string
roleName string
return void

Property Details

Instance public_oe static_oe property

The single instance of the file
public static ConfigurationFile,Elastacloud.AzureManagement.Fluent.Types Instance
return ConfigurationFile