コード例 #1
0
        private void renumberParkingPrefixWindow_Loaded(object sender, RoutedEventArgs e)
        {
            lvlInfo = RenumberParking.getAllLevels();
            IList <LevelInfo> prevLvlInfo = ONBOXApplication.storedParkingLevelInfo.ToList();

            if (ONBOXApplication.isNumIndenLevel == true)
            {
                checkIsNumIndenLevel.IsChecked = true;
            }
            else
            {
                checkIsNumIndenLevel.IsChecked = false;
            }

            foreach (LevelInfo currentLvlInfo in lvlInfo)
            {
                foreach (LevelInfo currentPrevLvlInfo in prevLvlInfo)
                {
                    if (currentLvlInfo.levelId == currentPrevLvlInfo.levelId)
                    {
                        currentLvlInfo.levelPrefix    = currentPrevLvlInfo.levelPrefix;
                        currentLvlInfo.willBeNumbered = currentPrevLvlInfo.willBeNumbered;
                    }
                }
            }

            gridLevel.AutoGenerateColumns   = false;
            gridLevel.CanUserAddRows        = false;
            gridLevel.CanUserDeleteRows     = false;
            gridLevel.CanUserResizeRows     = false;
            gridLevel.CanUserReorderColumns = false;
            gridLevel.ItemsSource           = lvlInfo;

            DataGridCheckBoxColumn dt0 = new DataGridCheckBoxColumn();

            dt0.Header      = Properties.WindowLanguage.RenumberParkLevelOptions_Use;
            dt0.Binding     = new Binding("willBeNumbered");
            dt0.CanUserSort = false;
            dt0.Width       = 50;

            DataGridTextColumn dt1 = new DataGridTextColumn();

            dt1.Header      = Properties.WindowLanguage.RenumberParkLevelOptions_Name;
            dt1.Binding     = new Binding("levelName");
            dt1.CanUserSort = false;
            dt1.IsReadOnly  = true;
            dt1.Width       = 150;

            DataGridTextColumn dt2 = new DataGridTextColumn();

            dt2.Header      = Properties.WindowLanguage.RenumberParkLevelOptions_Prefix;
            dt2.Binding     = new Binding("levelPrefix");
            dt2.CanUserSort = false;
            dt2.Width       = 60;

            gridLevel.Columns.Add(dt1);
            gridLevel.Columns.Add(dt0);
            gridLevel.Columns.Add(dt2);
        }
コード例 #2
0
        private void RenumberTypeWindow_Loaded(object sender, RoutedEventArgs e)
        {
            if (ONBOXApplication.storedParkingTypesInfo.Count == 0)
            {
                parkInfo = RenumberParking.getAllParkingTypesInfo();
            }
            else
            {
                parkInfo = RenumberParking.getAllParkingTypesInfo();

                foreach (ParkingTypesInfo currentStoredInfo in ONBOXApplication.storedParkingTypesInfo)
                {
                    foreach (ParkingTypesInfo currentInfo in parkInfo)
                    {
                        if (currentInfo.TypeId == currentStoredInfo.TypeId)
                        {
                            currentInfo.willBeNumbered = currentStoredInfo.willBeNumbered;
                            currentInfo.TypePrefix     = currentStoredInfo.TypePrefix;
                        }
                    }
                }
            }


            gridTypes.AutoGenerateColumns   = false;
            gridTypes.CanUserAddRows        = false;
            gridTypes.CanUserDeleteRows     = false;
            gridTypes.CanUserResizeRows     = false;
            gridTypes.CanUserReorderColumns = false;
            gridTypes.ItemsSource           = parkInfo;

            DataGridTextColumn dt1 = new DataGridTextColumn();

            dt1.Header      = Properties.WindowLanguage.RenumberParkTypeOptions_Name;
            dt1.Binding     = new Binding("TypeName");
            dt1.CanUserSort = false;
            dt1.IsReadOnly  = true;
            dt1.Width       = 150;

            DataGridCheckBoxColumn dt2 = new DataGridCheckBoxColumn();

            dt2.Header      = Properties.WindowLanguage.RenumberParkTypeOptions_Use;
            dt2.Binding     = new Binding("willBeNumbered");
            dt2.CanUserSort = false;
            dt2.Width       = 50;

            DataGridTextColumn dt3 = new DataGridTextColumn();

            dt3.Header      = Properties.WindowLanguage.RenumberParkTypeOptions_Prefix;
            dt3.Binding     = new Binding("TypePrefix");
            dt3.CanUserSort = false;
            dt3.Width       = 60;

            gridTypes.Columns.Add(dt1);
            gridTypes.Columns.Add(dt2);
            gridTypes.Columns.Add(dt3);
        }
コード例 #3
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (ONBOXApplication.storedParkingTypesInfo.Count == 0)
     {
         ONBOXApplication.storedParkingTypesInfo = RenumberParking.getAllParkingTypesInfo();
     }
     if (ONBOXApplication.storedParkingLevelInfo.Count == 0)
     {
         ONBOXApplication.storedParkingLevelInfo = RenumberParking.getAllLevels();
     }
 }
コード例 #4
0
 private void btnSelectParking_Click(object sender, RoutedEventArgs e)
 {
     this.Hide();
     RenumberParking.selectParking(this);
     ONBOXApplication.parkingRenumType = ONBOXApplication.RenumberType.FirstParking;
 }
コード例 #5
0
        static internal IList <ParkingTypesInfo> getAllParkingTypesInfo()
        {
            IList <ElementId>        allUsedParkingTypesIDs  = new List <ElementId>();
            IList <ParkingTypesInfo> AllUsedParkingTypesInfo = new List <ParkingTypesInfo>();

            IList <Element> allParkingInstances = new FilteredElementCollector(uidoc.Document).OfCategory(BuiltInCategory.OST_Parking)
                                                  .WhereElementIsNotElementType().ToList();

            foreach (Element currentElement in allParkingInstances)
            {
                if (!allUsedParkingTypesIDs.Contains(currentElement.GetTypeId()))
                {
                    int              typeID          = currentElement.GetTypeId().IntegerValue;
                    string           typeName        = currentElement.Name;
                    ParkingTypesInfo currentTypeInfo = new ParkingTypesInfo()
                    {
                        TypeName = typeName, TypeId = typeID, willBeNumbered = true, TypePrefix = "", TypeWidth = RenumberParking.GetParkingWidth(currentElement)
                    };

                    allUsedParkingTypesIDs.Add(currentElement.GetTypeId());
                    AllUsedParkingTypesInfo.Add(currentTypeInfo);
                }
            }

            return(AllUsedParkingTypesInfo);
        }