Dotfuscator User's Guide
Sending User Defined Data with Extended Keys

Most PreEmptive Analytics message types allow user defined data (in the form of key-value pairs) to be gathered and sent along with the message.

To send extended key information, specify an ExtendedKeySource on the attribute corresponding to the message you wish to send.

Dotfuscator uses the ExtendedKeySource to generate code that gathers the key-value pairs at runtime. The ExtendedKeySource is an IDictionary or IDictionary<string,string> valued property, method, field, or method argument; it is the developer's responsibility to ensure that a correct value is available in the ExtendedKeySource at the time the attributed method is executed.

Attributes that support extended keys define three properties for specifying an ExtendedKeySource:

Extended key settings are always optional. If they are omitted, the resulting PreEmptive Analytics message does not include extended key information.

Sample Feature attribute usage with ExtendedKeySource defined as a method called "GetDictionary":

Feature Attribute Usage with ExtendedKeySource
Copy Code
   ExtendedKeySourceElement = SourceElements.Method,
   ExtendedKeySourceName = "GetDictionary",
private void button1_Click(object sender, EventArgs e) {

// Creates and populates a dictionary with custom data
public IDictionary<string, string> GetDictionary() {
  Dictionary<string, string> dict = new Dictionary<string, string>();
  dict.Add("key1", "val1");
  dict.Add("key2", "val2");
  return dict;



© 2017 PreEmptive Solutions, LLC. All Rights Reserved.