home *** CD-ROM | disk | FTP | other *** search
/ ftp.tcs3.com / ftp.tcs3.com.tar / ftp.tcs3.com / DRIVERS / Audio / Office2010 / InfoPath.en-us / InfLR.cab / FL_equals_snippet_121835_ENU____.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Extensible Markup Language  |  2009-04-01  |  2KB  |  63 lines

  1. ∩╗┐<?xml version="1.0" encoding="utf-8" ?>
  2. <CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  3.     <CodeSnippet Format="1.0.0">
  4.         <Header>
  5.             <Title>equals</Title>
  6.             <Shortcut>equals</Shortcut>
  7.             <Description>Code snippet for implementing Equals() according to guidelines</Description>
  8.             <Author>Microsoft Corporation</Author>
  9.             <SnippetTypes>
  10.                 <SnippetType>Expansion</SnippetType>
  11.             </SnippetTypes>
  12.         </Header>
  13.         <Snippet>
  14.             <Declarations>
  15.                 <Literal Editable="false">
  16.                     <ID>SystemDiagnosticsDebug</ID>
  17.                     <Function>SimpleTypeName(global::System.Diagnostics.Debug)</Function>
  18.                 </Literal>
  19.                 <Literal Editable="false">
  20.                     <ID>Exception</ID>
  21.                     <Function>SimpleTypeName(global::System.Exception)</Function>
  22.                 </Literal>
  23.                 <Literal Editable="false">
  24.                     <ID>ClassName</ID>
  25.                     <Function>ClassName()</Function>
  26.                     <Default>ClassName</Default>
  27.                 </Literal>
  28.             </Declarations>
  29.             <Code Language="csharp"><![CDATA[
  30.     // override object.Equals
  31.     public override bool Equals (object obj)
  32.     {
  33.  
  34.         //       
  35.         // See the full list of guidelines at
  36.         //   http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconequals.asp    
  37.         // and also the guidance for operator== at
  38.         //   http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconimplementingequalsoperator.asp
  39.         //
  40.  
  41.         if (obj == null || GetType() != obj.GetType()) 
  42.         {
  43.             return false;
  44.         }
  45.         
  46.         // TODO: write your implementation of Equals() here.
  47.         throw new $Exception$("The method or operation is not implemented.");
  48.         return base.Equals (obj);
  49.     $end$ 
  50.     }
  51.     
  52.     // override object.GetHashCode
  53.     public override int GetHashCode()
  54.     {
  55.         // TODO: write your implementation of GetHashCode() here.
  56.         throw new $Exception$("The method or operation is not implemented.");
  57.         return base.GetHashCode();
  58.     }
  59. ]]>
  60.             </Code>
  61.         </Snippet>
  62.     </CodeSnippet>
  63. </CodeSnippets>