Esempio n. 1
0
 public DataSetVM(DataSet dataSet, ObservableCollection<DataSetVariableVM> dataSetVariables)
 {
     this.dataSet = dataSet;
     variables = new ObservableCollection<DataSetVariableVM>();
     int i = 1;
     foreach (DataSetVariableVM variable in dataSetVariables)
     {
         variable.Parent = this;
         variable.Position = i++;
         variables.Add(variable);
     }
     modelSyncer = new ModelSyncher<DataSetVariableVM, string>(this, variables, dataSet.VariableGuids);
     modelSyncer.AddActionHandler = (param) => { param.Position = NextPosition; };
 }
Esempio n. 2
0
        public static DataSet CreateDataSet(XElement logicalRecordElem)
        {
            string id = (string)logicalRecordElem.Attribute(ATTR_ID);
            if (id == null)
            {
                return null;
            }
            DataSet dataSetModel = new DataSet();
            dataSetModel.Id = id;
            dataSetModel.Title = (string)logicalRecordElem.Element(l + TAG_LOGICAL_RECORD_NAME);
            dataSetModel.Memo = (string)logicalRecordElem.Element(r + TAG_DESCRIPTION);

            IEnumerable<XElement> elements = logicalRecordElem.Descendants(l + TAG_VARIABLE_USED_REFERENCE);
            foreach (XElement variableInRecordElem in elements)
            {
                string variableId = (string)variableInRecordElem.Element(r + TAG_ID);
                if (variableId != null)
                {
                    dataSetModel.VariableGuids.Add(variableId);
                }
            }
            return dataSetModel;
        }
Esempio n. 3
0
        private static DataSetItem CreateDataSetItem(XElement fileDscrElem)
        {
            string id = (string)fileDscrElem.Attribute(ATTR_ID);
            if (string.IsNullOrEmpty(id))
            {
                return null;
            }
            string uri = (string)fileDscrElem.Attribute(ATTR_URI);

            XElement fileTxtElem = fileDscrElem.Element(cb + TAG_FILE_TXT);
            if (fileTxtElem == null)
            {
                return null;
            }

            string title = (string)fileTxtElem.Element(cb + TAG_FILE_NAME);
            string memo = (string)fileTxtElem.Element(cb + TAG_FILE_CONT);
            string format = (string)fileTxtElem.Element(cb + TAG_FORMAT);
            DataSet dataSet = new DataSet()
            {
                Id = id,
                Title = title,
                Memo = memo
            };
            DataFile dataFile = new DataFile()
            {
                Uri = uri,
                Format = format
            };
            dataFile.DataSetId = dataSet.Id;

            return new DataSetItem(dataSet, dataFile);
        }
Esempio n. 4
0
        public static StudyUnit CreateDefault()
        {
            StudyUnit studyUnit = new StudyUnit();
            int i = 1;
            foreach (Option option in Options.EventTypes)
            {
                studyUnit.Events.Add(new Event() { Title = option.Label, No = i++});
            }
            studyUnit.Coverage = Coverage.CreateDefault();
            studyUnit.FundingInfos.Add(new FundingInfo());
            studyUnit.Samplings.Add(new Sampling());
            studyUnit.ConceptSchemes.Add(new ConceptScheme());
            ControlConstructScheme scheme = new ControlConstructScheme();
            studyUnit.ControlConstructSchemes.Add(scheme);
            studyUnit.DefaultControlConstructSchemeId = scheme.Id;

            DataSet dataSet = new DataSet();
            dataSet.Title = EDOConstants.LABEL_ALL;
            dataSet.Memo = Resources.AllDataSet; //変数全体のデータセットです
            studyUnit.DefaultDataSetId = dataSet.Id;
            studyUnit.DataSets.Add(dataSet);

            dataSet.IsCreatedDataFile = true;
            DataFile dataFile = DataFile.createDataFile();
            dataFile.DataSetId = dataSet.Id;
            studyUnit.DataFiles.Add(dataFile);

            return studyUnit;
        }
Esempio n. 5
0
 public DataSetItem(DataSet dataSet, DataFile dataFile)
 {
     DataSet = dataSet;
     DataFile = dataFile;
 }