Esempio n. 1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            // Uses the IWindowsFormsEditorService to display a
            // drop-down UI in the Properties window.
            IWindowsFormsEditorService edSvc =
                (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            ListBoxDefaultCameraControl dccontrol = new ListBoxDefaultCameraControl();

            Camera[] cameras = new Camera[UnifiedScenesRepository.CurrentEditingScene.Cameras.Count];
            UnifiedScenesRepository.CurrentEditingScene.Cameras.CopyTo(cameras, 0);
            //ListBox.ObjectCollection oc = new ListBox.ObjectCollection(list, cameras);
            //list.Items.AddRange(oc);
            dccontrol.ListBoxCameras.Items.AddRange(cameras);
            if (edSvc != null)
            {
                // Display an angle selection control and retrieve the value.
                //edSvc.DropDownControl(list);
                edSvc.DropDownControl(dccontrol);
                if (dccontrol.ListBoxCameras.SelectedItem != null)
                {
                    return(dccontrol.ListBoxCameras.SelectedItem);
                }
            }
            return(value);
        }
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     // Uses the IWindowsFormsEditorService to display a
     // drop-down UI in the Properties window.
     IWindowsFormsEditorService edSvc =
         (IWindowsFormsEditorService) provider.GetService(typeof (IWindowsFormsEditorService));
     ListBoxDefaultCameraControl dccontrol = new ListBoxDefaultCameraControl();
     Camera[] cameras = new Camera[UnifiedScenesRepository.CurrentEditingScene.Cameras.Count];
     UnifiedScenesRepository.CurrentEditingScene.Cameras.CopyTo(cameras, 0);
     //ListBox.ObjectCollection oc = new ListBox.ObjectCollection(list, cameras);
     //list.Items.AddRange(oc);
     dccontrol.ListBoxCameras.Items.AddRange(cameras);
     if (edSvc != null) {
         // Display an angle selection control and retrieve the value.
         //edSvc.DropDownControl(list);
         edSvc.DropDownControl(dccontrol);
         if (dccontrol.ListBoxCameras.SelectedItem != null) {
             return dccontrol.ListBoxCameras.SelectedItem;
         }
     }
     return value;
 }