From 29e849b39f09b51836300879c127a68eb55d96da Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 17 Sep 2009 19:18:13 +0000 Subject: [PATCH] Fixed forum-9975: Python Designer generates incorrect code for TextBox.PasswordChar property git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4953 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/PythonPropertyValueAssignment.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs index fd4e4522a1..c09f666174 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs @@ -32,9 +32,10 @@ namespace ICSharpCode.PythonBinding /// /// /// 1) Strings are returned surrounded by double quotes. - /// 2) Objects are returned with their full name (e.g. System.Windows.Forms.Size(100, 200)). - /// 3) Enums are returned with their full name (e.g. System.Windows.Forms.AccessibleRole.None). - /// 4) By default the ToString method is used on the property value. + /// 2) Characters are returned as System.Convert.ToChar("character") + /// 3) Objects are returned with their full name (e.g. System.Windows.Forms.Size(100, 200)). + /// 4) Enums are returned with their full name (e.g. System.Windows.Forms.AccessibleRole.None). + /// 5) By default the ToString method is used on the property value. /// public static string ToString(object propertyValue) { @@ -45,6 +46,8 @@ namespace ICSharpCode.PythonBinding Type propertyType = propertyValue.GetType(); if (propertyType == typeof(String)) { return GetQuotedString((string)propertyValue); + } else if (propertyType == typeof(Char)) { + return "System.Convert.ToChar(" + GetQuotedString(propertyValue.ToString()) + ")"; } else if (propertyType == typeof(AnchorStyles)) { AnchorStyles anchor = (AnchorStyles)propertyValue; return GetAnchorStyleAsString(anchor);