Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# switch by type of object

switch (myTransport)
{
  case Car car:
    car.Drive();    
    break;
    
  case Plane plane:
    plane.Fly();
    break;
    
  default:
    break;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: delete file from FTP c# 
Csharp :: unity up arrow input 
Csharp :: c# retrieve files in folder 
Csharp :: http error 502.5 asp.net core 2.2 
Csharp :: unity detect any key 
Csharp :: c# datagridview change column name 
Csharp :: dart extending list 
Csharp :: c# unity follow object 
Csharp :: difference between executescalar and executenonquery and executereader 
Csharp :: c# how to use inovke 
Csharp :: video gets pixelated by scaling it up to Screen Size unity 
Csharp :: google sheets sum if check contains string 
Csharp :: c# hex to console color 
Csharp :: c# list sort by property string 
Csharp :: fill all array c# with same value 
Csharp :: c# file dialog to get folder path 
Csharp :: create char array c# 
Csharp :: regular expression for email in c# 
Csharp :: json.net deserialize dynamic 
Csharp :: how to change the color of a sprite in unity 
Csharp :: c# mailmessage set sender name 
Csharp :: prevent page refresh 
Csharp :: error provider c# 
Csharp :: c# run loop x times 
Csharp :: header export excel data only php 
Csharp :: int value from enum in C# 
Csharp :: asp.net core 3.1 ajax partial view 
Csharp :: escape double quotes c# 
Csharp :: unity reverse string 
Csharp :: c# static meaning 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =