예제 #1
0
        public SamplingFormVM(StudyUnitVM studyUnit)
            : base(studyUnit)
        {
            samplings = new ObservableCollection <SamplingVM>();

            //change how to name the title
            //*Find the unique title like unsed
            //*The title such as Concept and Amount can be changed manually,
            //Cannot do here
            HashSet <string> titles = Sampling.CollectTitles(studyUnit.SamplingModels);

            foreach (Sampling samplingModel in studyUnit.SamplingModels)
            {
                int        uniqIndex = EDOUtils.UniqOrderNo(titles, samplingModel.Title, PREFIX);
                SamplingVM sampling  = new SamplingVM(samplingModel)
                {
                    Parent      = this,
                    OrderNo     = uniqIndex,
                    OrderPrefix = PREFIX
                };
                sampling.Init();
                samplings.Add(sampling);
                titles.Add(sampling.Title); //Add in title set.
            }
            modelSyncher = new ModelSyncher <SamplingVM, Sampling>(this, samplings, studyUnit.SamplingModels);
        }
예제 #2
0
        public SamplingFormVM(StudyUnitVM studyUnit)
            : base(studyUnit)
        {
            samplings = new ObservableCollection<SamplingVM>();

            //タイトルの命名方法を他のところと変える。
            //・EXCELのシート名のように使われていないユニークなタイトルを見つける。
            //・変数のイメージや助成金などは自分でタイトルを変更することができるが、
            //ここではできないため。
            HashSet<string> titles = Sampling.CollectTitles(studyUnit.SamplingModels);
            foreach (Sampling samplingModel in studyUnit.SamplingModels)
            {
                int uniqIndex = EDOUtils.UniqOrderNo(titles, samplingModel.Title, PREFIX);
                SamplingVM sampling = new SamplingVM(samplingModel)
                {
                    Parent = this,
                    OrderNo = uniqIndex,
                    OrderPrefix = PREFIX
                };
                sampling.Init();
                samplings.Add(sampling);
                titles.Add(sampling.Title); //タイトルセットに追加。
            }
            modelSyncher = new ModelSyncher<SamplingVM, Sampling>(this, samplings, studyUnit.SamplingModels);
        }
예제 #3
0
        public void AddSampling()
        {
            HashSet <string> titles = Sampling.CollectTitles(StudyUnit.SamplingModels);
            int uniqIndex           = EDOUtils.UniqOrderNo(titles, null, PREFIX);

            SamplingVM sampling = new SamplingVM();

            sampling.Parent      = this;
            sampling.OrderNo     = uniqIndex;
            sampling.OrderPrefix = PREFIX;
            sampling.Init();
            samplings.Add(sampling);
            SelectedSamplingItem = sampling;
            Memorize();
        }
예제 #4
0
        public void AddSampling()
        {
            HashSet<string> titles = Sampling.CollectTitles(StudyUnit.SamplingModels);
            int uniqIndex = EDOUtils.UniqOrderNo(titles, null, PREFIX);

            SamplingVM sampling = new SamplingVM();
            sampling.Parent = this;
            sampling.OrderNo = uniqIndex;
            sampling.OrderPrefix = PREFIX;
            sampling.Init();
            samplings.Add(sampling);
            SelectedSamplingItem = sampling;
            Memorize();
        }