Skip to content

Commit

Permalink
Expanded criteria for what constitutes an attached property.
Browse files Browse the repository at this point in the history
Related to #426
  • Loading branch information
joelmartinez committed May 28, 2019
1 parent 02321c0 commit 51519a0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mdoc/Mono.Documentation/Util/AttachedEntitiesHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,21 @@ private static bool IsAttachedProperty(FieldDefinition field, Dictionary<string,

private static bool IsAttachedPropertyGetMethod(MethodDefinition method)
{
return method.Parameters.Count == 1

// returns a value of type dp.PropertyType (or IsAssignableTo…), where dp is the value of the static field.
// && IsAssignableTo(method.ReturnType, "");

// The Get method takes one argument of type DependencyObject(or something IsAssignableTo(DependencyObject),
&& (IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullName) || IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameXaml));
return method.Parameters.Count == 1

// returns a value of type dp.PropertyType (or IsAssignableTo…), where dp is the value of the static field.
// && IsAssignableTo(method.ReturnType, "");

// The Get method takes one argument of type DependencyObject(or something IsAssignableTo(DependencyObject),
;//&& (IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullName) || IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameXaml));
}

private static bool IsAttachedPropertySetMethod(MethodDefinition method)
{
return method.Parameters.Count == 2// The Set method takes two arguments.

// The first has type DependencyObject(or IsAssignableTo…),
&& (IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullName) || IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameXaml))
//s&& (IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullName) || IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameXaml))

// the second has type dp.PropertyType (or IsAssignableTo…).
// && IsAssignableTo(method.Parameters[1].ParameterType, "")
Expand Down

0 comments on commit 51519a0

Please sign in to comment.