コード例 #1
0
        public void SelectElement(string selectedName)
        {
            _selectedName = selectedName;
            if (string.IsNullOrWhiteSpace(selectedName) || _drawingDocument == null)
            {
                elementImage.Source = null;
                textEditor.Text     = string.Empty;

                return;
            }

            var selecteElement = _drawingDocument.GetSvgById(selectedName);

            if (selecteElement != null)
            {
                textEditor.Text = selecteElement.OuterXml;
            }
            else
            {
                textEditor.Text = string.Empty;
            }

            var selectedDrawing = _drawingDocument.GetById(selectedName);

            if (selectedDrawing != null)
            {
                elementImage.Source = new DrawingImage(selectedDrawing);
            }
            else
            {
                elementImage.Source = null;
            }
        }
コード例 #2
0
 public ExpolorerRoot(WpfDrawingDocument doc)
 {
     document = doc;
     foreach (var dn in doc.DrawingNames)
     {
         var d = doc.GetById(dn);
         names.Add(d, dn);
     }
 }