Browse Source

added additional null checking - possible fix for ExceptionGroupId 126

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5920 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Siegfried Pammer 15 years ago
parent
commit
c9e82672d8
  1. 10
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs

10
src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs

@ -263,12 +263,15 @@ namespace ICSharpCode.XamlBinding @@ -263,12 +263,15 @@ namespace ICSharpCode.XamlBinding
return emptyList;
if (lastElement.LocalName.EndsWith(".", StringComparison.OrdinalIgnoreCase) || context.PressedKey == '.') {
if (rt == null)
return list;
string key = string.IsNullOrEmpty(lastElement.Prefix) ? "" : lastElement.Prefix + ":";
if (context.ParentElement.LocalName.StartsWith(lastElement.LocalName.TrimEnd('.'), StringComparison.OrdinalIgnoreCase)) {
AddAttributes(rt, list, includeEvents);
AddAttachedProperties(rt.GetUnderlyingClass(), list, key, lastElement.Name.Trim('.'));
} else if (rt != null && rt.GetUnderlyingClass() != null)
} else
AddAttachedProperties(rt.GetUnderlyingClass(), list, key, lastElement.Name.Trim('.'));
} else {
if (rt == null) {
@ -1283,6 +1286,9 @@ namespace ICSharpCode.XamlBinding @@ -1283,6 +1286,9 @@ namespace ICSharpCode.XamlBinding
public static void AddAttachedProperties(IClass c, List<ICompletionItem> result, string key, string prefix)
{
if (c == null)
return;
var attachedProperties = c.Fields.Where(f => f.IsAttached(true, false));
int prefixLength = (prefix.Length > 0) ? prefix.Length + 1 : 0;

Loading…
Cancel
Save