public override object ReadJson(JsonReader reader,
                                        Type objectType, object existingValue,
                                        JsonSerializer serializer)
        {
            var jsonObject  = JObject.Load(reader);
            var measurement = default(IMeasurement);

            string objectTypeName = jsonObject["TypeName"].Value <string>();

            if (objectTypeName == typeof(RandomMeasurement).Name)
            {
                measurement = new RandomMeasurement();
            }
            else if (objectTypeName == typeof(RandomTimeSeriesMeasurement).Name)
            {
                measurement = new RandomTimeSeriesMeasurement();
            }
            else if (objectTypeName == typeof(PMUMeasurement).Name)
            {
                measurement = new PMUMeasurement();
            }
            else if (objectTypeName == typeof(ScadaMeasurement).Name)
            {
                measurement = new ScadaMeasurement();
            }
            else if (objectTypeName == typeof(PspMeasurement).Name)
            {
                measurement = new PspMeasurement();
            }
            if (measurement != null)
            {
                serializer.Populate(jsonObject.CreateReader(), measurement);
            }

            return(measurement);
        }
 private void PMUSettings_Click(object sender, RoutedEventArgs e)
 {
     PMUMeasurement.OpenSettingsWindow();
 }