Dotfuscator User's Guide
RuntimeCheckAttribute

Summary

The RuntimeCheckAttribute is the abstract base class of attributes which indicate to Dotfuscator where a Check should be injected. It defines properties common to Checks, such as Actions and Application Notification. Each particular derived class determines the kind of check that will be injected.

For historical reasons, neither InsertTamperCheckAttribute nor InsertShelfLifeAttribute derive from this class.

RuntimeCheckAttribute
Copy Code
public abstract class RuntimeCheckAttribute : Attribute

Property Members

Name Summary
Action : CheckAction

Indicates what predefined Action the application should take in the event of a runtime check resulting in a true value (e.g., when a debugging check detects the application is being debugged).

If an ApplicationNotificationSinkElement is also specified, the Sink will be called before this predefined Action is taken.

By default, this is set to CheckAction.None, which performs no action.

ActionProbability : double

Indicates the probability of the specified Action occurring if the Check results in a true value. It should be a decimal number between 0.00 (never take action) and 1.00 (always take action).

For example, a value of 0.50 indicates a 50% chance of the Action executing, while a value of 0.83 would indicate a 83% chance of it executing.

By default, this is set to 1.00 (i.e., the Action always occurs if the Check detects its condition).

ApplicationNotificationSinkElement : SinkElements

Indicates how to notify the application of the result of the Check, at the time that the attributed method is called.

If this property is set, ApplicationNotificationSinkName must be set to indicate the name of the method, field, property, or argument to the attributed method that will be used to notify the application.

If this property is set to SinkElements.Method, SinkElements.Field, SinkElements.Property, or SinkElements.Delegate, then ApplicationNotificationSinkOwner may be set as well. If it is not set, Dotfuscator will search the for the Sink on the type defining the attributed method.

If this property is set to DefaultAction, Dotfuscator will error during processing, as that value is not defined
for Checks that derive from this class.

If this property is not set, or is set to None, Dotfuscator will not generate code that notifies the application of the check's result.

ApplicationNotificationSinkName : String

The name of the method, field, property, or argument to the attributed method that will be used to notify the application of the result of the runtime check, at the time that the attributed method is called.

If this property is set, ApplicationNotificationSinkElement is required to be set as well.

If this property is not set, Dotfuscator will not generate code that notifies the application of the check's result.

ApplicationNotificationSinkOwner : Type

Indicates the type that defines the method, field, property, or delegate specified by ApplicationNotificationSinkName.

If it is not set, Dotfuscator will search for the Sink on the type defining the attributed method.

See Also

Checks

 

 


© 2016 PreEmptive Solutions, LLC. All Rights Reserved.

www.preemptive.com