Skip to content

Commit

Permalink
2008-04-05 Ivan N. Zlatev <contact@i-nz.net>
Browse files Browse the repository at this point in the history
	* Backport WinForms PropertyGrid bugfixes and related.


svn path=/branches/mono-1-9/mcs/; revision=99907
  • Loading branch information
ivanz committed Apr 5, 2008
1 parent 16bd116 commit dcc81a2
Show file tree
Hide file tree
Showing 38 changed files with 1,049 additions and 636 deletions.
5 changes: 5 additions & 0 deletions mcs/class/Managed.Windows.Forms/ChangeLog
@@ -1,3 +1,8 @@
2008-03-19 Ivan N. Zlatev <contact@i-nz.net>

* Makefile, System.Windows.Forms.dll.resources: Updated to reflect
the resource changes for PropertyGrid.

2008-01-26 Gert Driesen <drieseng@users.sourceforge.net>

* System.Windows.Forms.dll.sources: Moved PropertiesTab.cs from
Expand Down
7 changes: 6 additions & 1 deletion mcs/class/Managed.Windows.Forms/Makefile
Expand Up @@ -80,7 +80,12 @@ IMAGES_RESOURCES = \
resources/nav_next.png \
resources/nav_plus.png \
resources/image-missing.png \
resources/image-x-generic.png
resources/image-x-generic.png \
resources/propertygrid-alphabetical.png \
resources/propertygrid-categorized.png \
resources/EventsTab.bmp \
resources/PropertiesTab.bmp \
resources/propertygrid-propertypages.png


TEST_DISTFILES = \
Expand Down
@@ -1,3 +1,11 @@
2008-03-20 Ivan N. Zlatev <contact@i-nz.net>

* EventsTab.cs: Complete implementation.

2008-03-05 Jonathan Pobst <monkey@jpobst.com>

EventsTab.cs: corcompare - fix parameter names.

2007-08-30 Jonathan Pobst <monkey@jpobst.com>

* ComponentEditorPage.cs, ComponentEditorForm.cs: Override AutoSize,
Expand Down
Expand Up @@ -17,14 +17,15 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2004 Novell, Inc.
// Copyright (c) 2004-2008 Novell, Inc.
//
// Authors:
// Dennis Hayes (dennish@raytek.com)
// Rafael Teixeira (rafaelteixeirabr@hotmail.com)
// Rafael Teixeira (rafaelteixeirabr@hotmail.com)
// Ivan N. Zlatev (contact@i-nz.net)
//

// NOT COMPLETE
// COMPLETE

using System;
using System.ComponentModel;
Expand All @@ -34,47 +35,33 @@ namespace System.Windows.Forms.Design
{
public class EventsTab : PropertyTab
{
[MonoTODO]
private EventsTab()
{
}

private IServiceProvider serviceProvider;

[MonoTODO]
public EventsTab(IServiceProvider serviceProvider)
public EventsTab(IServiceProvider sp)
{
this.serviceProvider = serviceProvider;
this.serviceProvider = sp;
}

[MonoTODO("What value should we return?")]
public override string HelpKeyword
{
get {
return TabName;
}
public override string HelpKeyword {
get { return TabName; }
}

[MonoTODO("Localization")]
public override string TabName
{
get {
return "Events";
}
public override string TabName {
get { return Locale.GetText ("Events"); }
}

[MonoTODO("Test")]
public override PropertyDescriptorCollection GetProperties(
ITypeDescriptorContext context,
object component,
Attribute[] attributes)
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object component,
Attribute[] attributes)
{
IEventBindingService eventPropertySvc = null;
EventDescriptorCollection events;
EventDescriptorCollection events = null;

if (serviceProvider != null)
eventPropertySvc = (IEventBindingService)
serviceProvider.GetService(typeof(IEventBindingService));
eventPropertySvc = (IEventBindingService) serviceProvider.GetService(typeof(IEventBindingService));

if (eventPropertySvc == null)
return new PropertyDescriptorCollection(null);
Expand All @@ -93,28 +80,20 @@ public override PropertyDescriptorCollection GetProperties(object component, Att
return this.GetProperties(null, component, attributes);
}

[MonoTODO]
public override bool CanExtend(object component)
public override bool CanExtend(object extendee)
{
return false;
}

[MonoTODO("Test")]
public override PropertyDescriptor GetDefaultProperty(object component)
public override PropertyDescriptor GetDefaultProperty(object obj)
{
object[] attributes = component.GetType().GetCustomAttributes(typeof(DefaultEventAttribute), true);
if (attributes.Length > 0) {
DefaultEventAttribute defaultEvent = attributes[0] as DefaultEventAttribute;
if (defaultEvent != null && serviceProvider != null) {
IEventBindingService eventPropertySvc = (IEventBindingService)
serviceProvider.GetService(typeof(IEventBindingService));

if (eventPropertySvc == null)
foreach (EventDescriptor ed in TypeDescriptor.GetEvents(component))
if (ed.Name == defaultEvent.Name)
return eventPropertySvc.GetEventProperty(ed);
}
}
if (serviceProvider == null)
return null;

EventDescriptor defaultEvent = TypeDescriptor.GetDefaultEvent (obj);
IEventBindingService eventPropertySvc = (IEventBindingService) serviceProvider.GetService(typeof(IEventBindingService));
if (defaultEvent != null && eventPropertySvc != null)
return eventPropertySvc.GetEventProperty (defaultEvent);
return null;
}

Expand Down
@@ -1,3 +1,7 @@
2008-03-19 Ivan N. Zlatev <contact@i-nz.net>

* PropertiesTab.cs: Implement.

2008-01-26 Gert Driesen <drieseng@users.sourceforge.net>

* PropertiesTab.cs: Moved from System.Windows.Forms.
Expand Up @@ -17,10 +17,11 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2005 Novell, Inc.
// Copyright (c) 2005-2008 Novell, Inc.
//
// Authors:
// Jonathan Chambers jonathan.chambers@ansys.com
// Ivan N. Zlatev contact@i-nz.net
//

using System;
Expand All @@ -31,34 +32,43 @@ namespace System.Windows.Forms.PropertyGridInternal
{
public class PropertiesTab : PropertyTab
{
public PropertiesTab() {
public PropertiesTab ()
{
}

public override PropertyDescriptorCollection GetProperties (object component, Attribute[] attributes)
{
return base.GetProperties(null, component, attributes);
return GetProperties (null, component, attributes);
}

public override PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object component, Attribute[] attributes)
{
return base.GetProperties (context, component, attributes);
if (component == null)
return new PropertyDescriptorCollection (null);

PropertyDescriptorCollection properties = null;
TypeConverter converter = TypeDescriptor.GetConverter (component);
if (converter != null && converter.GetPropertiesSupported ())
properties = converter.GetProperties (context, component, attributes);
if (properties == null) // try 3: TypeDescriptor
properties = TypeDescriptor.GetProperties (component, attributes);
return properties;
}

public override PropertyDescriptor GetDefaultProperty (object obj)
public override PropertyDescriptor GetDefaultProperty (object component)
{
return base.GetDefaultProperty (obj);
if (component == null)
return null;

return TypeDescriptor.GetDefaultProperty (component);
}

public override string HelpKeyword {
get {
return "vs.properties";
}
get { return "vs.properties"; }
}

public override string TabName {
get {
return "Properties";
}
get { return "Properties"; }
}
}
}
Expand Up @@ -55,3 +55,8 @@
-resource:resources/nav_previous.png
-resource:resources/image-missing.png
-resource:resources/image-x-generic.png
-resource:resources/propertygrid-alphabetical.png,System.Windows.Forms.propertygrid-alphabetical.png
-resource:resources/propertygrid-categorized.png,System.Windows.Forms.propertygrid-categorized.png
-resource:resources/propertygrid-propertypages.png,System.Windows.Forms.propertygrid-propertypages.png
-resource:resources/EventsTab.bmp,System.Windows.Forms.Design.EventsTab.bmp
-resource:resources/PropertiesTab.bmp,System.Windows.Forms.PropertyGridInternal.PropertiesTab.bmp
@@ -1,3 +1,7 @@
2008-04-05 Ivan N. Zlatev <contact@i-nz.net>

* Backport PropertyGrid bugfixes.

2008-02-22 Jonathan Pobst <monkey@jpobst.com>
[Backport to 1.9]
* TreeView.cs: Make selected_node and highlighted_node internal.
Expand Down

0 comments on commit dcc81a2

Please sign in to comment.