提交 64d893d0 编写于 作者: H Heejae Chang

make roaming visual studio profile option persister handle bool? data type

上级 db95b5a2
...@@ -174,6 +174,11 @@ public bool TryFetch(OptionKey optionKey, out object value) ...@@ -174,6 +174,11 @@ public bool TryFetch(OptionKey optionKey, out object value)
value = longValue != 0; value = longValue != 0;
return true; return true;
} }
else if (optionKey.Option.Type == typeof(bool?))
{
// when nullable type is assigned to object, it can lose nullable type.
return (value is bool) || (value == null);
}
else if (value != null && optionKey.Option.Type != value.GetType()) else if (value != null && optionKey.Option.Type != value.GetType())
{ {
// We got something back different than we expected, so fail to deserialize // We got something back different than we expected, so fail to deserialize
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册