public void SelectTerminal()
 {
     // create brand new window
     chooser         = new ConnectToTerminal();
     chooser.Closed += ChooserClosed;
     chooser.ShowDialog();
 }
        public void ChooserClosed(object sender, System.EventArgs e)
        {
            chooser = null;

            // sync the terminal if possible
            if (Settings.Default.FirstAccess)
            {
                SyncTerminal(true);
            }
            else
            {
                SyncTerminal(true);
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            chooser = null;
            currentTerminalField = null;
            items = null;

            // todo: temp debug solution

            /*Debug.WriteLine("Setting up file debug");
             * TextWriterTraceListener myWriter = new
             *  TextWriterTraceListener(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "HicapsConnect" + Path.DirectorySeparatorChar + "debug.txt");
             * myWriter.Flush();
             * Debug.Listeners.Add(myWriter);
             * Debug.WriteLine("sup");
             * Debug.WriteLine("Set up file debug");*/
        }