Пример #1
0
        private void groupLayoutPanel_DragDrop(object sender, DragEventArgs e)
        {
            var fileNameArray = e.Data.GetData(DataFormats.FileDrop) as string[];

            if (fileNameArray != null)
            {
                if (fileNameArray.Length != 1)
                {
                    return;
                }

                string dir = fileNameArray[0];
                if (!string.IsNullOrEmpty(dir) && Directory.Exists(dir))
                {
                    OpenPath(dir);
                }
                return;
            }
            var text = e.Data.GetData(DataFormats.UnicodeText) as string;

            if (!string.IsNullOrEmpty(text))
            {
                var lines = text.Split('\n');
                if (lines.Length != 1)
                {
                    return;
                }
                string url = lines[0];
                if (!string.IsNullOrEmpty(url))
                {
                    UICommands.StartCloneDialog(this, url, false, OnModuleChanged);
                }
            }
        }
Пример #2
0
        private void groupLayoutPanel_DragDrop(object sender, DragEventArgs e)
        {
            var fileNameArray = e.Data.GetData(DataFormats.FileDrop) as string[];

            if (fileNameArray != null)
            {
                if (fileNameArray.Length != 1)
                {
                    return;
                }

                string dir = fileNameArray[0];
                if (!string.IsNullOrEmpty(dir) && Directory.Exists(dir))
                {
                    GitModule module = new GitModule(dir);

                    if (!module.IsValidGitWorkingDir())
                    {
                        DialogResult dialogResult = MessageBox.Show(this, _directoryIsNotAValidRepositoryOpenIt.Text,
                                                                    _directoryIsNotAValidRepositoryCaption.Text, MessageBoxButtons.YesNo,
                                                                    MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2);
                        if (dialogResult == DialogResult.No)
                        {
                            return;
                        }
                    }

                    Repositories.AddMostRecentRepository(module.WorkingDir);
                    OnModuleChanged(this, new GitModuleEventArgs(module));
                }

                return;
            }

            var text = e.Data.GetData(DataFormats.UnicodeText) as string;

            if (!string.IsNullOrEmpty(text))
            {
                var lines = text.Split('\n');
                if (lines.Length != 1)
                {
                    return;
                }

                string url = lines[0];
                if (!string.IsNullOrEmpty(url))
                {
                    UICommands.StartCloneDialog(this, url, false, OnModuleChanged);
                }
            }
        }
Пример #3
0
 private void cloneItem_Click(object sender, EventArgs e)
 {
     UICommands.StartCloneDialog(this, null, false, OnModuleChanged);
 }