Exemplo n.º 1
0
        void newFuncButton_Click(object sender, EventArgs e)
        {
            navigationLabel.Text = "  " + ((RadioButton)sender).Text;
            // 顯示對應的畫面
            foreach (Object unit in subNavigationFuncArrayList)
            {
                ((FunctionTemplate)unit).Control.Visible = ((FunctionTemplate)unit).FuncName[Thread.CurrentThread.CurrentUICulture] == ((RadioButton)sender).Text ? true : false;
                if (((FunctionTemplate)unit).Control.Visible)
                {
                    nowFunction = (FunctionTemplate)unit;
                    ((FunctionTemplate)unit).Control.Focus();
                }
            }

            foreach (Panel tmpContentPanel in ParentArrayList.Values)
            {
                if (tmpContentPanel.Controls.Contains((RadioButton)sender) != true)
                {
                    foreach (RadioButton tmpFuncButton in tmpContentPanel.Controls)
                    {
                        tmpFuncButton.Checked = false;
                    }
                }
            }
        }
Exemplo n.º 2
0
 public bool AddFunction(FunctionTemplate func)
 {
     // 檢查功能名稱是否重複
     foreach (Object unit in subNavigationFuncArrayList)
     {
         if (((FunctionTemplate)unit).FuncType[Thread.CurrentThread.CurrentUICulture].Equals(func.FuncType[Thread.CurrentThread.CurrentUICulture]) == true && ((FunctionTemplate)unit).FuncName[Thread.CurrentThread.CurrentUICulture].Equals(func.FuncName[Thread.CurrentThread.CurrentUICulture]) == true)
         {
             MessageBox.Show("[Duplicated Function Type] " + func.FuncType[Thread.CurrentThread.CurrentUICulture] + "!!\n" + "[Duplicated Function Name] " + func.FuncName[Thread.CurrentThread.CurrentUICulture] + "!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return false;
         }
     }
     subNavigationFuncArrayList.Push(func);
     return true;
 }