Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2378 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
13 changed files with 180 additions and 66 deletions
@ -0,0 +1,75 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Russell Wilkins" email=""/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
#region Using
|
||||||
|
using System; |
||||||
|
using System.Collections; |
||||||
|
using System.ComponentModel; |
||||||
|
using System.Drawing.Design; |
||||||
|
#endregion
|
||||||
|
|
||||||
|
namespace WorkflowDesigner |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of PropertyValueUIService.
|
||||||
|
/// </summary>
|
||||||
|
public class PropertyValueUIService : IPropertyValueUIService |
||||||
|
{ |
||||||
|
private PropertyValueUIHandler handler; |
||||||
|
|
||||||
|
public PropertyValueUIService() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public event EventHandler PropertyUIValueItemsChanged; |
||||||
|
|
||||||
|
public void AddPropertyValueUIHandler(PropertyValueUIHandler newHandler) |
||||||
|
{ |
||||||
|
if (newHandler == null) |
||||||
|
throw new ArgumentNullException("newHandler"); |
||||||
|
|
||||||
|
handler += newHandler; |
||||||
|
} |
||||||
|
|
||||||
|
public PropertyValueUIItem[] GetPropertyUIValueItems(ITypeDescriptorContext context, PropertyDescriptor propDesc) |
||||||
|
{ |
||||||
|
if (context == null) |
||||||
|
throw new ArgumentNullException("context"); |
||||||
|
|
||||||
|
if (propDesc == null) |
||||||
|
throw new ArgumentNullException("propDesc"); |
||||||
|
|
||||||
|
if (handler != null){ |
||||||
|
ArrayList valueUIItemList = new ArrayList(); |
||||||
|
handler(context, propDesc, valueUIItemList); |
||||||
|
|
||||||
|
if (valueUIItemList.Count > 0) { |
||||||
|
PropertyValueUIItem[] valueItems = new PropertyValueUIItem[valueUIItemList.Count]; |
||||||
|
valueUIItemList.CopyTo(valueItems, 0); |
||||||
|
return valueItems; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public void NotifyPropertyValueUIItemsChanged() |
||||||
|
{ |
||||||
|
if (PropertyUIValueItemsChanged != null) |
||||||
|
PropertyUIValueItemsChanged(this, EventArgs.Empty); |
||||||
|
} |
||||||
|
|
||||||
|
public void RemovePropertyValueUIHandler(PropertyValueUIHandler newHandler) |
||||||
|
{ |
||||||
|
if (newHandler == null) |
||||||
|
throw new ArgumentNullException("newHandler"); |
||||||
|
|
||||||
|
handler -= newHandler; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue