public abstract Lock ( IProgressMonitor monitor, string comment, bool stealLock ) : void | ||
monitor | IProgressMonitor | |
comment | string | |
stealLock | bool | |
return | void |
public override bool RequestFileWritePermission(FilePath path) { if (!File.Exists(path)) { return(true); } if ((File.GetAttributes(path) & FileAttributes.ReadOnly) == 0) { return(true); } AlertButton but = new AlertButton("Lock File"); if (!MessageService.Confirm(GettextCatalog.GetString("File locking required"), GettextCatalog.GetString("The file '{0}' must be locked before editing.", path), but)) { return(false); } try { Svn.Lock(null, "", false, path); } catch (SubversionException ex) { MessageService.ShowError(GettextCatalog.GetString("The file '{0}' could not be unlocked", path), ex.Message); return(false); } VersionControlService.NotifyFileStatusChanged(new FileUpdateEventArgs(this, path, false)); return(true); }
public override bool RequestFileWritePermission(params FilePath [] paths) { var toLock = new List <FilePath>(); foreach (var path in paths) { if (!File.Exists(path)) { continue; } if (!TryGetVersionInfo(path, out var info)) { continue; } if (!info.IsVersioned || !Svn.HasNeedLock(path) || (File.GetAttributes(path) & FileAttributes.ReadOnly) == 0) { continue; } toLock.Add(path); } if (toLock.Count == 0) { return(true); } AlertButton but = new AlertButton(GettextCatalog.GetString("Lock File")); if (!MessageService.Confirm(GettextCatalog.GetString("The following files must be locked before editing."), String.Join("\n", toLock.Select(u => u.ToString())), but)) { return(false); } try { Svn.Lock(null, "", false, toLock.ToArray()); } catch (SubversionException ex) { MessageService.ShowError(GettextCatalog.GetString("File could not be unlocked."), ex.Message); return(false); } VersionControlService.NotifyFileStatusChanged(new FileUpdateEventArgs(this, toLock.ToArray())); return(true); }