private void MaybeUpdateData() { if (currentBranchAndRemoteChangeHasUpdate) { currentBranch = Repository.CurrentBranch ?? GitBranch.Default; currentRemote = Repository.CurrentRemote ?? GitRemote.Default; } if (localAndRemoteBranchListHasUpdate) { localBranches = Repository.LocalBranches.ToList(); remoteBranches = Repository.RemoteBranches.ToList(); } if (currentBranchAndRemoteChangeHasUpdate || localAndRemoteBranchListHasUpdate) { currentBranchAndRemoteChangeHasUpdate = false; localAndRemoteBranchListHasUpdate = false; BuildTree(); } disableDelete = treeLocals.SelectedNode == null || treeLocals.SelectedNode.IsFolder || treeLocals.SelectedNode.IsActive; disableCreate = treeLocals.SelectedNode == null || treeLocals.SelectedNode.IsFolder || treeLocals.SelectedNode.Level == 0; }
public void UpdateData(IRepositoryInfoCacheData data) { var now = DateTimeOffset.Now; var isUpdated = false; if (!Nullable.Equals(currentGitRemote, data.CurrentGitRemote)) { currentGitRemote = data.CurrentGitRemote ?? GitRemote.Default; isUpdated = true; } if (!Nullable.Equals(currentGitBranch, data.CurrentGitBranch)) { currentGitBranch = data.CurrentGitBranch ?? GitBranch.Default; isUpdated = true; } if (!Nullable.Equals(currentConfigRemote, data.CurrentConfigRemote)) { currentConfigRemote = data.CurrentConfigRemote ?? ConfigRemote.Default; isUpdated = true; } if (!Nullable.Equals(currentConfigBranch, data.CurrentConfigBranch)) { currentConfigBranch = data.CurrentConfigBranch ?? ConfigBranch.Default; isUpdated = true; } SaveData(now, isUpdated); }
public bool Equals(GitRemote other) { return (String.Equals(name, other.name) && String.Equals(url, other.url) && String.Equals(login, other.login) && String.Equals(user, other.user) && String.Equals(host, other.host) && function == other.function && String.Equals(token, other.token) ); }