Esempio n. 1
0
        public void LoadFactorSet(string FilePath)
        {
            //TODO: Implement error handling in the event a garbage file is selected.
            if (HasData)
            {
                FactorSet.Clear();
                ResearchFactors.Clear();
            }

            XmlTextReader reader = new XmlTextReader(FilePath);

            FactorSet.ReadXml(reader);

            reader.Close();

            foreach (var row in FactorSet.AsEnumerable())
            {
                ResearchFactor factor = new ResearchFactor
                {
                    Name             = row.Field <string>("Name"),
                    Labels           = row.Field <ObservableCollection <string> >("Labels"),
                    Levels           = row.Field <int>("Levels"),
                    IsWithinSubjects = row.Field <bool>("IsWithinSubjects"),
                    IsRandomized     = row.Field <bool>("IsRandomized")
                };

                ResearchFactors.Add(factor);
            }
        }
Esempio n. 2
0
        public void SaveFactorSet(string FilePath)
        {
            XmlTextWriter writer = new XmlTextWriter(FilePath, Encoding.Default);

            FactorSet.WriteXml(writer);

            writer.Close();
        }
Esempio n. 3
0
 public ScalingFactor(float abs, float rel, int idx)
 {
     _absolute = new FactorSet(abs);
     _relative = new FactorSet(rel);
     _index = idx;
 }
Esempio n. 4
0
 public ScalingFactor(float abs, float rel, int idx)
 {
     _absolute = new FactorSet(abs);
     _relative = new FactorSet(rel);
     _index    = idx;
 }