/// <summary> /// Initializes the extension. /// </summary> /// <param name="classHelper">Provides a reference to the extension's class.</param> /// <param name="extensionProperties">A set of properties unique to the extension.</param> public void Init(IClassHelper classHelper, IPropertySet extensionProperties) { // Store the class helper as a member variable. this.classHelper = classHelper; IClass baseClass = classHelper.Class; // Get the names of the created and modified fields, if they exist. if (extensionProperties != null) { this.extensionProperties = extensionProperties; object createdObject = extensionProperties.GetProperty(Resources.CreatedFieldKey); object modifiedObject = extensionProperties.GetProperty(Resources.ModifiedFieldKey); object userObject = extensionProperties.GetProperty(Resources.UserFieldKey); // Make sure the properties exist and are strings. if (createdObject != null && createdObject is String) { createdFieldName = Convert.ToString(createdObject); } if (modifiedObject != null && modifiedObject is String) { modifiedFieldName = Convert.ToString(modifiedObject); } if (userObject != null && userObject is String) { userFieldName = Convert.ToString(userObject); } } else { // First time the extension has been run. Initialize with default values. InitNewExtension(); } // Set the positions of the fields. SetFieldIndexes(); // Set the current user name. userName = GetCurrentUser(); }
/// <summary> /// Initializes the extension, passing in a reference to its class helper. /// </summary> /// <param name="pClassHelper"></param> /// <param name="pExtensionProperties"></param> public void Init(IClassHelper pClassHelper, IPropertySet pExtensionProperties) { }
/// <summary> /// Informs the extension that the class is being disposed of. /// </summary> public void Shutdown() { classHelper = null; }