public void LoadConfiguration(string configData) { Configuration = EditorConfiguration.FromString(configData); _backupConfiguration = Configuration != null?Configuration.Clone() : null; if (_panel != null) { Configuration.ToolPanel = _panel; } }
public static EditorConfiguration FromString(string str) { EditorConfiguration conf = new EditorConfiguration(); if (string.IsNullOrWhiteSpace(str)) { return(conf); } else { EditorConfiguration temp = DataContractSerializationHelper.Deserialize <EditorConfiguration>(str); if (temp != null) { conf.AlwaysDisplayDefaultTemplates = temp.AlwaysDisplayDefaultTemplates; conf.AutoComplete = temp.AutoComplete; conf.AutoSave = temp.AutoSave; conf.AutoSelect = temp.AutoSelect; conf.Continuous = temp.Continuous; conf.UseDefaultLayerIds = temp.LayerIds == null; conf.LayerIds = temp.LayerIds; conf.MaintainAspectRatio = temp.MaintainAspectRatio; conf.ShowAttributesOnAdd = temp.ShowAttributesOnAdd; conf.SelectTool = temp.SelectTool; conf.AddToSelectionTool = temp.AddToSelectionTool; conf.RemoveFromSelectionTool = temp.RemoveFromSelectionTool; conf.ClearSelectionTool = temp.ClearSelectionTool; conf.DeleteTool = temp.DeleteTool; conf.EditValuesTool = temp.EditValuesTool; conf.EditShapesTool = temp.EditShapesTool; conf.ReshapeTool = temp.ReshapeTool; conf.UnionTool = temp.UnionTool; conf.CutTool = temp.CutTool; conf.FreehandTool = temp.FreehandTool; conf.AutocompleteTool = temp.AutocompleteTool; conf.ClearTool = temp.ClearTool; conf.EditingShapesEnabled = temp.EditingShapesEnabled; } return(conf); } }
public EditorConfiguration Clone() { return(EditorConfiguration.FromString(this.ToString())); }
public void OnCompleted() { _backupConfiguration = Configuration != null ? Configuration.Clone() : null; }
public void LoadConfiguration(string configData) { Configuration = EditorConfiguration.FromString(configData); _backupConfiguration = Configuration != null ? Configuration.Clone() : null; if (_panel != null) Configuration.ToolPanel = _panel; }
public static EditorConfiguration FromString(string str) { EditorConfiguration conf = new EditorConfiguration(); if (string.IsNullOrWhiteSpace(str)) return conf; else { EditorConfiguration temp = DataContractSerializationHelper.Deserialize<EditorConfiguration>(str); if (temp != null) { conf.AlwaysDisplayDefaultTemplates = temp.AlwaysDisplayDefaultTemplates; conf.AutoComplete = temp.AutoComplete; conf.AutoSave = temp.AutoSave; conf.AutoSelect = temp.AutoSelect; conf.Continuous = temp.Continuous; conf.UseDefaultLayerIds = temp.LayerIds == null; conf.LayerIds = temp.LayerIds; conf.MaintainAspectRatio = temp.MaintainAspectRatio; conf.ShowAttributesOnAdd = temp.ShowAttributesOnAdd; conf.SelectTool = temp.SelectTool; conf.AddToSelectionTool = temp.AddToSelectionTool; conf.RemoveFromSelectionTool = temp.RemoveFromSelectionTool; conf.ClearSelectionTool = temp.ClearSelectionTool; conf.DeleteTool = temp.DeleteTool; conf.EditValuesTool = temp.EditValuesTool; conf.EditShapesTool = temp.EditShapesTool; conf.ReshapeTool = temp.ReshapeTool; conf.UnionTool = temp.UnionTool; conf.CutTool = temp.CutTool; conf.FreehandTool = temp.FreehandTool; conf.AutocompleteTool = temp.AutocompleteTool; conf.ClearTool = temp.ClearTool; conf.EditingShapesEnabled = temp.EditingShapesEnabled; } return conf; } }
public void OnCompleted() { _backupConfiguration = Configuration != null?Configuration.Clone() : null; }