public void SetCompanyLogo(string companyLogoFileName, byte[] data, TenantInfoSettings tenantInfoSettings, TenantLogoManager tenantLogoManager) { var store = StorageFactory.GetStorage(TenantManager.GetCurrentTenant().TenantId.ToString(), "logo"); if (!tenantInfoSettings.IsDefault) { try { store.DeleteFiles("", "*", false); } catch { } } using (var memory = new MemoryStream(data)) using (var image = Image.FromStream(memory)) { tenantInfoSettings.CompanyLogoSize = image.Size; memory.Seek(0, SeekOrigin.Begin); store.Save(companyLogoFileName, memory); tenantInfoSettings.CompanyLogoFileName = companyLogoFileName; } tenantInfoSettings.IsDefault = false; tenantLogoManager.RemoveMailLogoDataFromCache(); }
public void Save(int tenantId, bool restore = false) { SettingsManager.Instance.SaveSettings(this, tenantId); SetNewLogoText(tenantId, restore); TenantLogoManager.RemoveMailLogoDataFromCache(); }
public void Save(int tenantId, bool restore = false) { SaveForTenant(tenantId); SetNewLogoText(tenantId, restore); TenantLogoManager.RemoveMailLogoDataFromCache(); }
public void Save(int tenantId, bool restore = false) { SaveForTenant(tenantId); if (tenantId == Tenant.DEFAULT_TENANT) { AppliedTenants.Clear(); } else { SetNewLogoText(tenantId, restore); TenantLogoManager.RemoveMailLogoDataFromCache(); } }
public void RestoreDefaultLogo(TenantInfoSettings tenantInfoSettings, TenantLogoManager tenantLogoManager) { tenantInfoSettings.IsDefault = true; var store = StorageFactory.GetStorage(TenantManager.GetCurrentTenant().TenantId.ToString(), "logo"); try { store.DeleteFiles("", "*", false); } catch { } tenantInfoSettings.CompanyLogoSize = default; tenantLogoManager.RemoveMailLogoDataFromCache(); }
public void RestoreDefaultLogo() { _isDefault = true; var store = StorageFactory.GetStorage(TenantProvider.CurrentTenantID.ToString(), "logo"); try { store.DeleteFiles("", "*", false); } catch { } CompanyLogoSize = default(Size); TenantLogoManager.RemoveMailLogoDataFromCache(); }