Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
AnswerRe: Removing Handler... URGENT Pin
Heath Stewart16-Oct-05 17:06
protectorHeath Stewart16-Oct-05 17:06 
GeneralRe: Removing Handler... URGENT Pin
Shubhabrata Mohanty16-Oct-05 20:42
Shubhabrata Mohanty16-Oct-05 20:42 
AnswerRe: Removing Handler... URGENT Pin
Heath Stewart17-Oct-05 5:58
protectorHeath Stewart17-Oct-05 5:58 
QuestionEncode two integers Pin
JoaoPe15-Oct-05 15:48
JoaoPe15-Oct-05 15:48 
AnswerRe: Encode two integers Pin
Rob Philpott15-Oct-05 23:29
Rob Philpott15-Oct-05 23:29 
AnswerRe: Encode two integers Pin
Heath Stewart16-Oct-05 0:17
protectorHeath Stewart16-Oct-05 0:17 
GeneralRe: Encode two integers Pin
JoaoPe16-Oct-05 2:33
JoaoPe16-Oct-05 2:33 
AnswerRe: Encode two integers Pin
Heath Stewart16-Oct-05 17:14
protectorHeath Stewart16-Oct-05 17:14 
It's you're type - define it however you need to. You could, for example (and consistency), implement IComparable based on whatever logic you wish (like X takes precedence over Y). The other reply you got already implies that by pushing X into the upper 32 bits and Y into the lower 32 bits. That means X takes precedence because it cares greater value. That'd really be no different than something like this:
struct N : IComparable
{
  // ...
 
  int IComparable.CompareTo(object obj)
  {
    if (obj == null) throw new ArgumentNullException("obj");
    if (obj.GetType() != GetType()) throw new ArgumentException();
 
    N n = (N)obj; // This will unbox 'obj' to value type, N.
    if (X == n.X)
    {
      return n.Y - Y;
    }
    else
    {
      return n.X - X;
    }
  }
}


This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft

[My Articles] [My Blog]
QuestionWinService issues Pin
WetRivrRat15-Oct-05 13:42
WetRivrRat15-Oct-05 13:42 
AnswerRe: WinService issues Pin
Heath Stewart16-Oct-05 0:25
protectorHeath Stewart16-Oct-05 0:25 
QuestionRead until "- -" ??? Pin
WetRivrRat15-Oct-05 13:06
WetRivrRat15-Oct-05 13:06 
AnswerRe: Read until "- -" ??? Pin
Robert Rohde15-Oct-05 22:29
Robert Rohde15-Oct-05 22:29 
AnswerRe: Read until "- -" ??? Pin
Scott Serl16-Oct-05 15:00
Scott Serl16-Oct-05 15:00 
Questionvideo streaming, Is it possible Pin
serguey_haftrige15-Oct-05 12:23
serguey_haftrige15-Oct-05 12:23 
AnswerRe: video streaming, Is it possible Pin
leppie15-Oct-05 23:24
leppie15-Oct-05 23:24 
QuestionPersistence Pin
Sled Dog15-Oct-05 11:27
Sled Dog15-Oct-05 11:27 
AnswerRe: Persistence Pin
Rob Philpott16-Oct-05 1:14
Rob Philpott16-Oct-05 1:14 
GeneralRe: Persistence Pin
Sled Dog16-Oct-05 3:54
Sled Dog16-Oct-05 3:54 
GeneralRe: Persistence Pin
Rob Philpott16-Oct-05 4:19
Rob Philpott16-Oct-05 4:19 
GeneralRe: Persistence Pin
Sled Dog16-Oct-05 4:37
Sled Dog16-Oct-05 4:37 
GeneralRe: Persistence Pin
Rob Philpott16-Oct-05 4:54
Rob Philpott16-Oct-05 4:54 
Question"Public Shared" equivalent in VB & Global Pin
Sled Dog15-Oct-05 9:52
Sled Dog15-Oct-05 9:52 
AnswerRe: "Public Shared" equivalent in VB & Global Pin
Sled Dog15-Oct-05 9:59
Sled Dog15-Oct-05 9:59 
AnswerRe: "Public Shared" equivalent in VB & Global Pin
Sled Dog15-Oct-05 11:08
Sled Dog15-Oct-05 11:08 
QuestionDetermining DNS servers with C# Pin
Rob Philpott15-Oct-05 7:45
Rob Philpott15-Oct-05 7:45 

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.