Exemplo n.º 1
0
        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 SetCompanyLogo(string companyLogoFileName, byte[] data)
        {
            var store = StorageFactory.GetStorage(TenantProvider.CurrentTenantID.ToString(), "logo");

            if (!_isDefault)
            {
                try
                {
                    store.DeleteFiles("", "*", false);
                }
                catch
                {
                }
            }
            using (var memory = new MemoryStream(data))
                using (var image = Image.FromStream(memory))
                {
                    CompanyLogoSize = image.Size;
                    memory.Seek(0, SeekOrigin.Begin);
                    store.Save(companyLogoFileName, memory);
                    _companyLogoFileName = companyLogoFileName;
                }
            _isDefault = false;

            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();
            }
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 7
0
 public void RestoreDefault(TenantInfoSettings tenantInfoSettings, TenantLogoManager tenantLogoManager)
 {
     RestoreDefaultTenantName();
     RestoreDefaultLogo(tenantInfoSettings, tenantLogoManager);
 }