I have a functioning custom SSIS task (for SQL 2005) with a UI based on DTSBaseTaskUI, as per the samples from Kirk Haselden's book. One of the things I'd like to implement is enabling/disabling some of the properties based on another. According to Mr. Haselden, this is supported in the TaskUI foundation classes with the EnableDisableAttribute. Unfortunately, the whole of the documentation in the book is two sentences, the first of which states "Use the EnableDisable attribute to disable a property in the property grid based on an array of values of another property," and the other just informs the reader that one of the two properties in question must have the RefreshProperties attribute. The IntelliSense is only marginally useful, indicating that EnableDisable takes two arguments, like so:
EnableDisable(string propertyName, object[] valuesToEnable) |
From this meager information, I attempted something like the following:
[RefreshProperties(RefreshProperties.All)] |
public bool EnableOtherProperty |
{ |
get { return task.EnableOtherProperty; } |
set { task.EnableOtherProperty = value; } |
} |
[EnableDisable("EnableOtherProperty", new object[] {true})] |
public string OtherProperty |
{ |
get { return task.OtherProperty; } |
set { task.OtherProperty = value; } |
} |
While this compiles and runs, it has no effect at all. I tried consolidating the attributes, like so:
[RefreshProperties(RefreshProperties.All), |
EnableDisable("OtherProperty", new object[] {true})] |
public bool EnableOtherProperty |
{ |
get { return task.EnableOtherProperty; } |
set { task.EnableOtherProperty = value; } |
} |
public string OtherProperty |
{ |
get { return task.OtherProperty; } |
set { task.OtherProperty = value; } |
} |
This, likewise, had no effect.
I've tried a number of other combinations, all to no avail. My question then, is, has anyone got this working? Are there any samples available where this property is used? Any assistance would be greatly appreciated.
Thanks,
Tom