예제 #1
0
        /// <summary>
        /// Opens the edit window for the selected route
        /// </summary>
        public void editItem()
        {
            if (isTransfering)
            {
                ErrorWindow errorWindow = new ErrorWindow(this, "transfer in progress", "Cannot add or edit routes while a transfer is in progress");
                errorWindow.ShowDialog();
                return;
            }

            int index = routeNameList.SelectedIndex;

            if (index < 0)
            {
                return;
            }

            EditWindow editWindow = new EditWindow(this, index);

            editWindow.StartPosition = FormStartPosition.CenterParent;
            editWindow.ShowDialog(this);
        }
예제 #2
0
        private void destinationLabel_Click(object sender, EventArgs e)
        {
            int index = routeNameList.SelectedIndex;

            if (index < 0)
            {
                return;
            }

            Route route = routeData.routes.ElementAt(index);

            if (!Directory.Exists(route.destinationFolder))
            {
                ErrorWindow errorWindow = new ErrorWindow(this, "Directory missing", "The destination directory for " + route.name + " cannot be found");
                errorWindow.ShowDialog();
            }

            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo()
            {
                FileName        = route.destinationFolder,
                UseShellExecute = true,
                Verb            = "open"
            });
        }