示例#1
0
 private void btnPaste_Click(object sender, RoutedEventArgs e)
 {
     if (Clipboard.ContainsData("IC"))
     {
         string     xml = Clipboard.GetData("IC") as string;
         CircuitXML cx  = new CircuitXML(icl);
         try
         {
             UIGates.IC ic = cx.LoadCircuit(System.Xml.Linq.XElement.Parse(xml));
             gateCanvas.PasteIC(ic);
         }
         catch (Exception)
         {
             MessageBox.Show("Unable to complete paste; maybe you deleted a needed IC?");
         }
     }
 }
示例#2
0
 public void loadXMLElement(XElement circuit)
 {
     gateCanvas.ClearSelection();
     icl.Clear();
     CircuitXML cxml = new CircuitXML(icl);
     try
     {
         slZoom.Value = 1;
         RefreshGateCanvas(cxml.LoadCircuit(circuit));
     }
     catch (Exception ex)
     {
         MessageBox.Show("Unable to load circuit as requested: " + ex.ToString());
     }
 }
示例#3
0
 private void btnPaste_Click(object sender, RoutedEventArgs e)
 {
     if (Clipboard.ContainsData("IC"))
     {
         string xml = Clipboard.GetData("IC") as string;
         CircuitXML cx = new CircuitXML(icl);
         try
         {
             UIGates.IC ic = cx.LoadCircuit(System.Xml.Linq.XElement.Parse(xml));
             gateCanvas.PasteIC(ic);
         }
         catch (Exception)
         {
             MessageBox.Show("Unable to complete paste; maybe you deleted a needed IC?");
         }
     }
 }