Share via


ModulePageIdentifierAttribute.Guid Property

Definition

Gets the identifier that is used in the preference store.

public:
 property Guid Guid { Guid get(); };
public Guid Guid { get; }
member this.Guid : Guid
Public ReadOnly Property Guid As Guid

Property Value

The GUID that is associated with the ModulePage object, or Empty if the GUID does not exist in the preference store.

Examples

The following example creates a ModulePageIdentifierAttribute object and sends the value of the Guid property to the trace listener.

protected override Guid PreferenceKey {
    get {
        object[] attrs = GetType().
            GetCustomAttributes(
            typeof(ModulePageIdentifierAttribute), 
            false);
        if (attrs.Length > 0) {
            ModulePageIdentifierAttribute
                modulePageIdentifierAttr = 
                (ModulePageIdentifierAttribute)attrs[0];
            return modulePageIdentifierAttr.Guid;
        }

        return Guid.Empty;
    }
} 

Remarks

This method can be overridden to return different identifiers depending on the state of the page.

Applies to