Ejemplo n.º 1
0
        public void AdjustRecipe2View()
        {
            if (InvokeRequired)
            {
                Invoke(new Action(AdjustRecipe2View));
                return;
            }



            _lstItems.Clear();
            _lstDeleteItemButtons.Clear();
            tableLayoutPanel1.Controls.Clear();
            EditRecipe = false;
            if (null == _recipe)
            {
                lbTips.Text = "Recipe未设置";
                return;
            }

            lbTips.Text = "Categoty:" + _recipe.Categoty + " ID:" + _recipe.ID;
            string[] itemNames = _recipe.AllItemNames();
            if (null == itemNames || 0 == itemNames.Length)
            {
                return;
            }
            foreach (string itemName in itemNames)
            {
                UcJFParamEdit pe = new UcJFParamEdit();
                //pe.SetParamType(_recipe.GetItemValue(itemName).GetType());
                pe.SetParamDesribe(JFParamDescribe.Create(itemName, _recipe.GetItemValue(itemName).GetType(), JFValueLimit.NonLimit, null));
                pe.SetParamValue(_recipe.GetItemValue(itemName));
                pe.IsValueReadOnly = true;
                pe.Height          = 23;
                pe.Width           = 500;
                pe.IsHelpVisible   = false;
                tableLayoutPanel1.Controls.Add(pe);
                Button btDel = new Button();
                btDel.Text   = "删除";
                btDel.Tag    = itemName;
                btDel.Click += OnDelButtonClick;
                _lstItems.Add(pe);
                _lstDeleteItemButtons.Add(btDel);
                tableLayoutPanel1.Controls.Add(btDel);
            }
            EditRecipe = false;
        }