Scripting: Optional Overrides
Common OverridesThese overrides are common to most, if not all, of the classes inherited in VSI scripting. Each description below describes the default behavior and some of the common reasons they might be overridden.
- IsPropertyVisible(PropertyName As String) - Defines whether the specified Property Name is currently visible in the property grid. Override this function to set the visibility of a property based on your own criteria.
- IsPropertyEnabled(PropertyName As String) - Defines whether the specified Property Name is currently enabled in the property grid. Override this function to enable/disable a property based on your own criteria.
- IsEmpty() - Returns true if all properties with a <Viewable> attribute are set to their default value. IsEmpty is frequently used to determine if an object should be saved or serialized. This may need to be overridden in the case of complex properties or child objects.
- ValidateProperties() - Validates the properties of the object, returning a list of validation errors. Derived classes may override this method to add validation logic. Classes which override this message should always call MyBase.ValidateProperties(), add any new error messages to the returned list, and then return the list.
- ToString() - Returns a string value representation of the object. This may be overridden to return a custom string value that is displayed in the property grid. For example, an EmbeddedLexicon object overrides ToString to return the number of Lexicons and/or Entries that it represents.
See Also:Visual Studio Integration
Property Grid Editors and Type Converters