示例#1
0
        /// <summary>
        /// Change the position of an issue within the readlist, shifting surrounding issues automatically
        /// </summary>
        /// <param name="index">Issue to move</param>
        /// <param name="pos">New position</param>
        public void setPosition(int index, int pos)
        {
            ReadlistIssue readlistIssue = (ReadlistIssue)Issues[index];

            for (int i = 0; i < Issues.Count; i++)
            {
                if (i != index)
                {
                    ReadlistIssue readlistIssue2 = (ReadlistIssue)Issues[i];
                    if (readlistIssue2.Position < readlistIssue.Position)
                    {
                        if (readlistIssue2.Position >= pos && pos < readlistIssue.Position)
                        {
                            readlistIssue2.Position++;
                        }
                    }
                    else if (readlistIssue2.Position > readlistIssue.Position && readlistIssue2.Position <= pos && pos > readlistIssue.Position)
                    {
                        readlistIssue2.Position--;
                    }
                }
            }
            readlistIssue.Position = pos;
            Changes.Add("Issues");
        }
示例#2
0
        public void DeleteIssue(int index)
        {
            ReadlistIssue readlistIssue = (ReadlistIssue)Issues[index];

            CC.SQL.ExecQuery("DELETE FROM readlist_issues WHERE id=" + readlistIssue.RowID);
            DeleteQueue.Add(readlistIssue);
            correctPositions();
            SaveChanges();
        }
示例#3
0
        public new int CompareTo(object o)
        {
            ReadlistIssue readlistIssue = (ReadlistIssue)o;

            return(Position.CompareTo(readlistIssue.Position));
        }