Ejemplo n.º 1
0
        public static T InitializeConfig <T>(EncryptionSettings settings) where T : SalesforceConfig
        {
            Encryptor.init(settings);
            T config = SalesforceConfig.RetrieveConfig <T>() ?? Activator.CreateInstance <T>();

            config.SaveConfig();
            ServerConfiguration = config;
            return(config);
        }
Ejemplo n.º 2
0
        protected override SalesforceConfig InitializeConfig()
        {
            EncryptionSettings settings = new EncryptionSettings(new HmacSHA256KeyGenerator())
            {
                Password = "******",
                Salt     = "mysalt"
            };

            Encryptor.init(settings);
            Config config = SalesforceConfig.RetrieveConfig <Config>();

            if (config == null)
            {
                config = new Config();
            }
            return(config);
        }
        protected override Salesforce.SDK.Source.Settings.SalesforceConfig InitializeConfig()
        {
            EncryptionSettings settings = new EncryptionSettings(new HmacSHA256KeyGenerator())
            {
                Password = "******",
                Salt     = "friesaresaltyforsure"
            };

            Encryptor.init(settings);
            Config config = SalesforceConfig.RetrieveConfig <Config>();

            if (config == null)
            {
                config = new Config();
            }
            return(config);
        }
Ejemplo n.º 4
0
        protected override Task UpgradeConfigAsync()
        {
            if (!ApplicationData.Current.Version.Equals(0))
            {
                return(Task.CompletedTask);
            }
            var config = SalesforceConfig.RetrieveConfig <Config>().Result;

            if (config == null)
            {
                return(Task.CompletedTask);
            }
            Encryptor.init(new EncryptionSettings(new HmacSHA256KeyGenerator(HashAlgorithmNames.Md5)));
            config = SDKManager.InitializeConfigAsync <Config>().Result;
            Encryptor.ChangeSettings(
                new EncryptionSettings(new HmacSHA256KeyGenerator(HashAlgorithmNames.Sha256)));
            return(config.SaveConfigAsync());
        }
Ejemplo n.º 5
0
        public static async Task <T> InitializeConfigAsync <T>() where T : SalesforceConfig
        {
            T config = await SalesforceConfig.RetrieveConfig <T>();

            if (config == null)
            {
                config = Activator.CreateInstance <T>();
                await config.InitializeAsync();
            }

            if (config.ServerList == null)
            {
                config.ServerList = new System.Collections.ObjectModel.ObservableCollection <ServerSetting>();
            }

            await config.SaveConfigAsync();

            ServerConfiguration = config;
            return(config);
        }