|
|
|
@ -482,7 +482,10 @@ namespace ICSharpCode.PythonBinding |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (propertyDescriptor.SerializationVisibility == DesignerSerializationVisibility.Visible) { |
|
|
|
ExtenderProvidedPropertyAttribute extender = GetExtenderAttribute(propertyDescriptor); |
|
|
|
|
|
|
|
if (extender != null) { |
|
|
|
|
|
|
|
AppendExtenderProperty(codeBuilder, propertyOwnerName, extender, propertyDescriptor, propertyValue); |
|
|
|
|
|
|
|
} else if (propertyDescriptor.SerializationVisibility == DesignerSerializationVisibility.Visible) { |
|
|
|
string propertyName = propertyOwnerName + "." + propertyDescriptor.Name; |
|
|
|
string propertyName = propertyOwnerName + "." + propertyDescriptor.Name; |
|
|
|
Control control = propertyValue as Control; |
|
|
|
Control control = propertyValue as Control; |
|
|
|
if (control != null) { |
|
|
|
if (control != null) { |
|
|
|
@ -495,6 +498,22 @@ namespace ICSharpCode.PythonBinding |
|
|
|
AppendMethodCallWithArrayParameter(codeBuilder, propertyOwnerName, obj, propertyDescriptor); |
|
|
|
AppendMethodCallWithArrayParameter(codeBuilder, propertyOwnerName, obj, propertyDescriptor); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Appends an extender provider property.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public void AppendExtenderProperty(PythonCodeBuilder codeBuilder, string propertyOwnerName, ExtenderProvidedPropertyAttribute extender, PropertyDescriptor propertyDescriptor, object propertyValue) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IComponent component = extender.Provider as IComponent; |
|
|
|
|
|
|
|
codeBuilder.AppendIndented("self._" + component.Site.Name); |
|
|
|
|
|
|
|
codeBuilder.Append(".Set" + propertyDescriptor.Name); |
|
|
|
|
|
|
|
codeBuilder.Append("("); |
|
|
|
|
|
|
|
codeBuilder.Append(propertyOwnerName); |
|
|
|
|
|
|
|
codeBuilder.Append(", "); |
|
|
|
|
|
|
|
codeBuilder.Append(PythonPropertyValueAssignment.ToString(propertyValue)); |
|
|
|
|
|
|
|
codeBuilder.Append(")"); |
|
|
|
|
|
|
|
codeBuilder.AppendLine(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Appends the properties of the object to the code builder.
|
|
|
|
/// Appends the properties of the object to the code builder.
|
|
|
|
@ -694,5 +713,16 @@ namespace ICSharpCode.PythonBinding |
|
|
|
} |
|
|
|
} |
|
|
|
return "self._" + control.Name; |
|
|
|
return "self._" + control.Name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static ExtenderProvidedPropertyAttribute GetExtenderAttribute(PropertyDescriptor property) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
foreach (Attribute attribute in property.Attributes) { |
|
|
|
|
|
|
|
ExtenderProvidedPropertyAttribute extenderAttribute = attribute as ExtenderProvidedPropertyAttribute; |
|
|
|
|
|
|
|
if (extenderAttribute != null) { |
|
|
|
|
|
|
|
return extenderAttribute; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|