private async void IbnRemovePostData_Click(object sender, RoutedEventArgs e)
        {
            StringKeyValuePair pair = (StringKeyValuePair)((FrameworkElement)sender).DataContext;

            await AskRemove(viewModel.Settings.CustomPostDataPairs, pair,
                            $"Do you want to remove post data:\n{pair.Key}");
        }
Example #2
0
        /// <summary> Add a key/value pair setting to this aggregation </summary>
        /// <param name="Key"> Key for this setting </param>
        /// <param name="Value"> Value for this setting </param>
        /// <remarks> If a value already exists for the provided key, the value will be changed
        /// to the new value provided to this method. </remarks>
        public void Add_Setting(string Key, string Value)
        {
            // Look for existing key that matches

            // Ensure the list is defined
            if (Settings == null)
            {
                Settings = new List <StringKeyValuePair>();
            }

            // Ensure the dictionary was built
            if (settingLookupDictionary == null)
            {
                settingLookupDictionary = new Dictionary <string, StringKeyValuePair>(StringComparer.OrdinalIgnoreCase);
            }
            if (settingLookupDictionary.Count != Settings.Count)
            {
                foreach (StringKeyValuePair setting in Settings)
                {
                    settingLookupDictionary[setting.Key] = setting;
                }
            }

            // Does this key already exist?
            if (settingLookupDictionary.ContainsKey(Key))
            {
                settingLookupDictionary[Key].Value = Value;
            }
            else
            {
                StringKeyValuePair newValue = new StringKeyValuePair(Key, Value);
                Settings.Add(newValue);
                settingLookupDictionary[Key] = newValue;
            }
        }
Example #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            Utility.SetStatusBarColor("#212121", "#ffffff", 1);

            log        = e.Parameter as StringKeyValuePair;
            logTB.Text = log.key;
            string logStr = "";

            ShowProgressBar();
            logSV.Visibility = Visibility.Collapsed;
            Task.Factory.StartNew(() =>
            {
                string logsUrl = log.value;
                if (logsUrl.ToLowerInvariant().Contains("/release/releases"))
                {
                    logStr = VSTSService.GetReleaseLogs(logsUrl);
                }
                else
                {
                    logStr = VSTSService.GetBuildTimelineRecordLogs(logsUrl);
                }
            }).ContinueWith(async(Task t) =>
            {
                await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    logTextTB.Text = logStr;
                    HideProgressBar();

                    logSV.Visibility = Visibility.Visible;
                });
            });
        }
Example #4
0
        protected ActionResult GetValidationResult(StringKeyValuePair validationError)
        {
            var validationProblemDetails = new ValidationProblemDetails();

            validationProblemDetails.Errors.Add(validationError.Key, new string[] { validationError.Value });
            return(new BadRequestObjectResult(validationProblemDetails));
        }
Example #5
0
        /// <summary> Add a new setting string key value pair </summary>
        /// <param name="Key"> Key for this setting value </param>
        /// <param name="Value"> Value for this setting value </param>\
        /// <remarks> If a setting for that Key already exists, it will be replaced with the new Value</remarks>
        public void Add_Setting(string Key, string Value)
        {
            // Is the dictionary built?
            if (settingLookupTable == null)
            {
                settingLookupTable = new Dictionary <string, StringKeyValuePair>(StringComparer.OrdinalIgnoreCase);
            }

            // Is the dictionary apparently current?
            if (settingLookupTable.Count != Settings.Count)
            {
                foreach (StringKeyValuePair pair in Settings)
                {
                    settingLookupTable[pair.Key] = pair;
                }
            }

            // Now, is the an existing pair for this key?
            if (settingLookupTable.ContainsKey(Key))
            {
                settingLookupTable[Key].Value = Value;
            }
            else
            {
                StringKeyValuePair pair = new StringKeyValuePair(Key, Value);
                Settings.Add(pair);
                settingLookupTable[Key] = pair;
            }
        }
Example #6
0
    public static string GetString(string key)
    {
        StringKeyValuePair pair = new StringKeyValuePair(null, null);

        foreach (StringKeyValuePair p in strings)
        {
            if (p.key.Equals(key))
            {
                pair = p;
                break;
            }
        }
        if (pair.key == null)
        {
            throw new Exception("The key \"" + key + "\" is not registered as a STRING-key in the PlayerPrefManager");
        }
        return(PlayerPrefs.GetString(pair.key, pair.defaultValue));
    }
        /// <summary> Add a new option to the dictionary of associated standard options </summary>
        /// <param name="Key"> Key of this option </param>
        /// <param name="Value"> Value of this option </param>
        public void Add_Option(string Key, string Value)
        {
            if (Options == null)
            {
                Options = new List <StringKeyValuePair>();
            }

            // Ensure the dictionary is built
            if ((optionsDictionary == null) || ((optionsDictionary.Count != Options.Count)))
            {
                optionsDictionary = new Dictionary <string, string>();
                foreach (StringKeyValuePair thisPair in Options)
                {
                    optionsDictionary[thisPair.Key] = thisPair.Value;
                }
            }

            // Did this key already exist?
            if (optionsDictionary.ContainsKey(Key))
            {
                // Look for it in the list version
                StringKeyValuePair delete = null;
                foreach (StringKeyValuePair thisPair in Options)
                {
                    if (thisPair.Key == Key)
                    {
                        delete = thisPair;
                        break;
                    }
                }

                // If found, remove it
                if (delete != null)
                {
                    Options.Remove(delete);
                }
            }

            // Now, add this one
            optionsDictionary[Key] = Value;

            Options.Add(new StringKeyValuePair(Key, Value));
        }
Example #8
0
 public bool Remove(StringKeyValuePair item)
 {
     throw new NotImplementedException();
 }
Example #9
0
 public bool Contains(StringKeyValuePair item)
 {
     throw new NotImplementedException();
 }
Example #10
0
 public void Add(StringKeyValuePair item)
 {
     throw new NotImplementedException();
 }