Ejemplo n.º 1
0
        private void updateSettings(AppSettings settings)
        {
            UseMockDataStore = settings.UseMockDataStore ?? UseMockDataStore;

            if (settings.ColorPalette != null)
            {
                if (ColorPalette == null)
                {
                    ColorPalette = new List <ColorResource>(settings.ColorPalette);
                }
                else
                {
                    ColorPalette = new List <ColorResource>(
                        ColorPalette.Union(settings.ColorPalette));
                }
            }

            if (!IsInitialized)
            {
                AppSecrets = AppSecrets.UpdateSettings(AppSecrets, settings.AppSecrets);

                ConnectionStringInfo = ConnectionStringInfo.UpdateSettings(ConnectionStringInfo,
                                                                           settings.ConnectionStringInfo);
                EmailInfo = EmailInfo.UpdateSettings(EmailInfo, settings.EmailInfo);
            }
        }
Ejemplo n.º 2
0
        //* Static Methods
        public static AppSecrets UpdateSettings(AppSecrets @this, AppSecrets other)
        {
            if (AppSettings.IsInitialized)
            {
                throw new InvalidOperationException(
                          $"{nameof(AppSecrets)} cannot be modified after initialization!");
            }

            if (@this == null)
            {
                @this = new AppSecrets();
            }

            @this.Android = other.Android ?? @this.Android;
            @this.IOS     = other.IOS ?? @this.IOS;

            return(@this);
        }