Click here to Skip to main content
15,920,217 members
Home / Discussions / C#
   

C#

 
AnswerRe: Encapsulate Pin
Guffa16-Oct-05 0:02
Guffa16-Oct-05 0:02 
AnswerRe: Encapsulate Pin
Heath Stewart16-Oct-05 0:29
protectorHeath Stewart16-Oct-05 0:29 
QuestionCreating Libraries in C# Pin
ddmcr15-Oct-05 22:35
ddmcr15-Oct-05 22:35 
AnswerRe: Creating Libraries in C# Pin
S. Senthil Kumar15-Oct-05 23:10
S. Senthil Kumar15-Oct-05 23:10 
GeneralRe: Creating Libraries in C#[modified] Pin
ddmcr15-Oct-05 23:21
ddmcr15-Oct-05 23:21 
GeneralRe: Creating Libraries in C#[modified] Pin
S. Senthil Kumar16-Oct-05 1:03
S. Senthil Kumar16-Oct-05 1:03 
Questiontext editor Pin
talk2krish15-Oct-05 21:08
talk2krish15-Oct-05 21:08 
AnswerRe: text editor Pin
Robert Rohde15-Oct-05 22:07
Robert Rohde15-Oct-05 22:07 
Questiondirectx video source as a binary stream? Pin
serguey_haftrige15-Oct-05 17:08
serguey_haftrige15-Oct-05 17:08 
AnswerRe: directx video source as a binary stream? Pin
Heath Stewart16-Oct-05 0:33
protectorHeath Stewart16-Oct-05 0:33 
GeneralRe: directx video source as a binary stream? Pin
serguey_haftrige16-Oct-05 14:52
serguey_haftrige16-Oct-05 14:52 
AnswerRe: directx video source as a binary stream? Pin
Heath Stewart16-Oct-05 17:28
protectorHeath Stewart16-Oct-05 17:28 
QuestionRemoving Handler... URGENT Pin
Shubhabrata Mohanty15-Oct-05 16:14
Shubhabrata Mohanty15-Oct-05 16:14 
AnswerRe: Removing Handler... URGENT Pin
Heath Stewart16-Oct-05 0:04
protectorHeath Stewart16-Oct-05 0:04 
GeneralRe: Removing Handler... URGENT Pin
Shubhabrata Mohanty16-Oct-05 11:06
Shubhabrata Mohanty16-Oct-05 11:06 
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 

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.