예제 #1
0
        private void CollectProjectLocaiton()
        {
            try
            {
                ProjectLocationSet         locationSet = m_doc.ProjectLocations;
                ProjectLocationSetIterator iter        = locationSet.ForwardIterator();
                while (iter.MoveNext())
                {
                    ProjectLocation           location = iter.Current as ProjectLocation;
                    ProjectLocationProperties plp      = new ProjectLocationProperties(location);
                    projectLocations.Add(plp);
                }

                comboBoxSite1.ItemsSource = null;
                comboBoxSite1.ItemsSource = projectLocations;

                comboBoxSite2.ItemsSource = null;
                comboBoxSite2.ItemsSource = projectLocations;

                if (projectLocations.Count > 0)
                {
                    comboBoxSite1.SelectedIndex = 0;
                    comboBoxSite2.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
예제 #2
0
        /// <summary>
        /// get the information of all the project locations associated with this project
        /// </summary>
        public void GetLocationData()
        {
            m_locationnames.Clear();
            ProjectLocation currentLocation = m_application.ActiveUIDocument.Document.ActiveProjectLocation;

            //get the current location name
            m_currentLocationName = currentLocation.Name;
            //Retrieve all the project locations associated with this project
            ProjectLocationSet locations = m_application.ActiveUIDocument.Document.ProjectLocations;

            ProjectLocationSetIterator iter = locations.ForwardIterator();

            iter.Reset();
            while (iter.MoveNext())
            {
                ProjectLocation locationTransform = iter.Current as ProjectLocation;
                string          transformName     = locationTransform.Name;
                m_locationnames.Add(transformName); //add the location's name to the list
            }
        }