コード例 #1
0
        void InitializePreDefinedTypeSelection(string ifcSchema, string ifcEntitySelected)
        {
            if (string.IsNullOrEmpty(ifcEntitySelected))
            {
                return;
            }

            InitializeComponent();
            IfcSchemaEntityTree ifcEntityTree = IfcSchemaEntityTree.GetEntityDictFor(ifcSchema);

            IList <string> predefinedTypeList = IfcSchemaEntityTree.GetPredefinedTypeList(ifcEntityTree, ifcEntitySelected);

            if (predefinedTypeList != null && predefinedTypeList.Count > 0)
            {
                TreeViewItem ifcEntityViewItem = new TreeViewItem();
                ifcEntityViewItem.Name       = ifcEntitySelected;
                ifcEntityViewItem.Header     = ifcEntitySelected + ".PREDEFINEDTYPE";
                ifcEntityViewItem.IsExpanded = true;
                m_TreeView.Items.Add(ifcEntityViewItem);

                foreach (string predefItem in predefinedTypeList)
                {
                    TreeViewItem childNode     = new TreeViewItem();
                    RadioButton  childNodeItem = new RadioButton();
                    childNode.Name           = predefItem;
                    childNodeItem.Name       = predefItem;
                    childNodeItem.Content    = predefItem;
                    childNodeItem.Checked   += new RoutedEventHandler(PredefSelected_Checked);
                    childNodeItem.Unchecked += new RoutedEventHandler(PredefSelected_Unchecked);
                    childNode.Header         = childNodeItem;
                    ifcEntityViewItem.Items.Add(childNode);
                }
            }
            TreeView_PredefinedType.ItemsSource = m_TreeView.Items;
        }