Example #1
0
        private CarboSettings DeSerializeXML()
        {
            string mySettingsPath = PathUtils.getSettingsFilePath();

            if (File.Exists(mySettingsPath))
            {
                try
                {
                    XmlSerializer ser = new XmlSerializer(typeof(CarboSettings));
                    CarboSettings bufferproject;

                    using (FileStream fs = new FileStream(mySettingsPath, FileMode.Open))
                    {
                        bufferproject = ser.Deserialize(fs) as CarboSettings;
                    }

                    return(bufferproject);
                }
                catch (Exception ex)
                {
                    System.Windows.MessageBox.Show(ex.Message);
                    return(null);
                }
            }
            else
            {
                CarboSettings newsettings = new CarboSettings();
                newsettings.SerializeXML();
                return(newsettings);
            }
        }
Example #2
0
        public void CreateGroups()
        {
            //get default group settings;
            CarboSettings groupSettings = new CarboSettings().Load();

            //groupSettings = groupSettings.DeSerializeXML();

            this.groupList = CarboElementImporter.GroupElementsAdvanced(this.elementList, groupSettings.groupCategory, groupSettings.groupSubCategory, groupSettings.groupType, groupSettings.groupMaterial, groupSettings.groupSubStructure, groupSettings.groupDemolition, CarboDatabase, groupSettings.uniqueTypeNames);
            CalculateProject();
        }