The Labs \ Source Viewer \ SSCLI \ System.Xml.Xsl \ Int32Pair

  1. //------------------------------------------------------------------------------
  2. // <copyright file="Pair.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. using System;
  16. using System.Diagnostics;
  17. namespace System.Xml.Xsl
  18. {
  19.     internal struct Int32Pair
  20.     {
  21.         private int left;
  22.         private int right;
  23.        
  24.         public Int32Pair(int left, int right)
  25.         {
  26.             this.left = left;
  27.             this.right = right;
  28.         }
  29.        
  30.         public int Left {
  31.             get { return this.left; }
  32.         }
  33.         public int Right {
  34.             get { return this.right; }
  35.         }
  36.        
  37.         public override bool Equals(object other)
  38.         {
  39.             if (other is Int32Pair) {
  40.                 Int32Pair o = (Int32Pair)other;
  41.                 return this.left == o.left && this.right == o.right;
  42.             }
  43.            
  44.             return false;
  45.         }
  46.        
  47.         public override int GetHashCode()
  48.         {
  49.             return this.left.GetHashCode() ^ this.right.GetHashCode();
  50.         }
  51.     }
  52.    
  53.     internal struct StringPair
  54.     {
  55.         private string left;
  56.         private string right;
  57.        
  58.         public StringPair(string left, string right)
  59.         {
  60.             this.left = left;
  61.             this.right = right;
  62.         }
  63.        
  64.         public string Left {
  65.             get { return this.left; }
  66.         }
  67.         public string Right {
  68.             get { return this.right; }
  69.         }
  70.     }
  71. }

Developer Fusion