Example #1
0
        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);
        }
Example #2
0
 public void EnablePanel(EnumPanel panelType)
 {
     foreach (EnumPanel panel in Panels)
     {
         SetActive(panel.gameObject, (panel.myActivePanel == panelType.myActivePanel) ? true : false);
     }
 }
Example #3
0
        private void showPanelProduct()
        {
            saveMenuBar();
            loadProMenuBar();
            eCurrentPanel = EnumPanel.Product;

            //frmSell.Visible = false;
            panelCustomer.Visible = false;
            panelProduct.Visible  = true;
        }
Example #4
0
        //show panels
        private void showPanelSell()
        {
            saveMenuBar();
            loadSellMenuBar();
            eCurrentPanel = EnumPanel.Sell;

            frmSell.Visible       = true;
            panelCustomer.Visible = false;
            panelProduct.Visible  = false;
        }
Example #5
0
 void Start()
 {
     playerInstructionPanel = GameObject.Find("InstructionPanel").GetComponent <InstructionPanel> ();
     numberPanel            = GameObject.Find("EnumPanel").GetComponent <EnumPanel> ();
     codingCanvas           = GameObject.Find("CodingCanvas").GetComponent <Canvas>();
 }
Example #6
0
        //show panels
        private void showPanelSell()
        {
            saveMenuBar();
            loadSellMenuBar();
            eCurrentPanel = EnumPanel.Sell;

            frmSell.Visible = true;
            panelCustomer.Visible = false;
            panelProduct.Visible = false;
        }
Example #7
0
        private void showPanelProduct()
        {
            saveMenuBar();
            loadProMenuBar();
            eCurrentPanel = EnumPanel.Product;

            //frmSell.Visible = false;
            panelCustomer.Visible = false;
            panelProduct.Visible = true;
        }