예제 #1
0
 public static void Set(this ISettingsValues src, string key, string value, Action <string> onRemoteUpdateCallback, CancellationToken cancel)
 {
     src[key] = value;
     src.OnRemoteChanged.Where(_ => string.Equals(_.Key, key, StringComparison.CurrentCultureIgnoreCase)).Select(_ => _.Value).Subscribe(onRemoteUpdateCallback, cancel);
 }
예제 #2
0
 public static IDisposable Set(this ISettingsValues src, string key, double value, Action <double?> onRemoteSuccessUpdateCallback, string formatString = "F1")
 {
     src[key] = value.ToString(formatString);
     return(src.OnRemoteChanged.Where(_ => string.Equals(_.Key, key, StringComparison.CurrentCultureIgnoreCase)).Select(_ => _.Value).Select(SafeConvertDouble).Subscribe(onRemoteSuccessUpdateCallback));
 }
예제 #3
0
 public static void Set(this ISettingsValues src, string key, int value, Action <int?> onRemoteSuccessUpdateCallback, CancellationToken cancel, string formatString = "F0")
 {
     src[key] = value.ToString(formatString);
     src.OnRemoteChanged.Where(_ => string.Equals(_.Key, key, StringComparison.CurrentCultureIgnoreCase)).Select(_ => _.Value).Select(SafeConvertInt).Subscribe(onRemoteSuccessUpdateCallback, cancel);
 }
예제 #4
0
 public static IDisposable Set(this ISettingsValues src, string key, string value, Action <string> onRemoteUpdateCallback)
 {
     src[key] = value;
     return(src.OnRemoteChanged.Where(_ => string.Equals(_.Key, key, StringComparison.CurrentCultureIgnoreCase)).Select(_ => _.Value).Subscribe(onRemoteUpdateCallback));
 }