Example #1
0
        protected void SaveTizenSettingsToDisk(ITizenLaunchSettings newSettings)
        {
            var serializeData = new Dictionary <string, Dictionary <string, object> >(StringComparer.Ordinal);

            if (newSettings.Name != string.Empty)
            {
                serializeData.Add(newSettings.Name, TizenLaunchSettings.ToSerializableForm(newSettings));
            }

            try
            {
                EnsureSettingsFolder();

                JsonSerializerSettings settings = new JsonSerializerSettings()
                {
                    NullValueHandling = NullValueHandling.Ignore
                };
                string jsonString = JsonConvert.SerializeObject(serializeData, Formatting.Indented, settings);

                IgnoreFileChanges = true;
                FileManager.WriteAllText(TizenLaunchSettingsFile, jsonString);
            }
            catch (Exception ex)
            {
                string err = string.Format("The following error occurred when writing to the launch settings file '{0}'. {1}", TizenLaunchSettingsFile, ex.Message);
                throw;
            }
            finally
            {
                IgnoreFileChanges = false;
            }
        }
        public static Dictionary <string, object> ToSerializableForm(ITizenLaunchSettings launchSettings)
        {
            var data = new Dictionary <string, object>(StringComparer.Ordinal);

            if (!string.IsNullOrEmpty(launchSettings.ExtraArguments))
            {
                data.Add(Prop_ExtraArgs, launchSettings.ExtraArguments);
            }

            return(data);
        }
Example #3
0
        protected void UpdateProfilesAsync()
        {
            var tizenLaunchSettings = GetTizenLaunchSettings();

            if (tizenLaunchSettings.Name == null)
            {
                tizenLaunchSettings.Name           = Path.GetFileNameWithoutExtension(CommonProjectServices.Project.FullPath);
                tizenLaunchSettings.ExtraArguments = string.Empty;
            }

            _tizenLaunchSetting = tizenLaunchSettings;
        }
Example #4
0
        public async Task UpdateAndSaveTizenSettingsAsync(ITizenLaunchSettings newSettings)
        {
            await CheckoutTizenSettingsFileAsync().ConfigureAwait(false);

            SaveTizenSettingsToDisk(newSettings);
        }