diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerComponent.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerComponent.cs
index 638c17980c..cbc77ab830 100644
--- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerComponent.cs
+++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerComponent.cs
@@ -482,7 +482,10 @@ namespace ICSharpCode.PythonBinding
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;
Control control = propertyValue as Control;
if (control != null) {
@@ -495,6 +498,22 @@ namespace ICSharpCode.PythonBinding
AppendMethodCallWithArrayParameter(codeBuilder, propertyOwnerName, obj, propertyDescriptor);
}
}
+
+ ///
+ /// Appends an extender provider property.
+ ///
+ 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();
+ }
///
/// Appends the properties of the object to the code builder.
@@ -694,5 +713,16 @@ namespace ICSharpCode.PythonBinding
}
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;
+ }
}
}
diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GenerateToolTipFormTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GenerateToolTipFormTestFixture.cs
index 2764fcb080..3bd9746b69 100644
--- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GenerateToolTipFormTestFixture.cs
+++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GenerateToolTipFormTestFixture.cs
@@ -35,6 +35,7 @@ namespace PythonBinding.Tests.Designer
descriptor.SetValue(form, "MainForm");
ToolTip toolTip = (ToolTip)host.CreateComponent(typeof(ToolTip), "toolTip1");
+ toolTip.SetToolTip(form, "test");
string indentString = " ";
PythonControl pythonForm = new PythonControl(indentString);
@@ -54,6 +55,7 @@ namespace PythonBinding.Tests.Designer
" # \r\n" +
" self.ClientSize = System.Drawing.Size(284, 264)\r\n" +
" self.Name = \"MainForm\"\r\n" +
+ " self._toolTip1.SetToolTip(self, \"test\")\r\n" +
" self.ResumeLayout(False)\r\n" +
" self.PerformLayout()\r\n";