Esempio n. 1
0
 public void MountRepository(GinRepository repo)
 {
     if (!repo.Mounted)
     {
         var thread = new Thread(repo.Mount);
         thread.Start();
     }
 }
Esempio n. 2
0
        public void DeleteRepository(GinRepository repo)
        {
            lock (this)
            {
                UnmountRepository(repo);
                repo.DeleteRepository();

                Repositories.Remove(repo);
            }
        }
Esempio n. 3
0
 /// <summary>
 ///     Mount a repository
 /// </summary>
 /// <param name="repo"></param>
 public void MountRepository(GinRepository repo)
 {
     if (!repo.Mounted)
     {
         //The Dokan Mount() function, as of Version 1.2, is a blocking operation that does not return
         //as long as the file path remains mounted.
         var thread = new Thread(repo.Mount);
         thread.Start();
     }
 }
Esempio n. 4
0
 private void OnFileRetrievalStarted(DokanInterface.FileOperationEventArgs e, GinRepository sender)
 {
     if (!string.Equals(e.File, "."))
     {
         AppIcon.ShowBalloonTip(1000, "GIN activity in progress", "Repository " + sender.Name + " operating on " + e.File, ToolTipIcon.Info);
     }
     else
     {
         AppIcon.ShowBalloonTip(1000, "GIN activity in progress", "Repository " + sender.Name + " operating on all files.", ToolTipIcon.Info);
     }
 }
Esempio n. 5
0
        public bool UpdateRepository(string repoName, GinRepositoryData data)
        {
            lock (this)
            {
                var repo = Repositories.Single(r => CompareOrdinal(r.Name, repoName) == 0);
                UnmountRepository(repo);
                Repositories.Remove(repo);
                repo = new GinRepository(data);
                Repositories.Add(repo);
                MountRepository(repo);

                return(true);
            }
        }
Esempio n. 6
0
        public void AddRepository(DirectoryInfo physicalDirectory, DirectoryInfo mountpoint, string name, string commandline, bool performFullCheckout, bool createNew)
        {
            var repo = new GinRepository(
                physicalDirectory,
                mountpoint,
                name,
                commandline, createNew);

            repo.FileOperationStarted   += Repo_FileOperationStarted;
            repo.FileOperationCompleted += Repo_FileOperationCompleted;
            repo.FileOperationProgress  += Repo_FileOperationProgress;
            repo.FileOperationError     += RepoOnFileOperationError;
            repo.CreateDirectories(performFullCheckout);
            MountRepository(repo);
            repo.Initialize();

            Repositories.Add(repo);
        }
Esempio n. 7
0
 private void OnRepositoryOperationError(GinRepository sender,
                                         GinRepository.FileOperationErrorEventArgs message)
 {
     RepositoryOperationError?.Invoke(sender, message);
 }
Esempio n. 8
0
 private void OnFileRetrievalCompleted(DokanInterface.FileOperationEventArgs e, GinRepository sender)
 {
     FileRetrievalCompleted?.Invoke(this, sender, e.File, e.Success);
 }
Esempio n. 9
0
 private void OnFileRetrievalStarted(DokanInterface.FileOperationEventArgs e, GinRepository sender)
 {
     FileRetrievalStarted?.Invoke(this, sender, e.File);
 }
Esempio n. 10
0
 public void UnmountRepository(GinRepository repo)
 {
     Dokan.RemoveMountPoint(repo.Mountpoint.FullName.Trim('\\'));
     repo.Mounted = false;
 }
Esempio n. 11
0
 public string GetRepositoryFileInfo(GinRepository ginRepository)
 {
     return(ginRepository.GetStatusCacheJson());
 }
Esempio n. 12
0
 private void OnRepositoryOperationError(GinRepository sender,
                                         GinRepository.FileOperationErrorEventArgs message)
 {
     MessageBox.Show(ginError + message.Message, "GIN Service Error",
                     MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
Esempio n. 13
0
 private void OnFileRetrievalCompleted(DokanInterface.FileOperationEventArgs e, GinRepository sender)
 {
     FileRetrievalCompleted?.Invoke(this, sender, e.File, e.Success);
     try
     {
         AppIcon.Text = "";
         AppIcon.ShowBalloonTip(1500, "GIN activity done", "Repository " + sender.Name + " work finished.", ToolTipIcon.Info);
     }
     catch
     {
     }
 }