private void PullRepoTask(ISourceRepository repo) { var previousStatus = repo.LastStatus; repo.Update(true); var eventArgs = new RepositoryEventArgs(repo.Location, previousStatus, repo.LastStatus, repo.Name, RepositoryEventType.Updated); OnRepositoryUpdated(eventArgs); //if (previousStatus != repo.LastStatus) // OnRepositoryStatusChanged(eventArgs); }
/// <summary> /// Checks if a repo needs to update, and if so starts the update and triggers an event when finished /// </summary> private void CheckRepo(ISourceRepository repo) { if (repo.LastStatusAt.AddMinutes((int)repo.UpdateSchedule) >= DateTime.Now) { return; } var previousStatus = repo.LastStatus; repo.RefreshRemoteStatus(); var eventArgs = new RepositoryEventArgs(repo.Location, previousStatus, repo.LastStatus, repo.Name, RepositoryEventType.Updated); OnRepositoryUpdated(eventArgs); //if(previousStatus != repo.LastStatus) OnRepositoryStatusChanged(eventArgs); }
/// <summary> Overridable event logic </summary> protected virtual void OnRepositoryListChanged(RepositoryEventArgs e) { RepositoryListChanged?.Invoke(this, e); }
/// <summary> Overridable event logic </summary> protected virtual void OnRepositoryUpdated(RepositoryEventArgs e) { RepositoryUpdated?.Invoke(this, e); }
/// <summary> /// Forwards the event to any listeners of this object /// </summary> private void OnRepoChangedEventPropagator(object sender, RepositoryEventArgs args) { OnRepositoryStatusChanged(args); }