private void btnRecipeAdd_Click(object sender, EventArgs e) { IsRecipeNew = true; RecipeNewNameWindow _RcpNewNameWnd = new RecipeNewNameWindow(ProjectType); _RcpNewNameWnd.RecipeCopyEvent += new RecipeNewNameWindow.RecipeCopyHandler(RecipeCopyEventFunction); string[] _RecipeList = new string[listBoxRecipe.Items.Count]; for (int iLoopCount = 0; iLoopCount < _RecipeList.Count(); ++iLoopCount) { _RecipeList[iLoopCount] = listBoxRecipe.Items[iLoopCount].ToString(); } _RcpNewNameWnd.SetCurrentRecipe("[Default]", _RecipeList); if (_RcpNewNameWnd.ShowDialog() == DialogResult.OK) { LoadRecipeList(); this.Hide(); CParameterManager.SystemMode = eSysMode.RCP_MANUAL_CANGE; RecipeChange(_RcpNewNameWnd.NewRecipeName, "[Default]"); this.Show(); } CLogManager.AddSystemLog(CLogManager.LOG_TYPE.INFO, "RecipeWindow - RecipeAdd Complete", CLogManager.LOG_LEVEL.LOW); _RcpNewNameWnd.RecipeCopyEvent -= new RecipeNewNameWindow.RecipeCopyHandler(RecipeCopyEventFunction); IsRecipeNew = false; }
private void btnRecipeCopy_Click(object sender, EventArgs e) { RecipeNewNameWindow _RcpNewNameWnd = new RecipeNewNameWindow(ProjectType); _RcpNewNameWnd.RecipeCopyEvent += new RecipeNewNameWindow.RecipeCopyHandler(RecipeCopyEventFunction); string[] _RecipeList = new string[listBoxRecipe.Items.Count]; for (int iLoopCount = 0; iLoopCount < _RecipeList.Count(); ++iLoopCount) { _RecipeList[iLoopCount] = listBoxRecipe.Items[iLoopCount].ToString(); } if (listBoxRecipe.SelectedIndex == -1) { MessageBox.Show("No recipes selected."); return; } _RcpNewNameWnd.SetCurrentRecipe(listBoxRecipe.SelectedItem.ToString(), _RecipeList); _RcpNewNameWnd.ShowDialog(); _RcpNewNameWnd.RecipeCopyEvent -= new RecipeNewNameWindow.RecipeCopyHandler(RecipeCopyEventFunction); }