- Timestamp:
- 10/16/14 15:29:16 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs
r11471 r11472 401 401 402 402 private bool IsSerializable(KeyValuePair<string, object> variable) { 403 var type = variable.Value.GetType();403 Type type = null; 404 404 bool serializable; 405 if (serializableLookup.TryGetValue(type, out serializable)) 406 return serializable; 405 406 if (variable.Value != null) { 407 type = variable.Value.GetType(); 408 if (serializableLookup.TryGetValue(type, out serializable)) 409 return serializable; 410 } 411 407 412 var ser = new Serializer(variable, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()), "ROOT", true); 408 413 try { 409 return serializableLookup[type] = ser.Count() > 0;414 serializable = ser.Count() > 0; // try to create all serialization tokens 410 415 } catch (PersistenceException) { 411 return serializableLookup[type] = false; 412 } 416 serializable = false; 417 } 418 419 if (type != null) 420 serializableLookup[type] = serializable; 421 return serializable; 413 422 } 414 423 #endregion
Note: See TracChangeset
for help on using the changeset viewer.