/// <summary> /// Parse out the Building / Phase, separator, Sheet ID, sheet name /// </summary> /// <param name="sheetPdf"></param> /// <param name="filename"></param> /// <returns></returns> public bool Parse2(FileNameSheetPdf sheetPdf, string filename) { sheetPdf.isPhaseBldg = null; sheetPdf.shtCompType = ShtCompTypes.UNASSIGNED; Match match = patternShtNumAndName.Match(filename); if (!match.Success) { sheetPdf.fileType = FileTypeSheetPdf.INVALID; return(false); } GroupCollection g = match.Groups; string test; // phase-bldg test = g[ShtIds.CompGrpName2(ShtCompTypes.PHBLDG, PHBLDG_COMP_IDX)].Value; if (!test.IsVoid()) { sheetPdf.SheetComps[PHBLDG_VALUE_IDX] = test; sheetPdf.SheetComps[PBSEP_VALUE_IDX] = g[ShtIds.CompGrpName2(ShtCompTypes.PHBLDG, PBSEP_COMP_IDX)].Value; sheetPdf.sheetID = g[ShtIds.CompGrpName2(ShtCompTypes.PHBLDG, SHTID_COMP_IDX)].Value; sheetPdf.isPhaseBldg = true; } else { sheetPdf.sheetID = g[ShtIds.CompGrpName2(ShtCompTypes.PHBLDG, SHTID_COMP_IDX)].Value; sheetPdf.isPhaseBldg = false; } sheetPdf.originalSheetTitle = g[ShtIds.CompGrpName2(ShtCompTypes.PHBLDG, SHTNAME_COMP_IDX)].Value; sheetPdf.sheetTitle = sheetPdf.originalSheetTitle; return(true); }
internal ShtCompTypes GetShtCompTypeFromGrpCollection(GroupCollection g) { if (!g[ShtIds.CompGrpName2(ShtCompTypes.TYPE10, 0)].Value.IsVoid()) { return(ShtCompTypes.TYPE10); } else if (!g[ShtIds.CompGrpName2(ShtCompTypes.TYPE20, 0)].Value.IsVoid()) { return(ShtCompTypes.TYPE20); } else if (!g[ShtIds.CompGrpName2(ShtCompTypes.TYPE30, 0)].Value.IsVoid()) { return(ShtCompTypes.TYPE30); } else if (!g[ShtIds.CompGrpName2(ShtCompTypes.TYPE40, 0)].Value.IsVoid()) { return(ShtCompTypes.TYPE40); } return(ShtCompTypes.UNASSIGNED); }