private string GetExperimentFolder(ExperimentInfo experimentInfo, string rootFolder) { Trace.Assert(experimentInfo != null, "ExperimentInfo is null"); Trace.Assert(experimentInfo.ExperimentReference != null, "ExperimentInfo.ExperimentReference is null"); Trace.Assert(experimentInfo.ExperimentReference.Name != null, "ExperimentInfo.ExperimentReference.Name is null"); Trace.Assert(experimentInfo.ExperimentReference.User != null, "ExperimentInfo.ExperimentReference.User is null"); // start with the root folder ... string result = rootFolder; // ... and add each subfolder string temp = GetSubPath(SubFolders.ElementAtOrDefault(0), experimentInfo); if (!string.IsNullOrEmpty(temp)) { result = Path.Combine(result, temp); } temp = GetSubPath(SubFolders.ElementAtOrDefault(1), experimentInfo); if (!string.IsNullOrEmpty(temp)) { result = Path.Combine(result, temp); } temp = GetSubPath(SubFolders.ElementAtOrDefault(2), experimentInfo); if (!string.IsNullOrEmpty(temp)) { result = Path.Combine(result, temp); } temp = GetSubPath(SubFolders.ElementAtOrDefault(3), experimentInfo); if (!string.IsNullOrEmpty(temp)) { result = Path.Combine(result, temp); } return(result); }