Exemplo n.º 1
0
        /// <summary>
        /// Uninstall the plugin
        /// </summary>
        public override void Uninstall()
        {
            //generic attributes
            _avalaraTaxManager.DeleteAttributes();

            //settings
            _taxSettings.ActiveTaxProviderSystemName = _taxPluginManager.LoadAllPlugins()
                                                       .FirstOrDefault(taxProvider => !taxProvider.PluginDescriptor.SystemName.Equals(AvalaraTaxDefaults.SystemName))
                                                       ?.PluginDescriptor.SystemName;
            _settingService.SaveSetting(_taxSettings);
            _widgetSettings.ActiveWidgetSystemNames.Remove(AvalaraTaxDefaults.SystemName);
            _settingService.SaveSetting(_widgetSettings);
            _settingService.DeleteSetting <AvalaraTaxSettings>();

            //locales
            _localizationService.DeletePluginLocaleResources("Enums.Smi.Plugin.Tax.Avalara.Domain");
            _localizationService.DeletePluginLocaleResources("Plugins.Tax.Avalara");

            base.Uninstall();
        }