Esempio n. 1
0
        public void BeginGetIncomingChanges(ExtendedRepository repository, Action <ExtendedRepository, Exception> callback)
        {
            ExtendedRepository result    = null;
            Exception          exception = null;

            try
            {
                //Get incoming changesets
                IPlugin rcsPlugin = _pluginService.Plugins[repository.Type];
                result = RepositoryExtensionHelper.GetExtendedRepository(rcsPlugin.GetIncomingChanges(RepositoryExtensionHelper.GetRepository(repository)));

                //Get Gravatars
                foreach (ExtendedChangeset changeset in result.IncomingChangesets)
                {
                    string author = changeset.AuthorEmail;
                    if (_gravatars.ContainsKey(author))
                    {
                        changeset.Gravatar = _gravatars[author];
                    }
                    else
                    {
                        BitmapImage gravatar = GravatarHelper.GetBitmapImage(author, rating: GravatarRating.X);
                        if (null != gravatar)
                        {
                            _gravatars.Add(author, gravatar);
                            changeset.Gravatar = gravatar;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            finally
            {
                //Return data
                callback(result, exception);
            }
        }