Property | Type | Description | |
---|---|---|---|
_strAssemblyLocation | string |
Method | Description | |
---|---|---|
AssemblyLocatorBase ( ) : System |
Initialize the one and only property of this class, which holds the fully qualified path from which the containing assembly was loaded. Use this constructor to link the configuration file to the assembly that defines this class. IMPORTANT: If the assembly loads from the Global Assembly Cache, its configuration file must be stored in the application directory. Be aware that if an assembly exists in the Global Assembly Cache, it loads from there, even if there is a copy in the application directory. |
|
AssemblyLocatorBase ( Assembly pasmLinkedAssembly ) : System |
Initialize the one and only property of this class, which holds the fully qualified path from which the containing assembly was loaded. Use this constructor to link the configuration file to the assembly that defines this class. IMPORTANT: If the assembly loads from the Global Assembly Cache, its configuration file must be stored in the application directory. Be aware that if an assembly exists in the Global Assembly Cache, it loads from there, even if there is a copy in the application directory. |
|
GetDLLSetting ( string pstrSettingsKey ) : string |
Return the specified setting value, as a string.
|
Method | Description | |
---|---|---|
GetAssemblyBuildDate ( DateTimeKind pdtmKind ) : DateTime |
Return the LastWriteTime of the file that contains the executing assembly. For all practical purposes, that is the date on which the assembly was built.
|
|
GetAssemblyVersion ( ) : Version |
Return the Version structure, to expedite parsing its parts.
|
|
GetAssemblyVersionString ( ) : string |
Return the complete version of the executing assembly.
|
|
SetPropertiesFromDLLConfiguration ( Type pderivedType ) : PropertySourceCounts |
Set the like named properties from the linked configuration file. This can almost certainly be simplified by enumerating the settings, but either way risks a NOT FOUND exception. This method uses some fairly tricky Reflection gymnastics to map the key names in a configuration file to property names on an object. |
Method | Description | |
---|---|---|
FromString ( PropertyInfo piThisProperty, string strConfigValueString ) : object |
Create an object of the correct type from a string. Please see the Remarks section for important information. For conversion purposes, objects fall into two groups: enumerations, and everything else. Segregating inputs into the correct group is done by evaluating the PropertyType.BaseType property of the input PropertyInfo object, since enumerations derive from a distinct base type, System.Enum. Everything else derives from System.Object, and its conversion is handled by the SetValue method on the supplied PropertyInfo object. |
|
FullyQualifiedDLLConfigFileName ( bool pfIsForShow ) : string | ||
InitializeInstance ( ) : void |
Both constructors call this method to finish initializing the instance. Private string member _strAssemblyLocation must be initialized before the constructor calls this method.
|
|
SaveErrorReport ( Type pderivedType, string pstrPropertyName, Exception pexAllKinds ) : Exception |
Protected method SetPropertiesFromDLLConfiguration calls this routine to assemble an error message for appending to a string, for subsequent review by callers of derived classes.
|
public AssemblyLocatorBase ( Assembly pasmLinkedAssembly ) : System | ||
pasmLinkedAssembly | Assembly | /// Pass in a reference to the assembly to which the configuration file /// is linked. For example, you can use the executing assembly of the /// object at the top of the inheritance tree. /// |
return | System |
protected GetAssemblyBuildDate ( DateTimeKind pdtmKind ) : DateTime | ||
pdtmKind | DateTimeKind | /// This DateTimeKind enumeration member specifies whether to report the /// LastWriteTime or the LastWriteTimeUtc. /// |
return | DateTime |
protected GetAssemblyVersionString ( ) : string | ||
return | string |
public GetDLLSetting ( string pstrSettingsKey ) : string | ||
pstrSettingsKey | string | /// This string is the name (key) of the desired setting. /// |
return | string |
protected SetPropertiesFromDLLConfiguration ( Type pderivedType ) : PropertySourceCounts | ||
pderivedType | Type | /// When the derived class constructor calls this method, it must pass in a /// reference to its own Type property. /// |
return | PropertySourceCounts |