forked from smartstore/SmartStoreNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
48 lines (38 loc) · 1.18 KB
/
Copy pathPlugin.cs
File metadata and controls
48 lines (38 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using SmartStore.Core.Plugins;
using SmartStore.Services.Localization;
using SmartStore.Services.Configuration;
using SmartStore.Services;
using System.Data.Entity.Migrations;
using SmartStore.Tax.Data.Migrations;
namespace SmartStore.Tax
{
public partial class Plugin : BasePlugin
{
private readonly ICommonServices _services;
public Plugin(ICommonServices services)
{
this._services = services;
}
public override void Install()
{
var settings = _services.Settings;
var loc = _services.Localization;
// add resources
loc.ImportPluginResourcesFromXml(this.PluginDescriptor);
base.Install();
}
public override void Uninstall()
{
var settings = _services.Settings;
var loc = _services.Localization;
// delete resources
loc.DeleteLocaleStringResources(this.PluginDescriptor.ResourceRootKey);
loc.DeleteLocaleStringResources("Plugins.Tax.CountryStateZip");
loc.DeleteLocaleStringResources("Plugins.Tax.FixedRate");
var migrator = new DbMigrator(new Configuration());
migrator.Update(DbMigrator.InitialDatabase);
base.Uninstall();
}
}
}