public MainForm()
 {
     InitializeComponent();     
     initializeTimer();
     treeViewItems.ExpandAll();
     circuitManager = new CircuitManager();
     canvas = new Canvas(panelCanvas, this);
     toolPan.CheckedChanged += toolPan_CheckedChanged;
     refresh();
 }
        /// <summary>
        /// Event handler for clicking the new document button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolNewDocument_Click(object sender, EventArgs e)
        {
            if (unsavedChangesMade)
            {
                if (!promptSave())
                {
                    return;
                }
            }

            circuitManager = new CircuitManager();
            unsavedChangesMade = false;
            lastFilePath = null;
            newCanvas();
            refresh();
        }
 private void initializeCircuitManager()
 {
     circuitManager = new CircuitManager(circuit);
 }