I'm trying to write a program that writes text char by char. And I want to choose a write speed using enum. But it throws an error. So, this is my code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace WritingApp
{
class Program
{
public enum WriteMode { Slow, SlowRandom, Normal, NormalRandom, Fast, FastRandom };
static void Main(string[] args)
{
MessageWrite("smth", WriteMode.Fast); //Error here
//An object reference is required for the non-static field, method, or property
//'Program.MessageWrite(string, Program.WriteMode)'
}
void MessageWrite(string message, WriteMode mode)
{
for(int i = 0; i < message.Length; i++)
{
Console.Write(message[i]);
}
}
}
}