}
return resource;
}
- if (propertyType.IsAssignableFrom(resource.GetType()))
+ if (propertyType.IsAssignableFrom(resource?.GetType()))
return resource;
var implicit_op = resource.GetType().GetImplicitConversionOperator(fromType: resource.GetType(), toType: propertyType)
?? propertyType.GetImplicitConversionOperator(fromType: resource.GetType(), toType: propertyType);
if (node != null)
{
IXamlTypeResolver = new XamlTypeResolver(node.NamespaceResolver, XamlParser.GetElementType,
- context.RootElement.GetType().GetTypeInfo().Assembly);
+ context?.RootElement.GetType().GetTypeInfo().Assembly);
var enode = node;
while (enode != null && !(enode is IElementNode))
if (_expression == null && bindingContext != null)
_expression = new BindingExpression(this, SelfPath);
- _expression.Apply(bindingContext, bindObj, targetProperty);
+ _expression?.Apply(bindingContext, bindObj, targetProperty);
}
internal override BindingBase Clone()
case '^': //not in CSS spec
reader.Read();
var element = reader.ReadIdent();
- if (element == null)
- return Invalid;
+ if (element == null) return Invalid;
setCurrentSelector(new And(), new Base(element));
break;
case ' ':
_snapshot = snap = new ReadOnlyCollection<T>(_list.ToList());
}
- return snap.GetEnumerator();
+ return snap?.GetEnumerator();
}
public int IndexOf(T item)
}
if (value is string)
{
- KeyString = (string)value;
+ KeyString = value.ToString();
}