|
|
@ -177,6 +177,17 @@ namespace ICSharpCode.PythonBinding |
|
|
|
return names.ToArray(); |
|
|
|
return names.ToArray(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets the object that the field expression variable refers to.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public object GetObject(IComponentCreator componentCreator) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (variableName.Length > 0) { |
|
|
|
|
|
|
|
return componentCreator.GetComponent(variableName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return componentCreator.RootComponent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Returns the object that the property is defined on. This method may just return the object
|
|
|
|
/// Returns the object that the property is defined on. This method may just return the object
|
|
|
|
/// passed to it if the property is defined on that object.
|
|
|
|
/// passed to it if the property is defined on that object.
|
|
|
@ -192,6 +203,9 @@ namespace ICSharpCode.PythonBinding |
|
|
|
object currentComponent = component; |
|
|
|
object currentComponent = component; |
|
|
|
for (int i = startIndex; i < members.Length - 1; ++i) { |
|
|
|
for (int i = startIndex; i < members.Length - 1; ++i) { |
|
|
|
PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(currentComponent).Find(members[i], true); |
|
|
|
PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(currentComponent).Find(members[i], true); |
|
|
|
|
|
|
|
if (propertyDescriptor == null) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
currentComponent = propertyDescriptor.GetValue(currentComponent); |
|
|
|
currentComponent = propertyDescriptor.GetValue(currentComponent); |
|
|
|
} |
|
|
|
} |
|
|
|
return currentComponent; |
|
|
|
return currentComponent; |
|
|
|