The method `GetPlugins` in the `LocalPluginMetadataProvider` class and the reference to it in the `PluginUpdateChecker` were renamed as `GetInstalledPlugins`. This renaming serves to make the method name more descriptive and better represent its purpose, i.e., to retrieve installed plugins.
The IsValid methods for string and decimal types in the LocalPluginMetadataProvider class have been removed. Previous changes made these methods redundant, and they are no longer being used anywhere within this class. This cleanup will help to maintain the readability and maintainability of the codebase.
This change was implemented to more accurately represent the functioning of the class. The class doesn't provide the update itself but rather checks if an update is available. This naming thus improves the code readability and understanding of its functionality.
The refactoring was done for LocalPluginMetadataProvider and LocalPlugin classes. A new SymbolReader class is introduced to read property values from the plugin assemblies' types using reflection, removing repeated code for this task. String constants are introduced for the "*.dll" extension and for the properties names to avoid hardcoded strings.
In LocalPlugin, a validation check method 'IsValid' is introduced to ensure the plugin's name is not null or empty and its version is greater than 0. This is to ensure only valid plugins get added to the installed plugins. Improved the equality check for plugin names to ignore casing. All these changes made the code more maintainable and robust, reducing possibility for errors.
The location of the constant initialization "IPlugin" was moved closer to its usage within the GetPlugins() method. This provides better code readability
Removed the GetKnownProperties method in the LocalPluginMetadataProvider class. This part was unnecessary because we rely on a specific set of properties ("Text") and don't need to retrieve all public instance properties. This results in cleaner and more efficient code.