public static Label ToLabel(this Octokit.Label label)
 {
     return(new Label
     {
         Name = label.Name,
         Description = label.Description,
         Color = label.Color
     });
 }
 public EventInfo(int id, Uri url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt)
 {
     Id = id;
     Url = url;
     Actor = actor;
     Assignee = assignee;
     Label = label;
     Event = @event;
     CommitId = commitId;
     CreatedAt = createdAt;
 }
 public IssueEvent(int id, Uri url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, Uri commitUrl)
 {
     Id = id;
     Url = url;
     Actor = actor;
     Assignee = assignee;
     Label = label;
     Event = @event;
     CommitId = commitId;
     CreatedAt = createdAt;
     Issue = issue;
     CommitUrl = commitUrl;
 }
 public TimelineEventInfo(int id, string url, User actor, string commitId, EventInfoState @event, DateTimeOffset createdAt, Label label, User assignee, Milestone milestone, SourceInfo source, RenameInfo rename)
 {
     Id = id;
     Url = url;
     Actor = actor;
     CommitId = commitId;
     Event = @event;
     CreatedAt = createdAt;
     Label = label;
     Assignee = assignee;
     Milestone = milestone;
     Source = source;
     Rename = rename;
 }
        protected GitHubApiBase(ICache settingsCache)
        {
            if (settingsCache == null)
                throw new ArgumentNullException("settingsCache");

            _userFilterType = UserFilterType.All;
            UserFilters = new List<UserFilterType>();
            foreach (UserFilterType value in Enum.GetValues(typeof(UserFilterType)))
            {
                UserFilters.Add(value);
            }

            _allLabels = new Label(null, "All Labels", "FFFFFFFF");
            AllMilestones = new Milestone(null, 0, ItemState.All, "All Milestones", "", null, 0, 0, DateTimeOffset.UtcNow, null);
            NoMilestone = new Milestone(null, -1, ItemState.All, "No Milestone", "", null, 0, 0, DateTimeOffset.UtcNow, null);

            SettingsCache = settingsCache;
            Repositories = new BindingList<RepositoryWrapper>();
            Organizations = new BindingList<Organization>();
            AllIssues = new BindingList<Issue>();
            Labels = new BindingList<Label>();
            Milestones = new BindingList<Milestone>();
        }
 public override void GetLabels()
 {
     var label = new Label(null, "Bug", "FF0000");
     Label = label;
     Labels.Add(label);
 }
        public void SetUp()
        {
            var cache = new Mock<ICache>().Object;
            _moq = new Mock<GitHubApiBase>(cache);
            _api = _moq.Object;

            _label = new Label(null, "One", "");

            _milestone = new Milestone(null, 1, ItemState.All, "1.0", "", null, 1, 1, DateTimeOffset.Now, null, null);

            _issue = new Issue(null, null, null, 1, ItemState.Open, "Title one", "Body one", null, new List<Label>(new[] {_label}),
                null, _milestone, 1, null, null, DateTimeOffset.Now, null);
            _api.AllIssues.Add(_issue);

            var issue2 = new Issue(null, null, null, 2, ItemState.Open, "Two", "Two", null, new List<Label>(),
                null, new Milestone(null, 2, ItemState.All, "2.0", "", null, 1, 1, DateTimeOffset.Now, null, null), 1, null, null, DateTimeOffset.Now, null);
            _api.AllIssues.Add(issue2);

            var issue3 = new Issue(null, null, null, 3, ItemState.Open, "Three", "Three", null, new List<Label>(),
                null, null, 1, null, null, DateTimeOffset.Now, null);
            _api.AllIssues.Add(issue3);
        }
Exemple #8
0
 public Label(Octokit.Label label) : base(label.Name, label.Description)
 {
     Color = label.Color;
 }
Exemple #9
0
 public TimelineEventInfo(int id, string url, User actor, string commitId, EventInfoState @event, DateTimeOffset createdAt, Label label, User assignee, Milestone milestone, SourceInfo source, RenameInfo rename)
 {
     Id        = id;
     Url       = url;
     Actor     = actor;
     CommitId  = commitId;
     Event     = @event;
     CreatedAt = createdAt;
     Label     = label;
     Assignee  = assignee;
     Milestone = milestone;
     Source    = source;
     Rename    = rename;
 }
 /// <summary>
 /// Labels don't override Equals, so we need to find the ones in
 /// the main collection and add them so that reference equals works
 /// for binding
 /// </summary>
 /// <param name="label"></param>
 private void AddLabel(Label label)
 {
     var labels = from l in Labels
                  where l.Url == label.Url
                  select l;
     labels.ToList().ForEach(l => l.Checked = true);
 }
 public LabelModel(Label label)
 {
     _checked = false;
     _label = label;
 }