Пример #1
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context != null && context.Instance != null && provider != null)
     {
         IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
         if (service != null)
         {
             LimnorWinApp mc = context.Instance as LimnorWinApp;
             if (mc == null)
             {
                 ClassPointer cp = context.Instance as ClassPointer;
                 if (cp != null)
                 {
                     mc = cp.ObjectInstance as LimnorWinApp;
                 }
             }
             if (mc != null)
             {
                 if (mc.Project != null)
                 {
                     ClassTypeList ctl = new ClassTypeList(service, mc.Project, mc.StartForm);
                     service.DropDownControl(ctl);
                     if (ctl.SelectedObj != null)
                     {
                         PropertyDescriptorCollection ps = TypeDescriptor.GetProperties(mc);
                         foreach (PropertyDescriptor p in ps)
                         {
                             if (string.CompareOrdinal(p.Name, "StartClassId") == 0)
                             {
                                 p.SetValue(mc, ctl.SelectedObj.ComponentId);
                                 break;
                             }
                         }
                     }
                 }
             }
         }
     }
     return(value);
 }
Пример #2
0
        public override void Run()
        {
            LimnorWinApp app = RootObject as LimnorWinApp;

            app.Run();
        }