public Dictionary<string, object> GetValues()
{
var values = new Dictionary<string, object>();
foreach (var patchValue in Values)
{
if(values.ContainsKey(patchValue.Key))
{
MessageBox.Show("You Can not have more then one value for each key. (The key " + patchValue.Key + " apprears more then once");
return null;
}
int integer;
if(int.TryParse(patchValue.Value, out integer))
{
values.Add(patchValue.Key, integer);
continue;
}
long longNum;
if(long.TryParse(patchValue.Value, out longNum))
{
values.Add(patchValue.Key, longNum);
continue;
}
decimal decimalNum;
if (decimal.TryParse(patchValue.Value, out decimalNum))
{
values.Add(patchValue.Key, decimalNum);
continue;
}
bool boolean;
if (bool.TryParse(patchValue.Value, out boolean))
{
values.Add(patchValue.Key, boolean);
continue;
}
values.Add(patchValue.Key, patchValue.Value);
}
return values;
}
}