static void Main(string[] args) { string text = "Hello World"; ConsoleTools consoleTools = new ConsoleTools(); consoleTools.WriteLine(text); }
public override void OnLocalDie(PlayerControl Victim, DeathReason Reason) { if (!IsLocalPlayer()) { return; } if (Victim.PlayerId != Player.PlayerId) { return; } Infected.Remove(Player.PlayerId); var TargetIds = new Il2CppStructArray <byte>(Infected.Count); var Index = 0; foreach (var InfectedId in Infected) { TargetIds[Index] = InfectedId; Index++; } ConsoleTools.Info(TargetIds.Count.ToString()); ExtraNetwork.Send(CustomRPC.ZombieChainKill, Writer => { Writer.WriteBytesAndSize(TargetIds); }); KillTargets(TargetIds); }
static void Main(string[] args) { ConsoleTools consoleTools = new ConsoleTools(); consoleTools.Write(args); Console.ReadKey(); }
public void DisplayInfos() { if (ProofValidation()) { ConsoleTools.DisplayMesssage($" MA Id: {Id}", ConsoleColor.Green); ConsoleTools.DisplayMesssage($" Name: {Name}", ConsoleColor.Green); switch (State) { case EmployeeState.Education: ConsoleTools.DisplayMesssage($" State: {State}", ConsoleColor.Cyan); break; case EmployeeState.Employed: ConsoleTools.DisplayMesssage($" State: {State}", ConsoleColor.Green); break; case EmployeeState.SabatTime: ConsoleTools.DisplayMesssage($" State: {State}", ConsoleColor.Yellow); break; case EmployeeState.Sick: ConsoleTools.DisplayMesssage($" State: {State}", ConsoleColor.Yellow); break; } ConsoleTools.DisplayMesssage($"Birthday: {Birthday.ToLongDateString()}", ConsoleColor.Green); } }
static void Main(string[] args) { ConsoleTools.DisplayMesssage("Willkommen in der Eingabe der Teilnehmerverwaltung.", ConsoleColor.Yellow); Program program = new Program(); program.Initialize(); }
public static void Main(string[] args) { ConsoleTools.EnableQuickEditMode(); while (true) { Console.Write("Input: "); var hexStream = Console.ReadLine(); if (string.IsNullOrEmpty(hexStream)) { Error("string.IsNullOrEmpty(hexStream)"); continue; } var bytes = Functions.HexStreamToByteArray(hexStream); if (bytes == null) { Error("bytes == null"); continue; } try { var conanPacket = new ConanPacket(new ConanStream(bytes)); Console.WriteLine("=====================================================================\r\n"); Console.WriteLine(PacketUtills.PacketToCsCode(conanPacket)); Console.WriteLine("=====================================================================\r\n"); } catch (Exception e) { Error(e.Message); } } }
private static void Main(string[] args) { Arguments.Parse(args); ConsoleTools.EnableQuickEditMode(); //ConsoleTools.SetConsoleCtrlHandler(ConsoleCtrlHandler, true); // Causes crash?? ConsoleTools.SetDefaultCulture(CultureInfo.InvariantCulture); if (Arguments.WriteLogToFile) { Logger.SetupFile($"logs/ProjectFolan_{Functions.Time()}.log"); } Logger.Get().InfoNoFormat(Statics.Banner); if (Settings.Load(Arguments.ConfigPath)) { Logger.Get("Settings").Info($"Loaded from: {Arguments.ConfigPath}"); } else { Logger.Get("Settings").Info($"Failed to load from: {Arguments.ConfigPath}"); return; } if (Settings.UseMysql) { _database = new MySqlDatabase(Settings.MySqlAddress, Settings.MySqlPort, Settings.MySqlDatabase, Settings.MySqlUsername, Settings.MySqlPassword, Logger.Get("MySQL")); } else if (Settings.UseSqLite) { _database = new SqLiteDatabase(Settings.SqLitePath, Logger.Get("SQLite")); } if (!_database.Connect()) { return; } _universeAgent = new UniverseAgentListener(Settings.UniverseAgentPort, Logger.Get("UniverseAgent"), _database); _universeAgent.Start(); _playerAgent = new PlayerAgentListener(Settings.PlayerAgentPort, Logger.Get("PlayerAgent"), _database); _playerAgent.Start(); _csplayerAgent = new CsPlayerAgentListener(Settings.CsPlayerAgentPort, Logger.Get("CsPlayerAgent"), _database); _csplayerAgent.Start(); _agentServer = new AgentServerListener(Settings.AgentServerPort, Logger.Get("AgentServer"), _database); _agentServer.Start(); _gameServer = new GameServerListener(Settings.GameServerPort, Logger.Get("GameServer"), _database, _agentServer); _gameServer.Start(); Functions.ExitLoop(); }
/// <summary> /// Displays all infos of the car /// </summary> public void DisplayInfos() { ConsoleTools.DisplayMesssage($"Type: {_type}", ConsoleColor.Green); ConsoleTools.DisplayMesssage($"MaxSpeed: {_maxSpeed} km/h", ConsoleColor.Green); ConsoleTools.DisplayMesssage($"CurrentSpeed: {_currentSpeed} km/h", ConsoleColor.Green); ConsoleTools.DisplayMesssage($"Description: {_description}", ConsoleColor.Green); ConsoleTools.DisplayMesssage(""); }
public void WriteLineTest() { string expected = "Hello World"; ConsoleTools consoleTools = new ConsoleTools(); string result = consoleTools.WriteLine(expected); Assert.AreEqual(expected, result); }
private static void Task() { int[,] Arr2 = ConsoleTools.InputArr2(true); Array2Tools array2Tools = new Array2Tools(Arr2); int[,] NewArr2 = array2Tools.SortRows(); ConsoleTools.OutputArr2(NewArr2); Console.ReadKey(); }
public void UpdateSalary(double amountInPercent) { if (ProofValidation()) { ConsoleTools.DisplayMesssage($"Altes Gehalt: {Salary} EUR", ConsoleColor.Yellow); Salary += Salary * (decimal)(amountInPercent / 100); ConsoleTools.DisplayMesssage($"Neues Gehalt: {Salary} EUR", ConsoleColor.Yellow); } }
internal void Post() { ConsoleTools.Light($"Event: {EventName}"); foreach (var Listener in Listeners) { Listener(); } }
public static void ThreadMethod(object o) { ConsoleTools.Devider('-'); for (int i = 0; i < 10; i++) { Console.WriteLine("ThreadProc: {0}", i); Thread.Sleep((int)o); } ConsoleTools.Devider('-'); }
public static void ThreadMethod(object o) { ConsoleTools.Devider('-'); for (int i = 0; i < 10; i++) { Console.WriteLine("ThreadProc: {0}", i); // Used by: Ex001_Thread_Basic AND Ex002_Thread_Background AND Ex003_Tasks_Basic Thread.Sleep((int)o); } ConsoleTools.Devider('-'); }
/// <summary> /// Gibt die Teilnehmer tabellarisch aus /// </summary> /// <param name="teilnehmer">Die Teilnehmer die Ausgegeben werden</param> /// <returns></returns> void PrintTeilnehmer(Teilnehmer[] teilnehmer) { ConsoleTools.DisplayMesssage("\nTeilnehmerID\t\t\t\tVorname\tNachname\tStrasse\tHausNr\tPLZ\tOrt\tGeburtsdatum\n", ConsoleColor.Cyan); foreach (Teilnehmer teiln in teilnehmer) { //Ausgabe eines einzelnen Teilnehmers in Türkis ConsoleTools.DisplayMesssage($"{teiln.TeilnehmerID}\t{teiln.Vorname}" + $"\t{teiln.Nachname}\t{teiln.Strasse}\t{teiln.HausNr}\t{teiln.PLZ}\t{teiln.Ort}" + $"\t{teiln.GeburtsDatum.ToShortDateString()}", ConsoleColor.Cyan); } }
private static void Task() { Console.WriteLine("первый массив"); int[,] FirstArr2 = ConsoleTools.InputArr2(false); Console.WriteLine("второй массив"); int[,] SecondArr2 = ConsoleTools.InputArr2(false); Array2Tools array2Tools = new Array2Tools(FirstArr2); array2Tools.GetOverlayPoint(SecondArr2, out int Row, out int Column); ConsoleTools.OutputStr(GetString(Row, Column)); Console.ReadKey(); }
public static void Main(string[] args) { if (uint.TryParse(args[0], out uint input) == false || input == 0) { ConsoleTools.CloseProgram("Wrong input. Enter the number of elements of Fibbonaci Series (positive number)."); } Console.WriteLine($"Input argument: {String.Join(" ", args)}"); Console.WriteLine(String.Join("", GetFibbonaciSeries(input))); ConsoleTools.CloseProgram(); }
private void startPutty() { try { var viewmodel = ((ObjectView <HostViewModel>)_bindingSource.Current).Object; var host = viewmodel.Model.Info; ConsoleTools.StartPutty(host, _hostsManager.PuttyProfile, false); } catch (Exception e) { Logger.Log.Error(e.Message, e); } }
/// <summary> /// Gibt die /// </summary> /// <param name="teilnehmer"></param> /// <returns></returns> public static string PrintTeilnehmer(Teilnehmer[] teilnehmer) { string text = string.Empty; ConsoleTools.DisplayColoredMessage("TeilnehmerID\tVorname\tNachname\tStrasse\tHausNr\tPLZ\tOrt\tGeburtsdatum"); foreach (Teilnehmer teiln in teilnehmer) { ConsoleTools.DisplayColoredMessage($"{teiln.TeilnehmerID}\t{teiln.Vorname}\t{teiln.Nachname}\t{teiln.Strasse}\t{teiln.HausNr}\t{teiln.PLZ}\t{teiln.Ort}\t{teiln.GeburtsDatum.ToShortDateString()}"); text += $"{teiln.TeilnehmerID}\t{teiln.Vorname}\t{teiln.Nachname}\t{teiln.Strasse}\t{teiln.HausNr}\t{teiln.PLZ}\t{teiln.Ort}\t{teiln.GeburtsDatum.ToShortDateString()}\n"; } return(text); }
static void Main(string[] args) { ConsoleTools.MakeHeader("DAS ist die ÜBERSCHRIFT"); ConsoleTools.DisplayColoredMessage("Dies ist ein Test...", ConsoleColor.Red); ConsoleTools.DisplayColoredMessage("Dies ist ein Test..."); // double val1 = ConsoleTools.GetDouble("Bitte Wert eingeben (Double) "); DateTime date1 = ConsoleTools.GetDateTime("Bitte geben Sie ein Datum(dd.MM.YY) ein: ", "dd.MM.yy"); Console.ReadLine(); }
static void Main(string[] args) { var robotFactory = new RobotFactory(new JsonDataSource()); var robot = robotFactory.CreateRobot(); Console.WriteLine(robot); robotFactory.ResetId(robot); Console.WriteLine(robot); ConsoleTools.CloseProgram(); }
static void Main(string[] args) { CreateHand(); var hands = dataSource.LoadHands(); var results = GetFulls(hands); foreach (var result in results) { System.Console.WriteLine(result); } ConsoleTools.CloseProgram(); }
private void startFileZilla() { try { var viewmodel = ((ObjectView <HostViewModel>)_bindingSource.Current).Object; var host = viewmodel.Model.Info; ConsoleTools.StartFileZilla(host); } catch (Exception e) { Logger.Log.Error(e.Message, e); } }
/// <summary> /// Entry point of the master. Call methods to initiate port listening. /// When a remote computer connects to us, initiate the prompt loop and monitor the connection. /// </summary> public void Start() { ConsoleTools.DisplayBanner(); var choice = ""; while (choice != "9") { Console.Write("\n\nChoose one option :\n\n 1 : Issue commands to the botnet's master server\n 2 : Listen on a port\n 9 : Exit\n\nChoice : "); // Reset choice here or infinite loop choice = ""; while (choice != "1" && choice != "2" && choice != "9") { choice = Console.ReadLine(); // Space a bit Console.WriteLine(""); int port; switch (choice) { case "1": port = BotnetManager.Process() ?? 0; if (port != 0) { ListenForIncomingConnection(port); } break; case "2": port = ConsoleTools.AskForPortNumber("Please type a port number to listen to"); ListenForIncomingConnection(port); break; case "9": // exit break; default: Console.Write("Invalid choice, please type again\n> "); break; } } waitingForUserCommandInput = false; } }
static void Main(string[] args) { var documents = new List <IDocument>() { DocumentFactory.CreateCV("Adam"), DocumentFactory.CreateStory("Adam S."), DocumentFactory.CreateReport("aaaa") }; foreach (var document in documents) { document.Print(); } ConsoleTools.CloseProgram(); }
private static void TestSyncDemo(CodeTimer timer) { SyncDemo demo = new SyncDemo(); List <int> res = null; CodeTimerResult codeTimerResult; for (int i = 0; i < 10; i++) { codeTimerResult = timer.Time(1, (() => { res = demo.Demo(); })); ConsoleTools.ShowConsole(new Dictionary <string, object>() { //System.InvalidOperationException:“Collection was modified; enumeration operation may not execute.” // 由于存在数据返回了 但由于创建了Task.Run 即还存在其他线程正在修改的情况 { "Demo", JsonConvert.SerializeObject(res) }, { nameof(codeTimerResult), codeTimerResult }, { "isRepeat", res.IndexOf(res[0], 1) } }); codeTimerResult = timer.Time(1, (() => { res = demo.Demo2().Result; })); ConsoleTools.ShowConsole(new Dictionary <string, object>() { { "Demo2", JsonConvert.SerializeObject(res) }, { nameof(codeTimerResult), codeTimerResult }, { "isRepeat", res.IndexOf(res[0], 1) } }); codeTimerResult = timer.Time(1, (() => { res = demo.Demo3().Result; })); ConsoleTools.ShowConsole(new Dictionary <string, object>() { { "Demo3", JsonConvert.SerializeObject(res) }, { nameof(codeTimerResult), codeTimerResult }, { "isRepeat", res.IndexOf(res[0], 1) } }); } }
/// <summary> /// Displays a dialog with text and Selections. /// </summary> /// <param name="selections">The selections for the menu. The first argument is 0.</param> public async Task <byte> SendMenu(params string[] selections) { ConsoleTools.PrintWithNpcColor(_textBuffer); ClearTextBuffer(); if (selections == null || selections.Length == 0) { return(0); } byte selection = 0; await Task.Factory.StartNew(() => { bool exit = false; while (!exit) { for (int i = 0; i < selections.Length; i++) { ConsoleTools.PrintWithNpcColor((i + 1) + ") " + selections[i]); } Console.Write("Choose> "); string input = Console.ReadLine(); if (byte.TryParse(input, out selection)) { if (selection > 0 && selection <= selections.Length) { exit = true; } else { Console.WriteLine("Incorrect choice."); } } else if (input.ToLower() == "exit") { Stop(); } else { Console.WriteLine("Incorrect value."); } } }); Console.WriteLine(); return(--selection); }
/// <summary> /// Liest einen Teilnehmer ein /// </summary> /// <param name="anzahlTeilnehmer">Anzahl der Einzulesenden Teilnehmer</param> /// <returns></returns> public static Teilnehmer[] GetTeilnehmer(int anzahlTeilnehmer) { Teilnehmer[] teilnehmer = new Teilnehmer[anzahlTeilnehmer]; for (int i = 0; i < anzahlTeilnehmer; ++i) { teilnehmer[i].TeilnehmerID = Guid.NewGuid(); teilnehmer[i].Vorname = ConsoleTools.GetString($"Bitte Vorname von Teilnehmer angeben: "); teilnehmer[i].Nachname = ConsoleTools.GetString($"Bitte Nachname von Teilnehmer {teilnehmer[i].Vorname} angeben: "); teilnehmer[i].Strasse = ConsoleTools.GetString($"Bitte Strasse von Teilnehmer {teilnehmer[i].Vorname} angeben: "); teilnehmer[i].HausNr = ConsoleTools.GetString($"Bitte HausNr von Teilnehmer {teilnehmer[i].Vorname} angeben: "); teilnehmer[i].PLZ = ConsoleTools.GetInt($"Bitte PLZ von Teilnehmer {teilnehmer[i].Vorname} angeben: "); teilnehmer[i].Ort = ConsoleTools.GetString($"Bitte Ort von Teilnehmer {teilnehmer[i].Vorname} angeben: "); teilnehmer[i].GeburtsDatum = ConsoleTools.GetDateTime($"Bitte Geburtsdatum von Teilnehmer {teilnehmer[i].Vorname} angeben: ", "dd.MM.yyyy"); } return(teilnehmer); }
private static void GetNewGuest() { var guest = new GuestEntity(); Console.WriteLine("\n Geben Sie nun die Daten für den neuen Gast ein: \n"); guest.FullName = ConsoleTools.GetString("Name: "); guest.Email = ConsoleTools.GetString("EMail: "); guest.StreetAndNr = ConsoleTools.GetString("Adresse: "); guest.PostalCode = ConsoleTools.GetInt("Plz: "); guest.City = ConsoleTools.GetString("Ort: "); guest.LastChangeAt = DateTime.UtcNow; IDataProvider <GuestEntity> db = new MongoDbProvider(connectionString, dbName, collectionName); db.InsertDocument(guest); }
public Auto(string type, int maxSpeed, string description) { _type = type; if (maxSpeed < 0) { ConsoleTools.DisplayMesssage("ERROR: MaxSpeed kann nicht < 0 sein!", ConsoleColor.Red); _maxSpeed = 0; } else { _maxSpeed = maxSpeed; } _currentSpeed = 0; _description = description; }