public void OpenFile(FileItem file) { string path = null; // if temp and changes exist (then remote) if (file.Temp) { // remote file that doesnt exist local yet if (file.Changes.Count > 0) { foreach (ulong id in file.Changes.Keys) if (file.Changes[id] == file.Details) path = UnlockFile(file); } // local temp file else path = Storages.GetRootPath(UserID, ProjectID) + file.GetPath(); } // non temp file else path = UnlockFile(file); if (path != null && File.Exists(path)) Process.Start(path); file.UpdateInterface(); FileListView.Invalidate(); }
public string UnlockFile(FileItem file) { List<LockError> errors = new List<LockError>(); string path = Storages.UnlockFile(UserID, ProjectID, file.Folder.GetPath(), (StorageFile)file.Details, false, errors); LockMessage.Alert(this, errors); file.UpdateInterface(); SelectedInfo.RefreshItem(); return path; }
public void LockFile(FileItem file) { List<LockError> errors = new List<LockError>(); Storages.LockFileCompletely(UserID, ProjectID, file.Folder.GetPath(), file.Archived, errors); LockMessage.Alert(this, errors); file.UpdateInterface(); SelectedInfo.RefreshItem(); }