Esempio n. 1
0
        public void WorkingFolderHandler(object sender, EventArgs e)
        {
            WorkingFolderDialog dialog = new WorkingFolderDialog(currentWorkspace, currentPath);

            int rc = dialog.Run();

            if (dialog.Run() == (int)ResponseType.Ok)
            {
                List <WorkingFolder> folders = new List <WorkingFolder>();
                bool found = false;

                foreach (WorkingFolder folder in currentWorkspace.Folders)
                {
                    if (folder.ServerItem != dialog.ServerPath)
                    {
                        folders.Add(folder);
                        continue;
                    }

                    folders.Add(new WorkingFolder(folder.ServerItem, dialog.LocalPath));
                    found = true;
                }

                if (!found)
                {
                    folders.Add(new WorkingFolder(dialog.ServerPath, dialog.LocalPath));
                }

                currentWorkspace.Update(currentWorkspace.Name, currentWorkspace.Comment,
                                        folders.ToArray());
            }
            else if (rc == (int)ResponseType.Reject)
            {
                List <WorkingFolder> folders = new List <WorkingFolder>();

                foreach (WorkingFolder folder in currentWorkspace.Folders)
                {
                    if (folder.ServerItem == dialog.ServerPath)
                    {
                        continue;
                    }
                    folders.Add(folder);
                }

                currentWorkspace.Update(currentWorkspace.Name, currentWorkspace.Comment,
                                        folders.ToArray());
            }

            dialog.Destroy();
        }
Esempio n. 2
0
        public void WorkingFolderHandler(object sender, EventArgs e)
        {
            WorkingFolderDialog dialog = new WorkingFolderDialog(currentWorkspace, currentPath);

            int rc = dialog.Run();
            if (dialog.Run() == (int)ResponseType.Ok)
            {
                List<WorkingFolder> folders = new List<WorkingFolder>();
                bool found = false;

                foreach (WorkingFolder folder in currentWorkspace.Folders)
                    {
                        if (folder.ServerItem != dialog.ServerPath)
                            {
                                folders.Add(folder);
                                continue;
                            }

                        folders.Add(new WorkingFolder(folder.ServerItem, dialog.LocalPath));
                        found = true;
                    }

                if (!found)
                    folders.Add(new WorkingFolder(dialog.ServerPath, dialog.LocalPath));

                currentWorkspace.Update(currentWorkspace.Name, currentWorkspace.Comment,
                                                                folders.ToArray());
            }
            else if (rc == (int)ResponseType.Reject)
            {
                List<WorkingFolder> folders = new List<WorkingFolder>();

                foreach (WorkingFolder folder in currentWorkspace.Folders)
                    {
                        if (folder.ServerItem == dialog.ServerPath) continue;
                        folders.Add(folder);
                    }

                currentWorkspace.Update(currentWorkspace.Name, currentWorkspace.Comment,
                                                                folders.ToArray());
            }

            dialog.Destroy();
        }