Dotfuscator User's Guide
InsertShelfLifeAttribute

Summary

The InsertShelfLifeAttribute is an instrumentation time attribute for methods. Dotfuscator will insert shelf life code into any method with this attribute. At runtime, the shelf life code can send a warning or expiration message if the application has expired or is about to expire. If the warning period is entered, then a user defined action can be executed. Upon expiration, the default behavior is to exit the application, though a user-defined action can be executed instead. In order to use Shelf Life your application must contain methods marked with a Setup and Teardown attribute. Do not put the InsertShelfLife attribute on the same method containing the Setup Attribute. Methods with this attribute must be executed after the method containing the Setup Attribute.

See Shelf Life Check for a high-level discussion of the features of InsertShelfLifeAttribute.

Note that though this attribute is used to indicate a Check, it does not derive from RuntimeCheckAttribute for historical reasons.

InsertShelfLifeAttribute
Copy Code
public sealed class InsertShelfLifeAttribute : Attribute

Constructor Members

Name Summary
InsertShelfLifeAttribute() Initializes a new instance of the class.

Property Members

Name Summary
ActivationKeyFile : String The path to the Shelf Life Activation Key file.
ExpirationDate : String Indicates the date the application will expire and/or deactivate. This can be an absolute date (e.g., "2009-12-31") or a positive integer representing number of days after the Dotfuscation date that the application should expire.
ExpirationNotificationSinkElement : SinkElements Indicates whether and how to notify the application after shelf life expiration, at the time that the attributed method is called. A sink element may be a writable boolean field, settable boolean property, a void( boolean ) method to call, or a Delegate to invoke. To use this property, ExpirationNotificationSinkName must also be set. If ExpirationNotificationSinkElement is a field, property, or method, the ExpirationNotificationSinkOwner should also be set if it is not in the same class as the attributed method. If the SinkElement is set to “DefaultAction”, Dotfuscator will inject code that exits the application if shelf life expiration is detected.
ExpirationNotificationSinkName : String The name of the property, field, method to set or call after a shelf life expiration check. If this property is set, ExpirationNotificationSinkElement is required to be set as well. If this property is not set, Dotfuscator will not generate code that notifies the application of expiration.
ExpirationNotificationSinkOwner : Type ExpirationNotificationSinkOwner indicates the name of the type that defines the ExpirationNotificationSink method, field, property, argument, or delegate. If not set, the named sink element is searched for on the attributed method’s type.

ExtendedKeyMethodArguements : String

A pattern indicating which parameter names and values should be automatically added to the messages extended key data at runtime.  See Automatically Sending Method Parameters as Extended Keys for details on supported patterns.

ExtendedKeySourceElement : SourceElements Indicates how to access the extended key dictionary at runtime, at the time that the attributed method is called (e.g. a field, property, method, or method parameter). To use this property, ExtendedKeySourceName must also be set. If ExtendedKeySourceElement is a field, method, or property, ExtendedKeySourceOwner must also be set unless the field, method or property is defined on the same class as the attributed method.
ExtendedKeySourceName : String The name of the property, field, method, or method parameter that will contain the extended key dictionary at runtime, at the time that the attributed method is called. If this property is set, ExtendedKeySourceElement is required to be set as well. If this property is not set, Dotfuscator will not generate code to send extended key information.
ExtendedKeySourceOwner : Type If the ExtendedKeySourceElement is a field, method or property, ExtendedKeySourceOwner indicates the name of the type that defines the field, method or property. If not set, the named source element is searched for on the attributed method’s type.
PrivateKeyFile : String The path to a PKCS #12 Private Key file that is optionally used to provide additional validation of a Shelf Life token.
PrivateKeyFilePassword : String The password protecting the Private Key file.
ShelfLifeTokenSourceElement : SourceElements ShelfLifeTokenSourceElement indicates how to access the optional shelf life token source at runtime, at the time that the attributed method is called (e.g. a field, property, method, or method parameter). To use this property, ShelfLifeTokenSourceName must also be set. If ShelfLifeTokenSourceElement is a field, method, or property, ShelfLifeTokenSourceOwner must also be set unless the field, method or property is defined on the same class as the attributed method.
ShelfLifeTokenSourceName : String The name of the property, field, method, or method parameter that will contain the shelf life token at runtime, at the time that the attributed method is called. If this property is set, ShelfLifeTokenSourceElement is required to be set as well. If this property is not set, Dotfuscator will create a shelf life token from the shelf life activation key during instrumentation.
ShelfLifeTokenSourceOwner : Type If the ShelfLifeTokenSourceElement is a field, method or property, ShelfLifeTokenSourceOwner indicates the name of the type that defines the field, method or property. If not set, the named source element is searched for on the attributed method’s type.
WarningDate : String Indicates the date a warning of impending application expiration will occur. This can be an absolute date

(e.g., 2009-12-31) or a positive integer representing number of days after the Dotfuscation date that the application should issue a warning.

WarningNotificationSinkElement : SinkElements Indicates whether and how to notify the application of impending shelf life expiration, at the time that the attributed method is called. A sink element may be a writable boolean field, settable boolean property, a void( boolean ) method to call, or a Delegate to invoke. To use this property, WarningNotificationSinkName must also be set. If ApplicationNotificationSinkElement is a field, property, or method, the WarningNotificationSinkOwner should also be set if it is not in the same class as the attributed method. If the SinkElement is set to “DefaultAction”, Dotfuscator will not inject code to perform any additional warning behavior.
WarningNotificationSinkName : String The name of the property, field, method to set or call after a shelf life warning check. If this property is set, WarningNotificationSinkElement is required to be set as well. If this property is not set, Dotfuscator will not inject code to perform any additional warning behavior.
WarningNotificationSinkOwner : Type WarningNotificationSinkOwner indicates the name of the type that defines the WarningNotificationSink method, field, property, argument, or delegate. If not set, the named sink element is searched for on the attributed method’s type.
See Also

Instrumentation

References

Shelf Life

 

 


© 2016 PreEmptive Solutions, LLC. All Rights Reserved.

www.preemptive.com