public void LoadConfiguration() { try { var filename = GetConfigFilename(); if (string.IsNullOrWhiteSpace(filename) || !File.Exists(filename)) { return; } XmlSerializer x = new XmlSerializer(GetType()); TextReader tr = new StreamReader(filename); CoordinateConversionLibraryConfig temp = null; try { temp = x.Deserialize(tr) as CoordinateConversionLibraryConfig; } catch { /* Deserialize Failed */ } finally { tr.Close(); } if (temp == null) { return; } //DisplayCoordinateType = temp.DisplayCoordinateType; DisplayAmbiguousCoordsDlg = temp.DisplayAmbiguousCoordsDlg; OutputCoordinateList = temp.OutputCoordinateList; DefaultFormatList = temp.DefaultFormatList; ShowPlusForDirection = temp.ShowPlusForDirection; ShowHyphenForDirection = temp.ShowHyphenForDirection; IsHemisphereIndicatorChecked = temp.IsHemisphereIndicatorChecked; IsPlusHyphenChecked = temp.IsPlusHyphenChecked; IsHemisphereIndicatorChecked = temp.IsHemisphereIndicatorChecked; RaisePropertyChanged(() => IsPlusHyphenChecked); RaisePropertyChanged(() => IsHemisphereIndicatorChecked); RaisePropertyChanged(() => ShowPlusForDirection); RaisePropertyChanged(() => ShowHyphenForDirection); RaisePropertyChanged(() => OutputCoordinateList); RaisePropertyChanged(() => DefaultFormatList); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } }
public override void OnDisplayCoordinateTypeChanged(CoordinateConversionLibrary.Models.CoordinateConversionLibraryConfig obj) { base.OnDisplayCoordinateTypeChanged(obj); // update list box coordinates var list = CoordinateAddInPoints.ToList(); CoordinateAddInPoints.Clear(); foreach (var item in list) { CoordinateAddInPoints.Add(item); } }