private void buttonPropertyData_Click(object sender, EventArgs e)
{
DocProperty docTemplate = (DocProperty)this.m_target;
string basetypename = "IfcValue";
switch (docTemplate.PropertyType)
{
case DocPropertyTemplateTypeEnum.P_REFERENCEVALUE:
basetypename = "IfcObjectReferenceSelect";
break;
}
DocObject docobj = null;
DocDefinition docEntity = null;
if (this.m_map.TryGetValue(basetypename, out docobj))
{
docEntity = (DocDefinition)docobj;
}
// get selected entity
DocObject target = null;
DocDefinition entity = null;
if (docTemplate.PrimaryDataType != null && m_map.TryGetValue(docTemplate.PrimaryDataType, out target))
{
entity = (DocDefinition)target;
}
using (FormSelectEntity form = new FormSelectEntity(docEntity, entity, this.m_project, SelectDefinitionOptions.Entity | SelectDefinitionOptions.Type))
{
DialogResult res = form.ShowDialog(this);
if (res == DialogResult.OK && form.SelectedEntity != null)
{
docTemplate.PrimaryDataType = form.SelectedEntity.Name;
this.textBoxPropertyDataPrimary.Text = docTemplate.PrimaryDataType;
}
}
}