Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

enum in method as argument c#

public static void MyEnumMethod(Enum e)
    {
        var enumValues = Enum.GetValues(e.GetType());
        // you can iterate over enumValues with foreach
    }

MyEnumMethod(new MyEnum());
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# fill values of child from parent 
Csharp :: how to save in mongo different name field than model? c# 
Csharp :: c# list.except compare classes with IEqualityComparer 
Csharp :: How to get the value of an input button in an ASP.NET Core MVC controller 
Csharp :: small index c# 
Csharp :: unity camera movement script 
Csharp :: ENUM error codes all 
Csharp :: set data annotation text in model c# 
Csharp :: c# replace characters in string that are invalid using regex 
Csharp :: c# treeview keep selected node highlight 
Csharp :: xml reader attributes 
Csharp :: C# JOSN Array Conversion 
Csharp :: touch screen to world point 
Csharp :: range to 01 
Csharp :: delegates in c# 
Csharp :: split a datatable based on number of rows 
Csharp :: card caption 
Csharp :: unity next level trigger 
Csharp :: unity run all interfaces 
Csharp :: c# text editor 
Csharp :: cs foreach int 
Csharp :: datagridview show noti each row column 
Csharp :: asp.net unregister client script 
Csharp :: get access to all controls with a specific tag in C# 
Csharp :: c# condition and 
Csharp :: aquarette 
Csharp :: What does "DateTime?" mean in C#? 
Csharp :: Unity Scale per code ändern 
Csharp :: vb.net single quote in string 
Csharp :: nunjuck if exist 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =