Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
QuestionSorting Arraylists Twice Pin
jgallen2319-Sep-05 5:30
jgallen2319-Sep-05 5:30 
I have a class called tasks and right now it uses compareto to sort by duedate when it is in an arraylist, that is fine for right now, but I'm expanding to group by category. I now want to sort by category and then sort by duedate within the category sort. Is this possible? Here's my class:
<br />
public class Task: IComparable<br />
	{<br />
		private int	_importance;<br />
		public int Importance<br />
		{<br />
			get { return _importance; }<br />
			set { _importance = value; }<br />
		}<br />
		<br />
		private DateTime	_DueDate;<br />
		public DateTime DueDate<br />
		{<br />
			get { return _DueDate; }<br />
			set { _DueDate = value; }<br />
		}<br />
	<br />
		private string	_subject;<br />
		public string Subject<br />
		{<br />
			get { return _subject; }<br />
			set { _subject = value; }<br />
		}<br />
<br />
		private string	_entryID;<br />
		public string EntryID<br />
		{<br />
			get { return _entryID; }<br />
			set { _entryID = value; }<br />
		}<br />
		private string	_category;<br />
		public string Category<br />
		{<br />
			get { return _category; }<br />
			set { _category = value; }<br />
		}<br />
		<br />
		public int CompareTo(object other)  <br />
		{    <br />
			return _DueDate.CompareTo(((Task)other)._DueDate); <br />
		}<br />
	<br />
	}<br />

AnswerRe: Sorting Arraylists Twice Pin
Stefan Troschuetz19-Sep-05 7:50
Stefan Troschuetz19-Sep-05 7:50 
Questioncombo boxes not updating Pin
Tom Wright19-Sep-05 5:22
Tom Wright19-Sep-05 5:22 
AnswerRe: combo boxes not updating Pin
KaptinKrunch19-Sep-05 7:21
KaptinKrunch19-Sep-05 7:21 
QuestionOptions Design Pin
OmegaSupreme19-Sep-05 4:58
OmegaSupreme19-Sep-05 4:58 
QuestionRegular Expression for images Pin
brunoconde19-Sep-05 3:57
brunoconde19-Sep-05 3:57 
AnswerRe: Regular Expression for images Pin
User 665819-Sep-05 4:25
User 665819-Sep-05 4:25 
QuestionCyclic Visual Pin
PHDENG8119-Sep-05 3:28
PHDENG8119-Sep-05 3:28 
Questionsave file dialog Pin
Mridang Agarwalla19-Sep-05 2:48
Mridang Agarwalla19-Sep-05 2:48 
AnswerRe: save file dialog Pin
enjoycrack19-Sep-05 2:52
enjoycrack19-Sep-05 2:52 
Questionlatebinding Word Pin
KKuehnberger19-Sep-05 2:47
KKuehnberger19-Sep-05 2:47 
AnswerRe: latebinding Word Pin
John Fisher19-Sep-05 6:07
John Fisher19-Sep-05 6:07 
GeneralRe: latebinding Word Pin
KKuehnberger19-Sep-05 6:48
KKuehnberger19-Sep-05 6:48 
GeneralRe: latebinding Word Pin
John Fisher19-Sep-05 13:57
John Fisher19-Sep-05 13:57 
Questionporting c# aplplications to linux Pin
Mridang Agarwalla19-Sep-05 2:35
Mridang Agarwalla19-Sep-05 2:35 
AnswerRe: porting c# aplplications to linux Pin
enjoycrack19-Sep-05 2:56
enjoycrack19-Sep-05 2:56 
AnswerRe: porting c# aplplications to linux Pin
Mohamad Al Husseiny19-Sep-05 8:55
Mohamad Al Husseiny19-Sep-05 8:55 
QuestionPassing values from one form to another Pin
sajjo7919-Sep-05 1:37
sajjo7919-Sep-05 1:37 
AnswerRe: Passing values from one form to another Pin
enjoycrack19-Sep-05 2:49
enjoycrack19-Sep-05 2:49 
AnswerRe: Passing values from one form to another Pin
mattylovestara19-Sep-05 20:49
mattylovestara19-Sep-05 20:49 
QuestionDownload from Server Pin
cloudking1196619-Sep-05 0:34
cloudking1196619-Sep-05 0:34 
AnswerRe: Download from Server Pin
enjoycrack19-Sep-05 1:01
enjoycrack19-Sep-05 1:01 
AnswerRe: Download from Server Pin
seee sharp19-Sep-05 1:02
seee sharp19-Sep-05 1:02 
Questioncreate a dll [part 2] Pin
Sasuko19-Sep-05 0:20
Sasuko19-Sep-05 0:20 
AnswerRe: create a dll [part 2] Pin
Stefan Troschuetz19-Sep-05 1:19
Stefan Troschuetz19-Sep-05 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.