예제 #1
0
        public override Metric Clone(FormTemplate template, MetricGroup metricGroup)
        {
            var clone = BaseClone <NumericMetric>(template, metricGroup);

            clone.MaxVal = MaxVal;
            return(clone);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
 public override Metric Clone(FormTemplate template, MetricGroup metricGroup)
 {
     return(BaseClone <DichotomousMetric>(template, metricGroup));
 }
예제 #9
0
 public virtual Metric Clone(FormTemplate template, MetricGroup metricGroup)
 {
     throw new InvalidOperationException();
 }