Beispiel #1
0
        public static int CompareByDoneRatio(IssueListItem item1, IssueListItem item2)
        {
            var data1 = item1.DataContext.DoneRatio;
            var data2 = item2.DataContext.DoneRatio;

            return(data1.CompareTo(data2));
        }
Beispiel #2
0
        public static int CompareByCreatedOn(IssueListItem item1, IssueListItem item2)
        {
            var data1 = item1.DataContext.CreatedOn;
            var data2 = item2.DataContext.CreatedOn;

            return(data1.CompareTo(data2));
        }
Beispiel #3
0
        public static int CompareById(IssueListItem item1, IssueListItem item2)
        {
            var data1 = item1.DataContext.Id;
            var data2 = item2.DataContext.Id;

            return(data1.CompareTo(data2));
        }
Beispiel #4
0
        public static int CompareBySubject(IssueListItem item1, IssueListItem item2)
        {
            var data1 = item1.DataContext.Subject;
            var data2 = item2.DataContext.Subject;

            if (data1 == data2)
            {
                return(0);
            }
            if (data1 == null)
            {
                return(1);
            }
            else if (data2 == null)
            {
                return(-1);
            }
            return(string.Compare(data1, data2));
        }
Beispiel #5
0
        public static int CompareByAuthor(IssueListItem item1, IssueListItem item2)
        {
            var data1 = item1.DataContext.Author;
            var data2 = item2.DataContext.Author;

            if (data1 == data2)
            {
                return(0);
            }
            if (data1 == null)
            {
                return(1);
            }
            else if (data2 == null)
            {
                return(-1);
            }
            return(string.Compare(data1.Name, data2.Name));
        }
Beispiel #6
0
        public static int CompareByPriority(IssueListItem item1, IssueListItem item2)
        {
            var data1 = item1.DataContext.Priority;
            var data2 = item2.DataContext.Priority;

            if (data1 == data2)
            {
                return(0);
            }
            if (data1 == null)
            {
                return(1);
            }
            else if (data2 == null)
            {
                return(-1);
            }
            return(data1.Id.CompareTo(data2.Id));
        }
Beispiel #7
0
        public static int CompareByDueDate(IssueListItem item1, IssueListItem item2)
        {
            var data1 = item1.DataContext.DueDate;
            var data2 = item2.DataContext.DueDate;

            if (!data1.HasValue && !data2.HasValue)
            {
                return(0);
            }
            if (!data1.HasValue)
            {
                return(1);
            }
            else if (!data2.HasValue)
            {
                return(-1);
            }
            return(data1.Value.CompareTo(data2.Value));
        }
        private int Compare(IssueListItem item1, IssueListItem item2)
        {
            var data1 = item1.DataContext.CustomFields[_field];
            var data2 = item2.DataContext.CustomFields[_field];

            if (data1 == data2)
            {
                return(0);
            }
            if (data1 == null)
            {
                return(1);
            }
            else if (data2 == null)
            {
                return(-1);
            }
            return(string.Compare(data1, data2));
        }
Beispiel #9
0
        private bool TestItem(IssueListItem item, IssuesSearchOptions search)
        {
            var issue = item.DataContext;

            if (issue.Subject.Contains(search.Text))
            {
                return(true);
            }
            int id;

            if (int.TryParse(search.Text, NumberStyles.Integer, CultureInfo.InvariantCulture, out id))
            {
                if (issue.Id == id)
                {
                    return(true);
                }
            }
            return(false);
        }