Beispiel #1
0
        /// <summary>
        /// 创建属性
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="id"></param>
        void CreateElementPropertyUI(Document doc, ElementId id)
        {
            var element = doc.FindElement(id);

            if (element == null)
            {
                return;
            }
            {
                Expander expander = new Expander();
                expander.Header  = "Element";
                expander.Content = new BasicPage(element);
                propertyBrowser.Children.Add(expander);
                expander.IsExpanded = true;
            }

            DrawableElement de = DrawableElement.Cast(element);

            if (de != null)
            {
                Expander expander = new Expander();
                expander.Header = "Location";
                var page = new TransformPage(de);
                page.UpdateViewEvent += mDocumentView.UpdateView;
                expander.Content      = page;
                propertyBrowser.Children.Add(expander);
                expander.IsExpanded = true;
            }
        }
Beispiel #2
0
        public override void OnAddElements(Document pDocument, ElementIdSet ids)
        {
            foreach (var id in ids)
            {
                var element = DrawableElement.Cast(pDocument.FindElement(id));
                if (element == null)
                {
                    continue;
                }

                var item = new BrowerNodeItem();
                item.DisplayName = String.Format("{0}({1})", element.GetName(), element.GetId().GetInteger());
                item.Tag         = element.GetId();
                mProjectBrower.Add(item);
            }
        }