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;


  
  
 }
}

posted @ 2005-06-08 11:49  Think  阅读(1197)  评论(0编辑  收藏  举报