Example #1
0
        private void btnCopyAsImage_Click(object sender, RoutedEventArgs e)
        {
            if (gateCanvas.selected.Count > 0)
            {
                UIGates.IC ic = gateCanvas.CreateIC("(clipboard)", GateCanvas.SELECTED_GATES.SELECTED);


                GateCanvas tmp = new GateCanvas(ic, icl);
                tmp.Width  = tmp.GetBounds(0, false).Width;
                tmp.Height = tmp.GetBounds(0, false).Height;
                BackgroundWorker bg = new BackgroundWorker();
                bg.DoWork += (s2, e2) =>
                {
                    System.Threading.Thread.Sleep(500); // prop time
                    // don't use wait on propagation because if there is a loop
                    // it will loop forever
                };
                bg.RunWorkerCompleted += (s2, e2) =>
                {
                    tmp.Mute = true;
                    tmp.UpdateLayout();
                    tmp.UpdateWireConnections();
                    Clipboard.SetImage(tmp.CreateImage());
                    Grid1.Children.Remove(tmp);
                };

                Grid1.Children.Add(tmp);
                bg.RunWorkerAsync();
            }
        }
Example #2
0
        /// <summary>
        /// Replace the existing canvas with a new canvas, based on the IC given.
        /// This is similar to closing this window and replacing it with another window
        /// based on that IC instead.
        /// </summary>
        /// <param name="newgcic"></param>
        public void RefreshGateCanvas(UIGates.IC newgcic)
        {
            Grid1.Children.Remove(gateCanvas);

            gateCanvas.Circuit.Stop();

            gateCanvas = new GateCanvas(newgcic, icl);
            gateCanvas.UndoProvider = (UndoRedo.UndoManager)Resources["undoManager"];
            this.UnregisterName("gateCanvas");
            this.RegisterName("gateCanvas", gateCanvas);
            Grid1.Children.Insert(0 /*Grid1.Children.Count - 4*/,gateCanvas);
            Grid.SetColumn(gateCanvas, 1);
            Grid.SetRow(gateCanvas, 1);
            _basedon = newgcic;

            if (!string.IsNullOrEmpty(newgcic.AbGate.Name))
            {
                _filename = newgcic.AbGate.Name;
                spGates.ICName = newgcic.AbGate.Name;
                UpdateTitle();
            }

            if (MyEditLevel == EditLevel.FULL || MyEditLevel == EditLevel.EDIT)
            {
                // monitor the clipboard to provide cut/copy/paste visibility
                gateCanvas.selected.ListChanged += (s2, e2) =>
                {
                    btnCopy.IsEnabled = gateCanvas.selected.Count > 0;
                    btnCut.IsEnabled = gateCanvas.selected.Count > 0;
                    btnCopyAsImage.IsEnabled = gateCanvas.selected.Count > 0;
                };
            }

            if (_myEditLevel == EditLevel.FULL)
                gateCanvas.Circuit.Start();

            gateCanvas.SetCaptureICLChanges();

            gateCanvas.Zoom = slZoom.Value;

            gateCanvas.UpdateLayout();
            gateCanvas.UpdateWireConnections();

            
            
        }
Example #3
0
        /// <summary>
        /// Replace the existing canvas with a new canvas, based on the IC given.
        /// This is similar to closing this window and replacing it with another window
        /// based on that IC instead.
        /// </summary>
        /// <param name="newgcic"></param>
        public void RefreshGateCanvas(UIGates.IC newgcic)
        {
            Grid1.Children.Remove(gateCanvas);

            gateCanvas.Circuit.Stop();

            gateCanvas = new GateCanvas(newgcic, icl);
            gateCanvas.UndoProvider = (UndoRedo.UndoManager)Resources["undoManager"];
            this.UnregisterName("gateCanvas");
            this.RegisterName("gateCanvas", gateCanvas);
            Grid1.Children.Insert(0 /*Grid1.Children.Count - 4*/, gateCanvas);
            Grid.SetColumn(gateCanvas, 1);
            Grid.SetRow(gateCanvas, 1);
            _basedon = newgcic;

            if (!string.IsNullOrEmpty(newgcic.AbGate.Name))
            {
                _filename      = newgcic.AbGate.Name;
                spGates.ICName = newgcic.AbGate.Name;
                UpdateTitle();
            }

            if (MyEditLevel == EditLevel.FULL || MyEditLevel == EditLevel.EDIT)
            {
                // monitor the clipboard to provide cut/copy/paste visibility
                gateCanvas.selected.ListChanged += (s2, e2) =>
                {
                    btnCopy.IsEnabled        = gateCanvas.selected.Count > 0;
                    btnCut.IsEnabled         = gateCanvas.selected.Count > 0;
                    btnCopyAsImage.IsEnabled = gateCanvas.selected.Count > 0;
                };
            }

            if (_myEditLevel == EditLevel.FULL)
            {
                gateCanvas.Circuit.Start();
            }

            gateCanvas.SetCaptureICLChanges();

            gateCanvas.Zoom = slZoom.Value;

            gateCanvas.UpdateLayout();
            gateCanvas.UpdateWireConnections();
        }
Example #4
0
        /// <summary>
        /// Create an XML representation of the circuit in the given gate canvas,
        /// together with ALL ICs in the gate canvas' icl (whether they are referenced or not)
        /// and save the whole thing to a file.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="gc"></param>
        public void Save(string path, GateCanvas gc)
        {
            XElement root = new XElement("CircuitGroup");

            root.SetAttributeValue("Version", "1.2");

            XElement maincircuit = CreateCircuitXML(gc.CreateIC("", GateCanvas.SELECTED_GATES.ALL));

            maincircuit.SetAttributeValue("Name", null);


            TopologicalSort   ts  = new TopologicalSort();
            List <UIGates.IC> ics = ts.Sort(icl, icl);

            foreach (UIGates.IC theic in ics)
            {
                root.Add(CreateCircuitXML(theic));
            }
            root.Add(maincircuit);

            root.Save(path);
        }
Example #5
0
        private UndoRedo.IUndoable Flatten(UIGates.IC ic)
        {
            GateCanvas icgc = new GateCanvas((UIGates.IC)ic, icl);


            UndoRedo.Transaction undo_inline = new UndoRedo.Transaction("Inline Circuit");
            // step 1. make room for the circuit
            // NOTE: exclude user i/o gates
            // because these will be removed anyways!
            Rect bounds = GetBounds(icgc.gates.Values.Where(g => !(g is UIGates.UserIO)), 0);
            
           
            foreach (Gate g in gates.Values)
            {
                if (g.Margin.Left > ic.Margin.Left || g.Margin.Top > ic.Margin.Top)
                {
                    Point origin = new Point(g.Margin.Left, g.Margin.Top);
                    double left = g.Margin.Left;
                    double top = g.Margin.Top;
                    if (g.Margin.Left > ic.Margin.Left && bounds.Width - ic.Width > 0)
                        left += bounds.Width - ic.Width;

                    if (g.Margin.Top > ic.Margin.Top && bounds.Height - ic.Height > 0)
                        top += bounds.Height - ic.Height;

                    g.Margin = new Thickness(left, top, 0, 0);
                    ((GateLocation)g.Tag).x = left;
                    ((GateLocation)g.Tag).y = top;
                    undo_inline.Add(new UndoRedo.MoveGate(g, this, origin, new Point(g.Margin.Left, g.Margin.Top)));
                }

            }

            // steps 2 and 3.
            // bring in circuit and connect internal wiring
            Dictionary<Gate, Gate> newgates; // = new Dictionary<Gate, Gate>();
            undo_inline.Add(AddGates(icgc, new Point(-bounds.Left + ic.Margin.Left, -bounds.Top + ic.Margin.Top), out newgates));


            // step 4. connect external wiring 
            Gates.IC gic = ic.AbGate as Gates.IC;
            // step 4a. connect inputs
            for (int i = 0; i < gic.NumberOfInputs; i++)
            {
                // for each input, find out which circuits within the ic
                // it is connected to
                List<Gates.Terminal> targets = gic.Circuit.GetTargets(new Gates.Terminal(0, gic.Inputs[i]));

                // and this particular ic input, what supplies it from outside the ic?
                Gates.Terminal source = c.GetSource(new Gates.Terminal(i, gic));

                // then disconnect those inputs
                // and connect it them from the outer
                foreach (Gates.Terminal t in targets)
                {
                    Gates.Terminal tt = new Gates.Terminal(t.portNumber, newgates[icgc.FindGate(t.gate)].AbGate);
                    undo_inline.Add(new UndoRedo.Reverse(new UndoRedo.ConnectWire(c, c.GetSource(tt), tt)));
                    c.Disconnect(tt);

                    if (source != null)
                    {
                        c[tt] = source;
                        undo_inline.Add(new UndoRedo.ConnectWire(c, source, tt));
                    }
                }

            }
            // step 4b. connect outputs
            for (int i = 0; i < gic.Output.Length; i++)
            {
                // for each output, find out which circuit within the ic
                // it comes from
                Gates.Terminal source = gic.Circuit.GetSource(new Gates.Terminal(0, gic.Outputs[i]));

                // translate into our circuit
                if (source != null)
                {
                    source = new Gates.Terminal(source.portNumber, newgates[icgc.FindGate(source.gate)].AbGate);
                }

                // and this particular output supplies which sources in our circuit?
                List<Gates.Terminal> targets = c.GetTargets(new Gates.Terminal(i, gic));

                // then disconnect those inputs
                // and connect it them from the outer
                foreach (Gates.Terminal t in targets)
                {
                    undo_inline.Add(new UndoRedo.Reverse(new UndoRedo.ConnectWire(c, c.GetSource(t), t)));
                    c.Disconnect(t);

                    if (source != null)
                    {
                        c[t] = source;
                        undo_inline.Add(new UndoRedo.ConnectWire(c, source, t));
                    }
                }

            }


            // step 5. delete user i/o and ic
            ClearSelection();
            for (int i = 0; i < gic.NumberOfInputs; i++)
            {
                selected.Add(newgates[icgc.FindGate(gic.Inputs[i])]);
            }
            for (int i = 0; i < gic.Outputs.Length; i++)
            {
                selected.Add(newgates[icgc.FindGate(gic.Outputs[i])]);
            }
            selected.Add(ic);
            undo_inline.Add(DeleteSelectedGates());

            // step 6. set selection to newly inlined gates
            ClearSelection();
            foreach (Gate g in newgates.Values)
            {
                if (!(g is UIGates.UserIO))
                {
                    selected.Add(g);
                    g.Selected = true;
                }
            }

            return undo_inline;
        }
Example #6
0
        /// <summary>
        /// Add all gates from a given canvas into our canvas at the selected offset.
        /// A clone of each gate will be made, both at the visual and internal level.
        /// A map will be produced indicated the relationship between the gates in the original
        /// canvas and the gates added to this canvas.
        /// </summary>
        /// <param name="icgc"></param>
        /// <param name="offset"></param>
        /// <param name="gatemap"></param>
        /// <returns></returns>
        protected UndoRedo.Transaction AddGates(GateCanvas icgc, Point offset, out Dictionary<Gate, Gate> gatemap)
        {
            UndoRedo.Transaction addgates = new UndoRedo.Transaction("Add Gates");
            gatemap = new Dictionary<Gate, Gate>();

            // step 1. bring the circuit in
            foreach (Gate g in icgc.gates.Values)
            {
                gatemap[g] = g.CreateUserInstance();
                AddGate(gatemap[g], new GateLocation(offset.X + g.Margin.Left, g.Margin.Top + offset.Y, ((RotateTransform)g.RenderTransform).Angle));
                addgates.Add(new UndoRedo.AddGate(this, gatemap[g]));
            }

            // step 2. connect internal wiring
            foreach (ConnectedWire cw in icgc.wires.Values)
            {
                Gates.Terminal target = new Gates.Terminal(cw.DestTerminalID.ID, gatemap[icgc.FindGate(cw.DestinationGate)].AbGate);
                Gates.Terminal source = new Gates.Terminal(cw.OriginTerminalID.ID, gatemap[icgc.FindGate(cw.OriginGate)].AbGate);
                c[target] = source;
                addgates.Add(new UndoRedo.ConnectWire(c, source, target));
            }

            return addgates;
        }
Example #7
0
        /// <summary>
        /// Create an XML representation of the circuit in the given gate canvas,
        /// together with ALL ICs in the gate canvas' icl (whether they are referenced or not)
        /// and save the whole thing to a file.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="gc"></param>
        public void Save(string path, GateCanvas gc)
        {
            XElement root = new XElement("CircuitGroup");
            root.SetAttributeValue("Version", "1.2");

            XElement maincircuit = CreateCircuitXML(gc.CreateIC("", GateCanvas.SELECTED_GATES.ALL));
            maincircuit.SetAttributeValue("Name", null);

            TopologicalSort ts = new TopologicalSort();
            List<UIGates.IC> ics = ts.Sort(icl, icl);
            
            foreach (UIGates.IC theic in ics)
            {
                root.Add(CreateCircuitXML(theic));
            }
            
            root.Add(maincircuit);

            root.Save(path);
        }
Example #8
0
 private void btnCopyAsImage_Click(object sender, RoutedEventArgs e)
 {
     if (gateCanvas.selected.Count > 0)
     {
         UIGates.IC ic = gateCanvas.CreateIC("(clipboard)", GateCanvas.SELECTED_GATES.SELECTED);
         
         
         GateCanvas tmp = new GateCanvas(ic, icl);
         tmp.Width = tmp.GetBounds(0, false).Width;
         tmp.Height = tmp.GetBounds(0, false).Height;
         BackgroundWorker bg = new BackgroundWorker();
         bg.DoWork += (s2, e2) =>
         {
             System.Threading.Thread.Sleep(500); // prop time
             // don't use wait on propagation because if there is a loop
             // it will loop forever
         };
         bg.RunWorkerCompleted += (s2, e2) =>
         {
             tmp.Mute = true;
             tmp.UpdateLayout();
             tmp.UpdateWireConnections();
             Clipboard.SetImage(tmp.CreateImage());
             Grid1.Children.Remove(tmp);
         };
         
         Grid1.Children.Add(tmp);
         bg.RunWorkerAsync();
         
     }
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.UserControlScaleXY = ((System.Windows.Media.ScaleTransform)(target));
     return;
     case 2:
     this.UserControlXY = ((System.Windows.Media.TranslateTransform)(target));
     return;
     case 3:
     this.controlBorder = ((System.Windows.Controls.Border)(target));
     return;
     case 4:
     this.Grid0 = ((System.Windows.Controls.Grid)(target));
     return;
     case 5:
     this.Grid1 = ((System.Windows.Controls.Grid)(target));
     return;
     case 6:
     this.spGates = ((GatesWpf.GateSelector)(target));
     return;
     case 7:
     this.gateCanvas = ((GatesWpf.GateCanvas)(target));
     return;
     case 8:
     this.spZoom = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 9:
     this.slZoom = ((System.Windows.Controls.Slider)(target));
     
     #line 59 "..\..\DiagramRepresentation.xaml"
     this.slZoom.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler<double>(this.slZoom_ValueChanged);
     
     #line default
     #line hidden
     return;
     case 10:
     this.btnActualSize = ((System.Windows.Controls.Button)(target));
     
     #line 62 "..\..\DiagramRepresentation.xaml"
     this.btnActualSize.Click += new System.Windows.RoutedEventHandler(this.btnActualSize_Click);
     
     #line default
     #line hidden
     return;
     case 11:
     this.btnFitToScreen = ((System.Windows.Controls.Button)(target));
     
     #line 65 "..\..\DiagramRepresentation.xaml"
     this.btnFitToScreen.Click += new System.Windows.RoutedEventHandler(this.btnFitToScreen_Click);
     
     #line default
     #line hidden
     return;
     case 12:
     this.spSpeed = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 13:
     this.slSpeed = ((System.Windows.Controls.Slider)(target));
     return;
     case 14:
     this.myToolbarTray = ((System.Windows.Controls.ToolBarTray)(target));
     return;
     case 15:
     this.tbFile = ((System.Windows.Controls.ToolBar)(target));
     return;
     case 16:
     this.btnSave = ((System.Windows.Controls.Button)(target));
     return;
     case 17:
     this.tbEdit = ((System.Windows.Controls.ToolBar)(target));
     return;
     case 18:
     this.btnCut = ((System.Windows.Controls.Button)(target));
     
     #line 93 "..\..\DiagramRepresentation.xaml"
     this.btnCut.Click += new System.Windows.RoutedEventHandler(this.btnCut_Click);
     
     #line default
     #line hidden
     return;
     case 19:
     this.btnCopy = ((System.Windows.Controls.Button)(target));
     
     #line 96 "..\..\DiagramRepresentation.xaml"
     this.btnCopy.Click += new System.Windows.RoutedEventHandler(this.btnCopy_Click);
     
     #line default
     #line hidden
     return;
     case 20:
     this.btnCopyAsImage = ((System.Windows.Controls.Button)(target));
     
     #line 99 "..\..\DiagramRepresentation.xaml"
     this.btnCopyAsImage.Click += new System.Windows.RoutedEventHandler(this.btnCopyAsImage_Click);
     
     #line default
     #line hidden
     return;
     case 21:
     this.btnPaste = ((System.Windows.Controls.Button)(target));
     
     #line 102 "..\..\DiagramRepresentation.xaml"
     this.btnPaste.Click += new System.Windows.RoutedEventHandler(this.btnPaste_Click);
     
     #line default
     #line hidden
     return;
     case 22:
     this.btnFlatten = ((System.Windows.Controls.Button)(target));
     
     #line 105 "..\..\DiagramRepresentation.xaml"
     this.btnFlatten.Click += new System.Windows.RoutedEventHandler(this.btnFlatten_Click);
     
     #line default
     #line hidden
     return;
     case 23:
     this.btnAlignTopLeft = ((System.Windows.Controls.Button)(target));
     
     #line 108 "..\..\DiagramRepresentation.xaml"
     this.btnAlignTopLeft.Click += new System.Windows.RoutedEventHandler(this.btnAlignTopLeft_Click);
     
     #line default
     #line hidden
     return;
     case 24:
     this.btnShowHideToolbars = ((System.Windows.Controls.Primitives.ToggleButton)(target));
     
     #line 111 "..\..\DiagramRepresentation.xaml"
     this.btnShowHideToolbars.Checked += new System.Windows.RoutedEventHandler(this.btnShowHideToolbars_Checked);
     
     #line default
     #line hidden
     
     #line 111 "..\..\DiagramRepresentation.xaml"
     this.btnShowHideToolbars.Unchecked += new System.Windows.RoutedEventHandler(this.btnShowHideToolbars_Unchecked);
     
     #line default
     #line hidden
     return;
     case 25:
     this.tbPrinting = ((System.Windows.Controls.ToolBar)(target));
     return;
     case 26:
     this.btnPrint = ((System.Windows.Controls.Button)(target));
     
     #line 117 "..\..\DiagramRepresentation.xaml"
     this.btnPrint.Click += new System.Windows.RoutedEventHandler(this.btnPrint_Click);
     
     #line default
     #line hidden
     return;
     case 27:
     this.btnSaveAsImage = ((System.Windows.Controls.Button)(target));
     
     #line 121 "..\..\DiagramRepresentation.xaml"
     this.btnSaveAsImage.Click += new System.Windows.RoutedEventHandler(this.btnSaveAsImage_Click);
     
     #line default
     #line hidden
     return;
     case 28:
     this.btnChart = ((System.Windows.Controls.Button)(target));
     
     #line 125 "..\..\DiagramRepresentation.xaml"
     this.btnChart.Click += new System.Windows.RoutedEventHandler(this.btnChart_Click);
     
     #line default
     #line hidden
     return;
     case 29:
     this.tbUndo = ((System.Windows.Controls.ToolBar)(target));
     return;
     case 30:
     this.btnUndo = ((System.Windows.Controls.Button)(target));
     
     #line 141 "..\..\DiagramRepresentation.xaml"
     this.btnUndo.Click += new System.Windows.RoutedEventHandler(this.btnUndo_Click);
     
     #line default
     #line hidden
     return;
     case 31:
     this.btnRedo = ((System.Windows.Controls.Button)(target));
     
     #line 144 "..\..\DiagramRepresentation.xaml"
     this.btnRedo.Click += new System.Windows.RoutedEventHandler(this.btnRedo_Click);
     
     #line default
     #line hidden
     return;
     case 32:
     this.tbIC = ((System.Windows.Controls.ToolBar)(target));
     return;
     case 33:
     
     #line 150 "..\..\DiagramRepresentation.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnCreateIC_Click);
     
     #line default
     #line hidden
     return;
     case 34:
     
     #line 153 "..\..\DiagramRepresentation.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnImportIC_Click);
     
     #line default
     #line hidden
     return;
     case 35:
     this.spAppInfo = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 36:
     this.lblAppTitle = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 37:
     this.lblAppVersion = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 38:
     this.lblAppCopyright = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 39:
     this.lblLink = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 40:
     
     #line 164 "..\..\DiagramRepresentation.xaml"
     ((System.Windows.Documents.Hyperlink)(target)).RequestNavigate += new System.Windows.Navigation.RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
     
     #line default
     #line hidden
     return;
     case 41:
     this.lblInfoLine = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 42:
     this.adornerLayer = ((System.Windows.Controls.Canvas)(target));
     return;
     case 43:
     this.controlRegion = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 44:
     this.btnCancel = ((System.Windows.Controls.Button)(target));
     return;
     case 45:
     this.btnTransform = ((System.Windows.Controls.Button)(target));
     return;
     case 46:
     this.btnScale = ((System.Windows.Controls.Button)(target));
     return;
     }
     this._contentLoaded = true;
 }
Example #10
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Grid1 = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.spGates = ((GatesWpf.GateSelector)(target));
                return;

            case 3:
                this.gateCanvas = ((GatesWpf.GateCanvas)(target));
                return;

            case 4:
                this.spZoom = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 5:
                this.slZoom = ((System.Windows.Controls.Slider)(target));

            #line 56 "..\..\Window1.xaml"
                this.slZoom.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slZoom_ValueChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.btnActualSize = ((System.Windows.Controls.Button)(target));

            #line 59 "..\..\Window1.xaml"
                this.btnActualSize.Click += new System.Windows.RoutedEventHandler(this.btnActualSize_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.btnFitToScreen = ((System.Windows.Controls.Button)(target));

            #line 62 "..\..\Window1.xaml"
                this.btnFitToScreen.Click += new System.Windows.RoutedEventHandler(this.btnFitToScreen_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.spSpeed = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 9:
                this.slSpeed = ((System.Windows.Controls.Slider)(target));
                return;

            case 10:
                this.tbFile = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 11:

            #line 76 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnNew_Click);

            #line default
            #line hidden
                return;

            case 12:

            #line 79 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnOpen_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.btnSave = ((System.Windows.Controls.Button)(target));

            #line 82 "..\..\Window1.xaml"
                this.btnSave.Click += new System.Windows.RoutedEventHandler(this.btnSave_Click);

            #line default
            #line hidden
                return;

            case 14:

            #line 85 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnSave_As_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.tbEdit = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 16:
                this.btnCut = ((System.Windows.Controls.Button)(target));

            #line 90 "..\..\Window1.xaml"
                this.btnCut.Click += new System.Windows.RoutedEventHandler(this.btnCut_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.btnCopy = ((System.Windows.Controls.Button)(target));

            #line 93 "..\..\Window1.xaml"
                this.btnCopy.Click += new System.Windows.RoutedEventHandler(this.btnCopy_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.btnCopyAsImage = ((System.Windows.Controls.Button)(target));

            #line 96 "..\..\Window1.xaml"
                this.btnCopyAsImage.Click += new System.Windows.RoutedEventHandler(this.btnCopyAsImage_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.btnPaste = ((System.Windows.Controls.Button)(target));

            #line 99 "..\..\Window1.xaml"
                this.btnPaste.Click += new System.Windows.RoutedEventHandler(this.btnPaste_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.btnFlatten = ((System.Windows.Controls.Button)(target));

            #line 102 "..\..\Window1.xaml"
                this.btnFlatten.Click += new System.Windows.RoutedEventHandler(this.btnFlatten_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.btnAlignTopLeft = ((System.Windows.Controls.Button)(target));

            #line 105 "..\..\Window1.xaml"
                this.btnAlignTopLeft.Click += new System.Windows.RoutedEventHandler(this.btnAlignTopLeft_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.tbPrinting = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 23:
                this.btnPrint = ((System.Windows.Controls.Button)(target));

            #line 112 "..\..\Window1.xaml"
                this.btnPrint.Click += new System.Windows.RoutedEventHandler(this.btnPrint_Click);

            #line default
            #line hidden
                return;

            case 24:
                this.btnSaveAsImage = ((System.Windows.Controls.Button)(target));

            #line 116 "..\..\Window1.xaml"
                this.btnSaveAsImage.Click += new System.Windows.RoutedEventHandler(this.btnSaveAsImage_Click);

            #line default
            #line hidden
                return;

            case 25:
                this.btnChart = ((System.Windows.Controls.Button)(target));

            #line 120 "..\..\Window1.xaml"
                this.btnChart.Click += new System.Windows.RoutedEventHandler(this.btnChart_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.tbUndo = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 27:
                this.btnUndo = ((System.Windows.Controls.Button)(target));

            #line 135 "..\..\Window1.xaml"
                this.btnUndo.Click += new System.Windows.RoutedEventHandler(this.btnUndo_Click);

            #line default
            #line hidden
                return;

            case 28:
                this.btnRedo = ((System.Windows.Controls.Button)(target));

            #line 138 "..\..\Window1.xaml"
                this.btnRedo.Click += new System.Windows.RoutedEventHandler(this.btnRedo_Click);

            #line default
            #line hidden
                return;

            case 29:
                this.tbIC = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 30:

            #line 144 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnCreateIC_Click);

            #line default
            #line hidden
                return;

            case 31:

            #line 145 "..\..\Window1.xaml"
                ((System.Windows.Controls.Image)(target)).MouseEnter += new System.Windows.Input.MouseEventHandler(this.Image_MouseEnter);

            #line default
            #line hidden

            #line 145 "..\..\Window1.xaml"
                ((System.Windows.Controls.Image)(target)).MouseLeave += new System.Windows.Input.MouseEventHandler(this.Image_MouseLeave);

            #line default
            #line hidden
                return;

            case 32:

            #line 147 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnImportIC_Click);

            #line default
            #line hidden
                return;

            case 33:
                this.tbVis = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 34:
                this.btnShowHideToolbars = ((System.Windows.Controls.Primitives.ToggleButton)(target));

            #line 154 "..\..\Window1.xaml"
                this.btnShowHideToolbars.Checked += new System.Windows.RoutedEventHandler(this.btnShowHideToolbars_Checked);

            #line default
            #line hidden

            #line 154 "..\..\Window1.xaml"
                this.btnShowHideToolbars.Unchecked += new System.Windows.RoutedEventHandler(this.btnShowHideToolbars_Unchecked);

            #line default
            #line hidden
                return;

            case 35:
                this.btnShowTrueFalse = ((System.Windows.Controls.Primitives.ToggleButton)(target));

            #line 157 "..\..\Window1.xaml"
                this.btnShowTrueFalse.Checked += new System.Windows.RoutedEventHandler(this.btnShowTrueFalse_Checked);

            #line default
            #line hidden

            #line 157 "..\..\Window1.xaml"
                this.btnShowTrueFalse.Unchecked += new System.Windows.RoutedEventHandler(this.btnShowTrueFalse_Unchecked);

            #line default
            #line hidden
                return;

            case 36:
                this.btnUserMode = ((System.Windows.Controls.Primitives.ToggleButton)(target));

            #line 164 "..\..\Window1.xaml"
                this.btnUserMode.Checked += new System.Windows.RoutedEventHandler(this.btnUserMode_Checked);

            #line default
            #line hidden

            #line 164 "..\..\Window1.xaml"
                this.btnUserMode.Unchecked += new System.Windows.RoutedEventHandler(this.btnUserMode_Unchecked);

            #line default
            #line hidden
                return;

            case 37:
                this.spAppInfo = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 38:
                this.lblAppTitle = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 39:
                this.lblAppVersion = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 40:
                this.lblAppCopyright = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 41:
                this.lblLink = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 42:

            #line 176 "..\..\Window1.xaml"
                ((System.Windows.Documents.Hyperlink)(target)).RequestNavigate += new System.Windows.Navigation.RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);

            #line default
            #line hidden
                return;

            case 43:
                this.lblInfoLine = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 44:
                this.adornerLayer = ((System.Windows.Controls.Canvas)(target));
                return;
            }
            this._contentLoaded = true;
        }