public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
   if (context.Instance is MpeControl)
   {
     try
     {
       MpeControl mpc = (MpeControl)context.Instance;
       IWindowsFormsEditorService editorService =
         (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
       MpeAnimationEditorForm selector = new MpeAnimationEditorForm((MpeAnimationType)value, mpc.Parser, editorService);
       editorService.DropDownControl(selector);
       return selector.SelectedValue;
     }
     catch (Exception ee)
     {
       MpeLog.Debug(ee);
       MpeLog.Error(ee);
     }
   }
   else if (context.Instance is MpeItem)
   {
     try
     {
       IWindowsFormsEditorService editorService =
         (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
       MpeAnimationEditorForm selector =
         new MpeAnimationEditorForm((MpeAnimationType)value, MediaPortalEditor.Global.Parser, editorService);
       editorService.DropDownControl(selector);
       return selector.SelectedValue;
     }
     catch (Exception ee)
     {
       MpeLog.Debug(ee);
       MpeLog.Error(ee);
     }
   }
   return base.EditValue(context, provider, value);
 }
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context.Instance is MpeControl)
     {
         try
         {
             MpeControl mpc = (MpeControl)context.Instance;
             IWindowsFormsEditorService editorService =
                 (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
             MpeAnimationEditorForm selector = new MpeAnimationEditorForm((MpeAnimationType)value, mpc.Parser, editorService);
             editorService.DropDownControl(selector);
             return(selector.SelectedValue);
         }
         catch (Exception ee)
         {
             MpeLog.Debug(ee);
             MpeLog.Error(ee);
         }
     }
     else if (context.Instance is MpeItem)
     {
         try
         {
             IWindowsFormsEditorService editorService =
                 (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
             MpeAnimationEditorForm selector =
                 new MpeAnimationEditorForm((MpeAnimationType)value, MediaPortalEditor.Global.Parser, editorService);
             editorService.DropDownControl(selector);
             return(selector.SelectedValue);
         }
         catch (Exception ee)
         {
             MpeLog.Debug(ee);
             MpeLog.Error(ee);
         }
     }
     return(base.EditValue(context, provider, value));
 }