public bool Read() { bool blnResult; blnResult = false; if (UseCurrentActiveApplication()) { if (ActivateWorkbook()) { Template = ReadSheets(); if (Template != TEMPLATES.UNKNOWN) { blnResult = true; } } } return blnResult; }
public AddInAction(TEMPLATES template) { Init(); Template = template; }
public AddInAction() { Init(); Template = TEMPLATES.UNKNOWN; }
private void ReadSheets() { bool blnWorksheet = true; Excel.Worksheet general = null; Excel.Worksheet tc = null; Excel.Worksheet flows = null; foreach (Excel.Worksheet worksheet in Base.Worksheets) { blnWorksheet = true; string codeName = ""; try { codeName = worksheet.Name.ToString().ToLower(); } catch (Exception ex) { blnWorksheet = false; } if (blnWorksheet == true) { if (string.Compare(codeName, "general", true) == 0) { general = worksheet; } else if (string.Compare(codeName, "flows", true) == 0) { flows = worksheet; } else if (string.Compare(codeName, "testcases", true) == 0) { tc = worksheet; } } } if (general != null && tc != null && flows != null) { Template = TEMPLATES.PROCESS; Framework.Process = new ProcessWorkbook(Base, flows, tc); } }