Пример #1
0
        /// <summary>
        /// Upon AddressTab initialization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddressTab_Initialized(object sender, EventArgs e)
        {
            bool hasSavedItem = m_newAddress.GetSavedAddress(IFCCommandOverrideApplication.TheDocument, out m_newAddressItem);

            if (hasSavedItem == true)
            {
                //keep a copy of the original saved items for checking for any value changed later on
                m_savedAddressItem = m_newAddressItem.Clone();

                // We won't initialize PurposeComboBox.SelectedIndex, as otherwise that will change the value
                // of m_newAddressItem.Purpose to the first item in the list, which we don't want.   It is
                // OK for this to be "uninitialized".

                // This is a short list, so we just do an O(n) search.
                int numItems = ifcPurposeList.Count();
                for (int ii = 0; ii < numItems; ii++)
                {
                    if (m_newAddressItem.Purpose == ifcPurposeList[ii])
                    {
                        PurposeComboBox.SelectedIndex = ii;
                        break;
                    }
                }
            }
            else
            {
                string projLocation = IFCCommandOverrideApplication.TheDocument.SiteLocation.PlaceName;
                if (projLocation != null)
                {
                    // if the formatted Address is empty and there is location set for the site (project) in Revit, take it and assign it by default to AddressLine1.
                    m_newAddressItem.AddressLine1 = projLocation;
                }
            }
        }
        /// <summary>
        /// Upon AddressTab initialization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddressTab_Initialized(object sender, EventArgs e)
        {
            bool hasSavedItem = m_newAddress.GetSavedAddress(IFCCommandOverrideApplication.TheDocument, out m_newAddressItem);

            if (hasSavedItem == true)
            {
                //keep a copy of the original saved items for checking for any value changed later on
                m_savedAddressItem = m_newAddressItem.Clone();

                // We won't initialize PurposeComboBox.SelectedIndex, as otherwise that will change the value
                // of m_newAddressItem.Purpose to the first item in the list, which we don't want.   It is
                // OK for this to be "uninitialized".

                // This is a short list, so we just do an O(n) search.
                int numItems = ifcPurposeList.Count();
                for (int ii = 0; ii < numItems; ii++)
                {
                    if (m_newAddressItem.Purpose == ifcPurposeList[ii])
                    {
                        PurposeComboBox.SelectedIndex = ii;
                        break;
                    }
                }
            }
        }
Пример #3
0
        string m_SettingFile = "IFCAddressInformationUIWindowSettings_v29.txt";  // update the file when resize window bounds.

        /// <summary>
        /// initialization of IFCAssignemt class
        /// </summary>
        /// <param name="document"></param>
        public IFCAddressInformation()
        {
            IFCExport.MakeCurrentRevitWindow(this);

            InitializeComponent();

            RestorePreviousWindow();

            bool hasSavedItem = m_newAddress.GetSavedAddress(IFCCommandOverrideApplication.TheDocument, out m_newAddressItem);

            if (hasSavedItem == true)
            {
                //keep a copy of the original saved items for checking for any value changed later on
                m_savedAddressItem = m_newAddressItem.Clone();

                // We won't initialize PurposeComboBox.SelectedIndex, as otherwise that will change the value
                // of m_newAddressItem.Purpose to the first item in the list, which we don't want.   It is
                // OK for this to be "uninitialized".

                // This is a short list, so we just do an O(n) search.
                int numItems = ifcPurposeList.Count();
                for (int ii = 0; ii < numItems; ii++)
                {
                    if (m_newAddressItem.Purpose == ifcPurposeList[ii])
                    {
                        PurposeComboBox.SelectedIndex = ii;
                        break;
                    }
                }
            }

            DataContext = m_newAddressItem;
        }
        /// <summary>
        /// Upon AddressTab initialization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddressTab_Initialized(object sender, EventArgs e)
        {
            bool hasSavedItem = m_newAddress.GetSavedAddress(IFCCommandOverrideApplication.TheDocument, out m_newAddressItem);

            if (hasSavedItem == true)
            {
                //keep a copy of the original saved items for checking for any value changed later on
                m_savedAddressItem           = m_newAddressItem.Clone();
                PurposeComboBox.SelectedItem = m_newAddressItem.Purpose;
            }
            else
            {
                string projLocation = IFCCommandOverrideApplication.TheDocument.SiteLocation.PlaceName;
                if (projLocation != null)
                {
                    // if the formatted Address is empty and there is location set for the site (project) in Revit, take it and assign it by default to AddressLine1.
                    m_newAddressItem.AddressLine1 = projLocation;
                }
            }
        }
        string m_SettingFile = "IFCAddressInformationUIWindowSettings_v30.txt";  // update the file when resize window bounds.

        /// <summary>
        /// initialization of IFCAssignemt class
        /// </summary>
        /// <param name="document"></param>
        public IFCAddressInformation(IFCExportConfiguration configuration)
        {
            InitializeComponent();

            m_newAddressItem = configuration.ProjectAddress;

            // This is a short list, so we just do an O(n) search.
            int numItems = ifcPurposeList.Count();

            for (int ii = 0; ii < numItems; ii++)
            {
                if (m_newAddressItem.Purpose == ifcPurposeList[ii])
                {
                    PurposeComboBox.SelectedIndex = ii;
                    break;
                }
            }

            // Initialize options from the m_newAddressItem
            Checkbox_AssignToBuilding.IsChecked = m_newAddressItem.AssignAddressToBuilding;
            Checkbox_AssignToSite.IsChecked     = m_newAddressItem.AssignAddressToSite;
            UpdateProjInfocheckBox.IsChecked    = m_newAddressItem.UpdateProjectInformation;
        }