Пример #1
0
 public void Cut()
 {
     SvgDocument document1 = this.SVGDocument;
     DataFormats.Format format1 = DataFormats.GetFormat("SvgElement");
     bool flag1 = document1.AcceptChanges;
     document1.AcceptChanges = false;
     SVG svg1 = (SVG) document1.DocumentElement.CloneNode(false);
     SvgElementCollection.ISvgElementEnumerator enumerator1 = this.SVGDocument.SelectCollection.GetEnumerator();
     while (enumerator1.MoveNext())
     {
         SvgElement element1 = (SvgElement) enumerator1.Current;
         if (element1 is IGraph)
         {
             SvgElement[] elementArray1 = element1.CloneElements();
             svg1.FormatOutXml = false;
             SvgElement[] elementArray2 = elementArray1;
             for (int num1 = 0; num1 < elementArray2.Length; num1++)
             {
                 SvgElement element2 = elementArray2[num1];
                 svg1.AppendChild(element2);
             }
         }
     }
     document1.AcceptChanges = flag1;
     this.Delete();
     CopyData data1 = new CopyData(svg1.OuterXml);
     DataObject obj1 = new DataObject(format1.Name, data1);
     Clipboard.SetDataObject(obj1);
 }
Пример #2
0
 public void Copy()
 {
     SvgDocument document1 = this.SVGDocument;
     DataFormats.Format format1 = DataFormats.GetFormat("SvgElement");
     bool flag1 = document1.AcceptChanges;
     document1.AcceptChanges = false;
     SVG svg1 = (SVG) document1.DocumentElement.CloneNode(false);
     SvgElementCollection.ISvgElementEnumerator enumerator1 = this.SVGDocument.SelectCollection.GetEnumerator();
     StringBuilder outxml=new StringBuilder();
     while (enumerator1.MoveNext())
     {
         SvgElement element1 = (SvgElement) enumerator1.Current;
         outxml.Append(element1.OuterXml);
     //				if (element1 is IGraph)
     //				{
     //					SvgElement[] elementArray1 = element1.CloneElements();
     //					for (int num1 = 0; num1 < elementArray1.Length; num1++)
     //					{
     //						SvgElement element2 = elementArray1[num1];
     //						svg1.AppendChild(element2);
     //					}
     //				}
     }
     svg1.InnerXml=outxml.ToString();
     document1.AcceptChanges = flag1;
     CopyData data1 = new CopyData(svg1.OuterXml);
     DataObject obj1 = new DataObject(format1.Name, data1);
     Clipboard.SetDataObject(obj1);
 }