Пример #1
0
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (fcm is null)
     {
         fcm = new FileConfigModel();
     }
     this.SetValue(fcm, (string)parameter, value);
     return(JsonConvert.SerializeObject(fcm));
 }
Пример #2
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value == null)
     {
         return(null);
     }
     try
     {
         fcm = JsonConvert.DeserializeObject <FileConfigModel>((string)value);
         return(this.GetValue <string>(fcm, (string)parameter));
     }
     catch
     {
         return(null);
     }
 }