Ejemplo n.º 1
0
 public static Label ToLabel(this Octokit.Label label)
 {
     return(new Label
     {
         Name = label.Name,
         Description = label.Description,
         Color = label.Color
     });
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
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;
 }
        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);
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 public Label(Octokit.Label label) : base(label.Name, label.Description)
 {
     Color = label.Color;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 11
0
 public LabelModel(Label label)
 {
     _checked = false;
     _label = label;
 }