private void InstalledPackage_BeforeDelete(InstalledPackage sender, EventArgs e) { if (string.Equals(sender.Data.Name, "tinifier", StringComparison.OrdinalIgnoreCase)) { ExtendDashboard.ClearTabs(); var section = ApplicationContext.Current.Services.SectionService.GetByAlias(PackageConstants.SectionAlias); if (section != null) { ApplicationContext.Current.Services.SectionService.DeleteSection(section); } } }
private void CreateTinifySection(ApplicationContext context) { // Create a new section var section = context.Services.SectionService.GetByAlias(PackageConstants.SectionAlias); if (section == null) { context.Services.SectionService.MakeNew(PackageConstants.SectionName, PackageConstants.SectionAlias, PackageConstants.SectionIcon); context.Services.UserService.AddSectionToAllUsers(PackageConstants.SectionAlias); ExtendDashboard.AddTabs(); } }