public bool AddTransaction(T type, long value) { if (value == 0) { return(true); } if (!_repository.ContainsKey(type)) { if (value < 0) { return(false); } RegisterType(type); } var result = _repository[type] + value; if (result < 0) { return(false); } _repository[type] = result; OnRepositoryChanged?.Invoke(this, null); return(true); }
public void Reset() { OnIsBusy.Reset(); OnIsNotBusy.Reset(); OnRepositoryChanged.Reset(); OnActiveBranchChanged.Reset(); OnActiveRemoteChanged.Reset(); OnHeadChanged.Reset(); OnLocalBranchListChanged.Reset(); OnRemoteBranchListChanged.Reset(); OnRemoteOrTrackingChanged.Reset(); OnLocksUpdated.Reset(); }
private void OnRepositoryUpdatedHandler() { Logger.Trace("Starting OnRepositoryUpdatedHandler"); var task = GitClient.Status() .Finally((success, ex, data) => { if (success && data.HasValue) { OnRepositoryChanged?.Invoke(data.Value); } Logger.Trace("Ending OnRepositoryUpdatedHandler"); }); HookupHandlers(task).Start(); }
private void RepositoryManager_OnRepositoryChanged(GitStatus status) { CurrentStatus = status; //Logger.Debug("Got STATUS 2 {0} {1}", OnRepositoryChanged, status); OnRepositoryChanged?.Invoke(CurrentStatus); }