Processing Ajax...
Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

C# Language Test: 8.0

Description
C# language tests for v8.0.
Language
C#.net
Minimum Version
Created By
Jon Tackabury (BFS)
Contributors
-
Date Created
Mar 21, 2022
Date Last Modified
Mar 21, 2022

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		string result = "";
		
		switch ("mrm_prif")
		{
			case "mrm_pri0":
			case "mrm_pri1":
			case "mrm_pri2":
			case "mrm_prif":
				result = "Yep!";
				break;
			default:
				throw new Exception("Nope.");
		}
		
		result = "mrm_prif" switch
		{
			"mrm_pri0" or "mrm_pri1" or "mrm_pri2" or "mrm_prif" => "Yep!",
			_ => throw new Exception("Nope."),
		};
		
		using var stream = new System.IO.MemoryStream();		
	}
	
	internal static int M()
	{
	    int y = 5;
	    int x = 7;
	    return Add(x, y);
	
	    static int Add(int left, int right) => left + right;
	}
}