/// <summary> /// Change the name of a file /// </summary> /// <param name="old"></param> /// <param name="snew"></param> public void ChangeName(string old, string snew) { if (_statusCache.Map.ContainsKey(old)) { if (_statusCache.Map.TryGetValue(old, out var itemOfChoice)) { if (itemOfChoice.Status.LocalNodeStatus == SvnStatus.NotVersioned) { Remove(old); RemoveItemFromProjectEvent?.Invoke(itemOfChoice, new EventArgs()); AddToCache(snew); } else if (itemOfChoice.Status.LocalNodeStatus == SvnStatus.Added) { UpdateCache(); Remove(old); RemoveItemFromProjectEvent?.Invoke(itemOfChoice, new EventArgs()); } else if (itemOfChoice.Status.LocalNodeStatus == SvnStatus.Normal) { UpdateCache(); } } } }
/// <summary> /// Remove item from status cache and viewer /// </summary> public void Remove(string filePath) { if (_statusCache.Map.ContainsKey(filePath)) { if (_statusCache.Map.TryGetValue(filePath, out var itemOfChoice)) { RemoveItemFromProjectEvent?.Invoke(itemOfChoice, new EventArgs()); _statusCache.Map.Remove(filePath); } } }