propertyvalueuiservice.cs
来自「SharpDevelop2.0.0 c#开发免费工具」· CS 代码 · 共 64 行
CS
64 行
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision: 915 $</version>
// </file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version value="$version"/>
// </file>
using System;
using System.ComponentModel;
using System.Drawing.Design;
using System.Collections;
namespace ICSharpCode.FormsDesigner.Services
{
public class PropertyValueUIService : IPropertyValueUIService
{
PropertyValueUIHandler propertyValueUIHandler;
public void AddPropertyValueUIHandler(PropertyValueUIHandler newHandler)
{
propertyValueUIHandler += newHandler;
}
public PropertyValueUIItem[] GetPropertyUIValueItems(ITypeDescriptorContext context, PropertyDescriptor propDesc)
{
// Let registered handlers have a chance to add their UIItems
ArrayList propUIValues = new ArrayList();
if (propertyValueUIHandler != null) {
propertyValueUIHandler(context,propDesc,propUIValues);
}
PropertyValueUIItem[] values = new PropertyValueUIItem[propUIValues.Count];
if (propUIValues.Count > 0) {
propUIValues.CopyTo(values);
}
return values;
}
public void NotifyPropertyValueUIItemsChanged()
{
OnPropertyUIValueItemsChanged(EventArgs.Empty);
}
public void RemovePropertyValueUIHandler(PropertyValueUIHandler newHandler)
{
propertyValueUIHandler -= newHandler;
}
protected virtual void OnPropertyUIValueItemsChanged(EventArgs e)
{
if (PropertyUIValueItemsChanged != null) {
PropertyUIValueItemsChanged(this, e);
}
}
public event EventHandler PropertyUIValueItemsChanged;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?