public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context != null && context.Instance != null && provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider?.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { if (dropdownControl == null) //load on demand and reuse it. { //We want to use the same font as the properties control... // edSvc container has a Font and property we need but it is of type System.Windows.Forms.PropertyGridInternal.PropertyGridView and not accessable without reflection. Arrgh! var fontPI = edSvc.GetType().GetProperty("Font", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); var font = fontPI == null ? SystemFonts.MessageBoxFont : (Font)fontPI.GetValue(edSvc); dropdownControl = new EnumPanel(font); } dropdownControl.EnumValue = (Enum)Convert.ChangeType(value, context.PropertyDescriptor.PropertyType); edSvc.DropDownControl(dropdownControl); return(dropdownControl.EnumValue); } } return(null); }
public void EnablePanel(EnumPanel panelType) { foreach (EnumPanel panel in Panels) { SetActive(panel.gameObject, (panel.myActivePanel == panelType.myActivePanel) ? true : false); } }
private void showPanelProduct() { saveMenuBar(); loadProMenuBar(); eCurrentPanel = EnumPanel.Product; //frmSell.Visible = false; panelCustomer.Visible = false; panelProduct.Visible = true; }
//show panels private void showPanelSell() { saveMenuBar(); loadSellMenuBar(); eCurrentPanel = EnumPanel.Sell; frmSell.Visible = true; panelCustomer.Visible = false; panelProduct.Visible = false; }
void Start() { playerInstructionPanel = GameObject.Find("InstructionPanel").GetComponent <InstructionPanel> (); numberPanel = GameObject.Find("EnumPanel").GetComponent <EnumPanel> (); codingCanvas = GameObject.Find("CodingCanvas").GetComponent <Canvas>(); }