Exemplo n.º 1
0
        public GroupWindow(ObservableCollection <CarboElement> elementList, CarboDatabase userMaterialData, CarboGroupSettings groupSettings)
        {
            dialogOk           = false;
            carboElementList   = elementList;
            carboGroupList     = new ObservableCollection <CarboGroup>();
            carboGroupSettings = groupSettings;

            materialData = userMaterialData;
            InitializeComponent();
        }
Exemplo n.º 2
0
        public void CreateGroups()
        {
            //get default group settings;
            CarboGroupSettings groupSettings = new CarboGroupSettings();

            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();
        }
Exemplo n.º 3
0
        private void Mnu_reGroupData_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Regrouping the set can remove any groups that you have created thus far, do you want to proceed?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Stop);

            if (result == MessageBoxResult.Yes)
            {
                CarboGroupSettings groupSettings = new CarboGroupSettings();
                groupSettings = groupSettings.DeSerializeXML();

                GroupWindow importGroupWindow = new GroupWindow(CarboLifeProject.getAllElements, CarboLifeProject.CarboDatabase, groupSettings);
                importGroupWindow.ShowDialog();
                if (importGroupWindow.dialogOk == true)
                {
                    //Save non-element items;

                    ObservableCollection <CarboGroup> userGroups = new ObservableCollection <CarboGroup>();
                    userGroups = CarboLifeProject.GetGroupsWithoutElements();

                    CarboLifeProject.SetGroups(importGroupWindow.carboGroupList);
                    CarboLifeProject.AddGroups(userGroups);
                    refreshData();
                }
            }
        }