public MyColumn([JetBrains.Annotations.NotNull] string name, int column, [CanBeNull] DeviceTaggingSetInformation taggingSet, [JetBrains.Annotations.NotNull] DirectoryInfo basisPath, [JetBrains.Annotations.NotNull] FileFactoryAndTracker fft, CalcParameters parameters) { Tag = ""; RawName = name; Column = column; if (name.Contains(" [")) { var deviceWithRoom = name.Substring(name.IndexOf(" - ", StringComparison.Ordinal) + 3); deviceWithRoom = deviceWithRoom.Substring(0, deviceWithRoom.IndexOf(" [", StringComparison.Ordinal)).Trim(); var device = deviceWithRoom.Substring(deviceWithRoom.IndexOf(" - ", StringComparison.Ordinal) + 3).Trim(); try { if (taggingSet == null) { throw new LPGException("Tagging set was null"); } if (parameters.IsSet(CalcOption.HouseholdContents) && !taggingSet.TagByDeviceName.ContainsKey(device)) { var fileName = Path.Combine(basisPath.FullName, "missingCategories.txt"); if (!fft.CheckForFile(ResultFileID.MissingTags, Constants.GeneralHouseholdKey)) { fft.RegisterFile(fileName, "Devices that are missing device tags", false, ResultFileID.MissingTags, Constants.GeneralHouseholdKey, TargetDirectory.Root, CalcOption.HouseholdContents); } taggingSet.TagByDeviceName.Add(device, "Other"); using (var sw = new StreamWriter(fileName, true)) { sw.WriteLine(device); } Logger.Error("Missing entry in the device tagging set " + taggingSet.Name + " for the device " + device); } } catch (Exception ex) { Logger.Error( "Couldn't write to missing categories file: " + basisPath + " Error message was:" + ex.Message); Logger.Exception(ex); } if (taggingSet == null) { throw new LPGException("Tagging set was null"); } Tag = taggingSet.TagByDeviceName[device]; } }