public StandaloneMetric(SerialMetric metric) { if (metric == null) { throw new ArgumentNullException("metric"); } _metric = metric; var attribute = _metric.GetType().GetCustomAttribute <MetricAttribute>(); _fieldNames = attribute.NameToFieldIndexMap .OrderBy(kvp => kvp.Value) .Select(kvp => kvp.Key) .ToArray(); _singleOutput = _fieldNames.Length == 1; _acceptBarInput = _metric is SingleOutputBarInputSerialMetric || _metric is MultipleOutputBarInputSerialMetric; _sobiMetric = _metric as SingleOutputBarInputSerialMetric; _soriMetric = _metric as SingleOutputRawInputSerialMetric; _mobiMetric = _metric as MultipleOutputBarInputSerialMetric; _moriMetric = _metric as MultipleOutputRawInputSerialMetric; }