This sample demonstrates these language features:
- Operator overloading – TheValidatedStringclass represents a string with custom validation. The&operator returns the concatenation of twoValidatedStringobjects.
- Generics - ThePairclass holds two values. When you declare an instance of thePairclass, you specify the types of the two values. TheMatchmethod tests to whether the pair types and values are the same.
- UsingTheUsing Statement (Visual Basic)references a stream resource opened by a request from a Web client. The stream instance is disposed of automatically at the end of theUsingblock.
- TryCast and IsNotTryCastattempts to cast an object to a particular type and returns the converted value. If the cast fails thenNothingis returned. The IsNotoperator is used to test the return result forNothing.
Download Project