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?"); } } }
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()); } }