C# Class Sage.ResourceManagement.ResourceManager

Handles internal file resource management.
Mostra file Open project: igorfrance/sage

Public Methods

Method Description
GetHttpResponse ( string url ) : WebResponse

Returns the WebResponse resulting from issuing a request to url.

GetHttpResponse ( string url, string username, string password ) : WebResponse

Returns the WebResponse resulting from issuing a request to url, using the specified username and password.

GetRemoteTextFile ( string url ) : string

Fetches the remote file from the specified url and returns the response text.

LoadXml ( string path ) : CacheableXmlDocument

Creates and returns a new CacheableXmlDocument, loaded from the specified path.

LoadXmlDocument ( string path ) : CacheableXmlDocument

Creates and returns a new CacheableXmlDocument, loaded from the specified path.

LoadXmlDocument ( string path, SageContext context ) : CacheableXmlDocument

Creates and returns a new CacheableXmlDocument, loaded from the specified path, using the specified context.

LoadXmlDocument ( string path, SageContext context, string schemaPath ) : CacheableXmlDocument

Creates, validates and returns a new CacheableXmlDocument, loaded from the specified path, using the specified context and schemaPath.

ResourceManager ( SageContext context ) : System

Initializes a new instance of the ResourceManager class, using the specified SageContext.

ValidateDocument ( XmlDocument document, string schemaPath ) : ValidationResult

Validates the specified document document against the XML schema loaded from the specified schemaPath, and returns an object that contains the validation information.

ValidateElement ( XmlElement element, string schemaPath ) : ValidationResult

Validates the specified document element against the XML schema loaded from the specified schemaPath, and returns an object that contains the validation information.

Private Methods

Method Description
GetPhrase ( string phraseId ) : string

Gets the dictionary phrase with the specified id, for the current category, in the current locale.

LoadGlobalizedDocument ( string path, SageContext context ) : CacheableXmlDocument
LoadSourceDocument ( string path, SageContext context ) : CacheableXmlDocument

Method Details

GetHttpResponse() public static method

Returns the WebResponse resulting from issuing a request to url.
public static GetHttpResponse ( string url ) : WebResponse
url string The URL to which to send the request.
return System.Net.WebResponse

GetHttpResponse() public static method

Returns the WebResponse resulting from issuing a request to url, using the specified username and password.
public static GetHttpResponse ( string url, string username, string password ) : WebResponse
url string The URL to which to send the request.
username string The username to use.
password string The password to use.
return System.Net.WebResponse

GetRemoteTextFile() public static method

Fetches the remote file from the specified url and returns the response text.
public static GetRemoteTextFile ( string url ) : string
url string The URL of the file to fetch.
return string

LoadXml() public method

Creates and returns a new CacheableXmlDocument, loaded from the specified path.
public LoadXml ( string path ) : CacheableXmlDocument
path string The path.
return CacheableXmlDocument

LoadXmlDocument() public static method

Creates and returns a new CacheableXmlDocument, loaded from the specified path.
public static LoadXmlDocument ( string path ) : CacheableXmlDocument
path string The path to the document to load.
return CacheableXmlDocument

LoadXmlDocument() public static method

Creates and returns a new CacheableXmlDocument, loaded from the specified path, using the specified context.
public static LoadXmlDocument ( string path, SageContext context ) : CacheableXmlDocument
path string The path to the document to load.
context SageContext The context to use to resolve the and load the document.
return CacheableXmlDocument

LoadXmlDocument() public static method

Creates, validates and returns a new CacheableXmlDocument, loaded from the specified path, using the specified context and schemaPath.
public static LoadXmlDocument ( string path, SageContext context, string schemaPath ) : CacheableXmlDocument
path string The path to the document to load.
context SageContext The context to use to resolve the and load the document.
schemaPath string The path to the XML schema to use to validate the document against.
return CacheableXmlDocument

ResourceManager() public method

Initializes a new instance of the ResourceManager class, using the specified SageContext.
public ResourceManager ( SageContext context ) : System
context SageContext The current context.
return System

ValidateDocument() public static method

Validates the specified document document against the XML schema loaded from the specified schemaPath, and returns an object that contains the validation information.
public static ValidateDocument ( XmlDocument document, string schemaPath ) : ValidationResult
document System.Xml.XmlDocument The document to validate.
schemaPath string The path to the XML schema to use to validate the document against.
return Sage.Configuration.ValidationResult

ValidateElement() public static method

Validates the specified document element against the XML schema loaded from the specified schemaPath, and returns an object that contains the validation information.
public static ValidateElement ( XmlElement element, string schemaPath ) : ValidationResult
element System.Xml.XmlElement The element to validate.
schemaPath string The path to the XML schema to use to validate the element against.
return Sage.Configuration.ValidationResult