예제 #1
0
파일: Question.cs 프로젝트: ssjda-ddi/EDO
        public VariableGenerationInfo CreateVariableGenerationInfo()
        {
            VariableGenerationInfo info = new VariableGenerationInfo();

            info.ResponseTypeCode = Response.TypeCode;
            info.ChoicesLayoutMesurementMethod = ChoicesLayoutMesurementMethod.Single;
            if (Response.IsTypeChoices)
            {
                ResponseLayout layout = response.Layout;
                if (layout is ChoicesLayout)
                {
                    ChoicesLayout choicesLayout = (ChoicesLayout)layout;
                    info.ChoicesLayoutMesurementMethod = choicesLayout.MeasurementMethod;
                }
            }
            return(info);
        }
예제 #2
0
        private void Init(string detailTypeCode, decimal? min, decimal? max, CodeSchemeVM codeScheme, List<MissingValue> missingValueModels, ResponseLayout layoutModel)
        {
            DetailTypeCode = detailTypeCode;
            Min = min;
            Max = max;
            CodeScheme = codeScheme;

            DetailTypes = new ObservableCollection<Option>();
            if (response.IsTypeChoices)
            {
            } else if (response.IsTypeDateTime)
            {
                DetailTypes = Options.DateTimeTypes;
            }
            else if (response.IsTypeFree)
            {
            }
            else if (response.IsTypeNumber)
            {
                DetailTypes = Options.NumberTypes;
            }

            missingValues = new ObservableCollection<MissingValueVM>();
            foreach (MissingValue mv in missingValueModels)
            {
                MissingValueVM missingValue = new MissingValueVM(mv) { Parent = this };
                missingValues.Add(missingValue);
            }
            modelSyncher = new ModelSyncher<MissingValueVM, MissingValue>(this, missingValues, response.MissingValues);

            ResponseLayout newLayoutModel = layoutModel;

            layout = CreateLayout(response, layoutModel);
            response.Layout = layout.Layout;
        }
예제 #3
0
 private ResponseLayoutVM CreateLayout(Response response, ResponseLayout layoutModel)
 {
     ResponseLayout newLayoutModel = layoutModel;
     ResponseLayoutVM layout = null;
     if (response.IsTypeChoices)
     {
         if (newLayoutModel as ChoicesLayout == null)
         {
             newLayoutModel = new ChoicesLayout();
         }
         layout = new ChoicesLayoutVM((ChoicesLayout)newLayoutModel);
     }
     else if (response.IsTypeDateTime)
     {
         if (newLayoutModel as DateTimeLayout == null)
         {
             newLayoutModel = new DateTimeLayout();
         }
         layout = new DateTimeLayoutVM((DateTimeLayout)newLayoutModel);
     }
     else if (response.IsTypeFree)
     {
         if (newLayoutModel as FreeLayout == null)
         {
             newLayoutModel = new FreeLayout();
         }
         layout = new FreeLayoutVM((FreeLayout)newLayoutModel);
     }
     else if (response.IsTypeNumber)
     {
         if (newLayoutModel as NumericLayout  == null)
         {
             newLayoutModel = new NumericLayout();
         }
         layout = new NumericLayoutVM((NumericLayout)newLayoutModel);
     }
     else
     {
         if (newLayoutModel as UnknownLayout == null)
         {
             newLayoutModel = new UnknownLayout();
         }
         layout = new UnknownLayoutVM((UnknownLayout)newLayoutModel);
     }
     layout.Parent = this;
     return layout;
 }
예제 #4
0
 public ResponseLayoutVM(ResponseLayout layout)
 {
     this.layout = layout;
 }