コード例 #1
0
        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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
 /// <summary> Overridable event logic </summary>
 protected virtual void OnRepositoryListChanged(RepositoryEventArgs e)
 {
     RepositoryListChanged?.Invoke(this, e);
 }
コード例 #4
0
 /// <summary> Overridable event logic </summary>
 protected virtual void OnRepositoryUpdated(RepositoryEventArgs e)
 {
     RepositoryUpdated?.Invoke(this, e);
 }
コード例 #5
0
 /// <summary>
 /// Forwards the event to any listeners of this object
 /// </summary>
 private void OnRepoChangedEventPropagator(object sender, RepositoryEventArgs args)
 {
     OnRepositoryStatusChanged(args);
 }