Exemple #1
0
        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();
        }
Exemple #2
0
        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;
        }
Exemple #3
0
        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();
        }