IfcDoc.CtlProperties.buttonPsetEntity_Click C# (CSharp) Méthode

buttonPsetEntity_Click() private méthode

private buttonPsetEntity_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
Résultat void
        private void buttonPsetEntity_Click(object sender, EventArgs e)
        {
            DocObject target = null;
            DocEntity entity = null;

            // get selected entity
            if (this.m_target is DocVariableSet)
            {
                DocVariableSet docTemplate = (DocVariableSet)this.m_target;
                if (docTemplate.ApplicableType != null && m_map.TryGetValue(docTemplate.ApplicableType, out target))
                {
                    entity = (DocEntity)target;
                }

                using (FormSelectEntity form = new FormSelectEntity(null, entity, this.m_project, SelectDefinitionOptions.Entity | SelectDefinitionOptions.Predefined))
                {
                    DialogResult res = form.ShowDialog(this);
                    if (res == DialogResult.OK && form.SelectedEntity != null)
                    {
                        if (String.IsNullOrEmpty(docTemplate.ApplicableType))
                        {
                            docTemplate.ApplicableType = form.SelectedEntity.Name;
                        }
                        else
                        {
                            docTemplate.ApplicableType += "," + form.SelectedEntity.Name;
                        }

                        // append predefined type, if any
                        if (form.SelectedConstant != null)
                        {
                            docTemplate.ApplicableType += "/" + form.SelectedConstant.Name;
                        }

                        this.LoadApplicability();
                    }
                }
            }
        }
CtlProperties