nedcomp hosting homepage

Producten en Diensten
Dedicated servers
Datacenter informatie
Partners, resellers
Helpdesk informatie
Technische docs, tools
Support homepage
ASP componenten
Praktische ASP, ASP.NET
Visual route server
Whois (domein gegevens)
Software documentatie
Whitepapers
Zoeken
Nedcomp / algemeen

Zoeken
 

Copyright © Nedcomp Hosting
Telefoon nr :   +31 184 670111
Fax nummer :   +31 184 631384
E-mailadres :   info@nedcomp.nl
 

.NET Framework Class Library  

CodeCastExpression Class

Represents an expression cast to a data type or interface.

For a list of all members of this type, see CodeCastExpression Members.

System.Object
   System.CodeDom.CodeObject
      System.CodeDom.CodeExpression
         System.CodeDom.CodeCastExpression

[Visual Basic]
<Serializable>
<ClassInterface(ClassInterfaceType.AutoDispatch)>
<ComVisible(True)>
Public Class CodeCastExpression
   Inherits CodeExpression
[C#]
[Serializable]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ComVisible(true)]
public class CodeCastExpression : CodeExpression
[C++]
[Serializable]
[ClassInterface(ClassInterfaceType::AutoDispatch)]
[ComVisible(true)]
public __gc class CodeCastExpression : public CodeExpression
[JScript]
public
   Serializable
   ClassInterface(ClassInterfaceType.AutoDispatch)
   ComVisible(true)
class CodeCastExpression extends CodeExpression

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks

CodeCastExpression can be used to represent an expression cast to a different data type or interface.

The Expression property indicates the CodeExpression to cast. The TargetType property indicates the type to cast to.

Example

[Visual Basic, C#] This example demonstrates using a CodeCastExpression to cast a System.Int32 value to a System.Int64 data type.

[Visual Basic] 
' This CodeCastExpression casts an Int32 of 1000 to an Int64.        
Dim castExpression As New CodeCastExpression( _
    "System.Int64", New CodePrimitiveExpression(1000) )
    
' A Visual Basic code generator produces the following source code for the preceeding example code:

' CType(1000,Long)

[C#] 
// This CodeCastExpression casts an Int32 of 1000 to an Int64.        
CodeCastExpression castExpression = new CodeCastExpression(
    // targetType parameter indicating the target type of the cast.
    "System.Int64",
    // The CodeExpression to cast, here an Int32 value of 1000.
    new CodePrimitiveExpression(1000) );    

// A C# code generator produces the following source code for the preceeding example code:

// ((long)(1000));

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.CodeDom

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System (in System.dll)

See Also

CodeCastExpression Members | System.CodeDom Namespace | CodeExpression