Example #1
0
        public override object ConvertBack(string fromVal)
        {
            if (fromVal == null)
            {
                throw new ArgumentNullException("fromVal");
            }
            if (string.IsNullOrEmpty(fromVal))
            {
                throw new ArgumentOutOfRangeException("fromVal", "Expected a non-empty string");
            }
            string[] strArray = fromVal.Split(_splits, StringSplitOptions.RemoveEmptyEntries);
            if (strArray.Length <= 0)
            {
                throw new ArgumentOutOfRangeException("fromVal", "Unable to find elements of the CoverageType enum in '" + fromVal + "'");
            }
            ReportOutputFormats formats = (ReportOutputFormats)Enum.Parse(typeof(ReportOutputFormats), strArray[0]);

            for (int i = 1; i < strArray.Length; i++)
            {
                formats |= (ReportOutputFormats)Enum.Parse(typeof(ReportOutputFormats), strArray[i].Trim());
            }
            return(formats);
        }
 public virtual void AddReportOutput(CoverageReportType reportType, ReportOutputFormats format)
 {
     this.AddReportOutput(new ReportOutputData {
         Format = format, ReportType = reportType
     });
 }