Click or drag to resize

ConfigComponentAttribute Class

Use this attribute to supplement a configuration class with a XML configuration section within its XML container element and with a key for the configuration object/folder stored in the repository.
Inheritance Hierarchy
SystemObject
  SystemAttribute
    PDTec.IceNet.Sdk.ImplementationConfigComponentAttribute

Namespace:  PDTec.IceNet.Sdk.Implementation
Assembly:  PDTec.IceNet.Sdk (in PDTec.IceNet.Sdk.dll) Version: 7.2.0.0 (7.2.7583.15464)
Syntax
C#
public class ConfigComponentAttribute : Attribute

The ConfigComponentAttribute type exposes the following members.

Constructors
  NameDescription
Public methodConfigComponentAttribute
Creates an attribute instance. Used internally.
Top
Properties
  NameDescription
Public propertyIsValidWithDefault
Gets or sets a value indicating whether this configuration component is valid without an XML section. In this case the configuration component must provide valid default settings.
Public propertyKey
Gets or sets the key of the configuration entry object.
Public propertySection
Gets or sets the configuration section name within the /configuration/ice.net/components element.
Public propertyTypeId
When implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute.)
Top
Methods
  NameDescription
Public methodEquals
Returns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Returns the hash code for this instance.
(Inherited from Attribute.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsDefaultAttribute
When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute.)
Public methodMatch
When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
The example shows how to use the ConfigComponent attribute.
[ConfigComponent(Section="unitOfMeasurement", Key="Config.UnitOfMeasurement", IsValidWithDefault=true)]
public class UnitOfMeasurementConfig : RepositoryConfigBase<UnitOfMeasurementConfig>
{
    public void Load(IRepository pRepository)
    {
        IFolder pConfigFolder;
        if (pRepository.TryGetFolderByKey(ConfigKey, out pConfigFolder))
        {
            ...
        }
    }
}
See Also