private void Save_Click(object sender, EventArgs e) { if (_parentType.Equals(FormType.Test)) { TestCaseSave(); } else if (_parentType.Equals(FormType.Keyword)) { KeywordSave(); } }
public static FolderType ConvertFormTypeToFolderType(FormType formType) { FolderType folderType; if (formType.Equals(FormType.Keyword)) { folderType = FolderType.Resources; } else { folderType = formType.Equals(FormType.Test) ? FolderType.Tests : FolderType.Root; } return(folderType); }
//Add test case / keyword name to robot file private static int AddName(string name, string fileName, int index, FormType tag) { var tempTagIndex = RobotFileHandler.HasTag(fileName, tag); if (tempTagIndex == -1) { if (tag.Equals(FormType.Keyword)) { RobotFileHandler.FileLineAdd("*** Keywords ***", fileName, index); } else { if (tag.Equals(FormType.Test)) { var tempKeywordsIndex = RobotFileHandler.HasTag(fileName, FormType.Keyword); if (tempKeywordsIndex != -1) { RobotFileHandler.FileLineAdd("*** Test Cases ***", fileName, tempKeywordsIndex); index = tempKeywordsIndex; } else { RobotFileHandler.FileLineAdd("*** Test Cases ***", fileName, index); } } } index++; } else if (tempTagIndex + 1 != index) { RobotFileHandler.FileLineAdd("", fileName, index); index++; } RobotFileHandler.FileLineAdd(name, fileName, index); return(index); }
private void DrawContent(FormType formType) { IncomeList incomeList = null; OutcomeList outcomeList = null; DomesticList domesticList = null; try { if (formType.Equals(FormType.IncomeList)) { if (contentList.ContainsKey(FormType.IncomeList)) { mainTabCtl.SelectedTabPage = contentList.Single(t => t.Key.Equals(FormType.IncomeList)).Value; return; } else { incomeList = new IncomeList(Tool.xmlStr, dbName, year); incomeList.Dock = DockStyle.Fill; XtraTabPage contentTab = new XtraTabPage(); contentTab.Text = incomeList.FormCaption; contentTab.Controls.Add(incomeList); mainTabCtl.TabPages.Add(contentTab); mainTabCtl.SelectedTabPage = contentTab; contentList.Add(FormType.IncomeList, contentTab); } } else if (formType.Equals(FormType.OutcomeList)) { if (contentList.ContainsKey(FormType.OutcomeList)) { mainTabCtl.SelectedTabPage = contentList.Single(t => t.Key.Equals(FormType.OutcomeList)).Value; return; } else { outcomeList = new OutcomeList(Tool.xmlStr, dbName, year); outcomeList.Dock = DockStyle.Fill; XtraTabPage contentTab = new XtraTabPage(); contentTab.Text = outcomeList.FormCaption; contentTab.Controls.Add(outcomeList); mainTabCtl.TabPages.Add(contentTab); mainTabCtl.SelectedTabPage = contentTab; contentList.Add(FormType.OutcomeList, contentTab); } } else { if (contentList.ContainsKey(FormType.DomesticList)) { mainTabCtl.SelectedTabPage = contentList.Single(t => t.Key.Equals(FormType.DomesticList)).Value; return; } else { domesticList = new DomesticList(Tool.xmlStr, dbName, year); domesticList.Dock = DockStyle.Fill; XtraTabPage contentTab = new XtraTabPage(); contentTab.Text = domesticList.FormCaption; contentTab.Controls.Add(domesticList); mainTabCtl.TabPages.Add(contentTab); mainTabCtl.SelectedTabPage = contentTab; contentList.Add(FormType.DomesticList, contentTab); } } } catch (MofException ex) { System.Diagnostics.Debug.WriteLine("Шинэ content-tab үүсгэж чадсангүй: " + ex.Message); Tool.ShowError(ex.Message, ex.InnerException.Message); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Шинэ content-tab үүсгэж чадсангүй: " + ex.Message); Tool.ShowError("Шинэ content-tab үүсгэж чадсангүй: ", ex.Message); } finally { incomeList = null; outcomeList = null; } }