DateChooser源码--RevealTransitionEditor.cs
using System;
using System.ComponentModel;
using System.Design;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace CNBlogs.DCT.THIN.Design
{
/// <summary>
/// RevealTransitionEditor 的摘要说明。
/// </summary>
public class RevealTransitionEditor:UITypeEditor
{
public RevealTransitionEditor()
{
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
if (provider != null)
{
IWindowsFormsEditorService service1 = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService));
if (service1 == null)
{
return value;
}
if (this.tranUI == null)
{
this.tranUI = new RevealTransitionUI();
}
this.tranUI.Start(service1, value);
service1.DropDownControl(this.tranUI);
value = this.tranUI.Value;
this.tranUI.End();
}
return value;
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
// Fields
private RevealTransitionUI tranUI;
}
}