public static AttachmentEditorConfiguration FromString(string str) { if (!string.IsNullOrWhiteSpace(str)) { return(DataContractSerializationHelper.Deserialize <AttachmentEditorConfiguration>(str)); } return(null); }
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); } }