public override Metric Clone(FormTemplate template, MetricGroup metricGroup) { var clone = BaseClone <NumericMetric>(template, metricGroup); clone.MaxVal = MaxVal; return(clone); }
public override Metric Clone(FormTemplate template, MetricGroup metricGroup) { var clone = BaseClone <AttachmentMetric>(template, metricGroup); clone.AllowMultipleFiles = AllowMultipleFiles; clone.AllowedAttachmentTypes = new List <AttachmentType>(AllowedAttachmentTypes); return(clone); }
public override Metric Clone(FormTemplate template, MetricGroup metricGroup) { var clone = BaseClone <MultipleChoiceMetric>(template, metricGroup); clone.DataList = DataList.IsAdHoc ? DataList.Clone() : (DataList)null; // Create a new datalist only if it is an ad-hoc clone.DataListId = DataList.IsAdHoc ? (Guid)Guid.Empty : DataListId; clone.ViewType = ViewType; return(clone); }
public override Metric Clone(FormTemplate template, MetricGroup metricGroup) { var clone = BaseClone <FreeTextMetric>(template, metricGroup); clone.MaxLength = MaxLength; clone.NumberOfLine = NumberOfLine; clone.MinLength = MinLength; return(clone); }
public override Metric Clone(FormTemplate template, MetricGroup metricGroup) { var clone = BaseClone <RateMetric>(template, metricGroup); clone.MaxValue = MaxValue; clone.MinValue = MinValue; clone.DefaultValue = DefaultValue; clone.DataList = DataList.IsAdHoc ? DataList.Clone() : null; // Create a new datalist only if it is an ad-hoc clone.DataListId = DataList.IsAdHoc ? null : DataListId; return(clone); }
protected T BaseClone <T>(FormTemplate cloneTemplate, MetricGroup cloneMetricGroup) where T : Metric, new() { var clone = new T() { FormTemplate = cloneMetricGroup.FormTemplate, Description = Description, Mandatory = Mandatory, Order = Order, SectionTitle = SectionTitle, ShortTitle = ShortTitle, DateArchived = DateArchived, }; return(clone); }
public MetricGroup Clone(FormTemplate cloneTemplate) { var clonedGroup = new MetricGroup { FormTemplate = cloneTemplate, CanAddMoreRows = CanAddMoreRows, DataList = DataList?.IsAdHoc ?? false?DataList.Clone() : (DataList)null, // Create a new datalist only if it is an ad-hoc DataListId = DataList?.IsAdHoc ?? true ? (Guid?)null : DataListId, HelpContext = HelpContext, NumberOfRows = NumberOfRows, Order = Order, Page = Page, Title = Title }; foreach (var metric in Metrics) { clonedGroup.Metrics.Add(metric.Clone(cloneTemplate, clonedGroup)); } return(clonedGroup); }
public override Metric Clone(FormTemplate template, MetricGroup metricGroup) { return(BaseClone <DichotomousMetric>(template, metricGroup)); }
public virtual Metric Clone(FormTemplate template, MetricGroup metricGroup) { throw new InvalidOperationException(); }