ازيكم عاملين ايه يا رب تكونو بخير جيمعا يا رب
انهردا معانا موضوع مهم جدااااااااا اوى علشان دا اكتر الناس
الجديدة فى المجال بتبوظ السورس على شان تغير لون القونصل
اول حاجة معنا
هتفتح ملف
Console.cs
الى فى المسار دا
Source\Extensions\Console.cs
وامسح كل الى فى الكلاس بدلو بى دا مع تغيير النيم سبيس للنيم بتاع السورس بتاعك
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace Conquer_Online_Server {
public static class Console
{
private static DateTime NOW = DateTime.Now;
private static Time32 NOW32 = Time32.Now;
public static string Title
{
get
{
return System.Console.Title;
}
set
{
System.Console.Title = value;
}
}
public static int WindowWidth
{
get
{
return System.Console.WindowWidth;
}
set
{
System.Console.WindowWidth = value; ;
}
}
public static int WindowHeight
{
get
{
return System.Console.WindowHeight;
}
set
{
System.Console.WindowHeight = value; ;
}
}
public static void WriteLine(object line, ConsoleColor color = ConsoleColor.Red)
{
if (line.ToString() == "" || line.ToString() == " ")
System.Console.WriteLine();
else
{
ForegroundColor = ConsoleColor.Red;
System.Console.Write(TimeStamp() + " ");
ForegroundColor = color;
System.Console.Write(line + "\n");
}
}
public static void WriteLine()
{
System.Console.WriteLine();
}
public static string ReadLine()
{
return System.Console.ReadLine();
}
public static ConsoleColor BackgroundColor
{
get
{
return System.Console.BackgroundColor;
}
set
{
System.Console.BackgroundColor = value;
}
}
public static void Clear()
{
System.Console.Clear();
}
private static Random _random = new Random();
private static ConsoleColor GetRandomConsoleColor()
{
var consoleColors = Enum.GetValues(typeof(ConsoleColor));
return (ConsoleColor)consoleColors.GetValue(_random.Next(consoleColors.Length));
}
public static void WriteLine(string text)
{
System.Console.ForegroundColor = GetRandomConsoleColor();
System.Console.Write(new string(' ', (Console.WindowWidth - text.Length) / 2));
System.Console.WriteLine(text);
}
public static ConsoleColor ForegroundColor
{
get
{
return System.Console.ForegroundColor;
}
set
{
System.Console.ForegroundColor = value;
}
}
public static string TimeStamp()
{
return "[" + NOW.AddMilliseconds((Time32.Now - NOW32).GetHashCode()).ToString("hh:mm:ss") + "]";
}
}
}
وبكدا الموضوع يبقا خلص
مواضيع ذات صلة
ليست هناك تعليقات:
إرسال تعليق