public void LoadConfigFromXml(string path) { if (!File.Exists(path)) { if (path == null) { path = "Config/DrawingConfig.xml"; } path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, path); if (!File.Exists(path)) { return; } } try { using (var fs = new FileStream(path, FileMode.Open)) { var xmldes = new XmlSerializer(typeof(DrawingConfig)); var config = (DrawingConfig)xmldes.Deserialize(fs); _drawingPickerInfo = config._drawingPickerInfo; } } catch (Exception ex) { Trace.WriteLine(ex.ToString()); } }
public DrawingConfig() { DrawingPickerInfo = new DrawingPickerInfo(); }