2013-07-18 09:27:19 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
2014-05-31 01:59:03 +02:00
|
|
|
|
using MinecraftClient.Protocol;
|
2014-06-18 13:32:17 +02:00
|
|
|
|
using System.Reflection;
|
2014-08-18 15:10:15 +02:00
|
|
|
|
using System.Threading;
|
2013-07-18 09:27:19 +02:00
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2014-03-26 10:12:05 +01:00
|
|
|
|
/// Minecraft Console Client by ORelio (c) 2012-2014.
|
2013-07-18 09:27:19 +02:00
|
|
|
|
/// Allows to connect to any Minecraft server, send and receive text, automated scripts.
|
|
|
|
|
|
/// This source code is released under the CDDL 1.0 License.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
private static McTcpClient Client;
|
2013-08-06 16:11:46 +02:00
|
|
|
|
public static string[] startupargs;
|
2014-05-31 01:59:03 +02:00
|
|
|
|
public const string Version = "1.8.0-Indev";
|
2013-07-18 09:27:19 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The main entry point of Minecraft Console Client
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
|
{
|
2014-08-18 15:10:15 +02:00
|
|
|
|
Console.WriteLine("Console Client for MC 1.4.6 to 1.7.10 - v" + Version + " - By ORelio & Contributors");
|
2013-07-18 09:27:19 +02:00
|
|
|
|
|
2013-08-15 18:04:29 +02:00
|
|
|
|
//Basic Input/Output ?
|
|
|
|
|
|
if (args.Length >= 1 && args[args.Length - 1] == "BasicIO")
|
|
|
|
|
|
{
|
|
|
|
|
|
ConsoleIO.basicIO = true;
|
2014-01-22 11:44:53 +01:00
|
|
|
|
Console.OutputEncoding = Console.InputEncoding = Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage);
|
2013-08-15 18:04:29 +02:00
|
|
|
|
args = args.Where(o => !Object.ReferenceEquals(o, args[args.Length - 1])).ToArray();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-01-17 20:58:42 +01:00
|
|
|
|
//Process ini configuration file
|
|
|
|
|
|
if (args.Length >= 1 && System.IO.File.Exists(args[0]) && System.IO.Path.GetExtension(args[0]).ToLower() == ".ini")
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
2013-08-06 16:11:46 +02:00
|
|
|
|
Settings.LoadSettings(args[0]);
|
2014-01-17 20:58:42 +01:00
|
|
|
|
|
|
|
|
|
|
//remove ini configuration file from arguments array
|
|
|
|
|
|
List<string> args_tmp = args.ToList<string>();
|
|
|
|
|
|
args_tmp.RemoveAt(0);
|
|
|
|
|
|
args = args_tmp.ToArray();
|
2013-08-06 16:11:46 +02:00
|
|
|
|
}
|
2014-01-17 20:58:42 +01:00
|
|
|
|
else if (System.IO.File.Exists("MinecraftClient.ini"))
|
|
|
|
|
|
{
|
|
|
|
|
|
Settings.LoadSettings("MinecraftClient.ini");
|
|
|
|
|
|
}
|
|
|
|
|
|
else Settings.WriteDefaultSettings("MinecraftClient.ini");
|
|
|
|
|
|
|
|
|
|
|
|
//Other command-line arguments
|
|
|
|
|
|
if (args.Length >= 1)
|
2013-08-06 16:11:46 +02:00
|
|
|
|
{
|
|
|
|
|
|
Settings.Login = args[0];
|
2013-07-18 09:27:19 +02:00
|
|
|
|
if (args.Length >= 2)
|
|
|
|
|
|
{
|
2013-08-06 16:11:46 +02:00
|
|
|
|
Settings.Password = args[1];
|
2013-07-18 09:27:19 +02:00
|
|
|
|
if (args.Length >= 3)
|
|
|
|
|
|
{
|
2014-06-13 16:50:55 +02:00
|
|
|
|
Settings.setServerIP(args[2]);
|
2013-08-06 16:11:46 +02:00
|
|
|
|
|
|
|
|
|
|
//Single command?
|
2013-07-18 09:27:19 +02:00
|
|
|
|
if (args.Length >= 4)
|
|
|
|
|
|
{
|
2013-08-06 16:11:46 +02:00
|
|
|
|
Settings.SingleCommand = args[3];
|
|
|
|
|
|
}
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-01-17 19:54:10 +01:00
|
|
|
|
if (Settings.ConsoleTitle != "")
|
|
|
|
|
|
{
|
2014-06-11 20:40:25 +02:00
|
|
|
|
Settings.Username = "New Window";
|
2014-06-13 16:50:55 +02:00
|
|
|
|
Console.Title = Settings.expandVars(Settings.ConsoleTitle);
|
2014-01-17 19:54:10 +01:00
|
|
|
|
}
|
2014-01-16 19:33:48 +01:00
|
|
|
|
|
2013-07-18 09:27:19 +02:00
|
|
|
|
//Asking the user to type in missing data such as Username and Password
|
|
|
|
|
|
|
2013-08-06 16:11:46 +02:00
|
|
|
|
if (Settings.Login == "")
|
2013-07-20 11:01:49 +10:00
|
|
|
|
{
|
2013-08-21 14:31:57 +02:00
|
|
|
|
Console.Write(ConsoleIO.basicIO ? "Please type the username of your choice.\n" : "Username : ");
|
2013-08-06 16:11:46 +02:00
|
|
|
|
Settings.Login = Console.ReadLine();
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
2013-08-06 16:11:46 +02:00
|
|
|
|
if (Settings.Password == "")
|
2013-07-20 11:01:49 +10:00
|
|
|
|
{
|
2013-08-21 14:31:57 +02:00
|
|
|
|
Console.Write(ConsoleIO.basicIO ? "Please type the password for " + Settings.Login + ".\n" : "Password : ");
|
2013-08-23 10:48:26 +02:00
|
|
|
|
Settings.Password = ConsoleIO.basicIO ? Console.ReadLine() : ConsoleIO.ReadPassword();
|
|
|
|
|
|
if (Settings.Password == "") { Settings.Password = "-"; }
|
2013-08-21 14:31:57 +02:00
|
|
|
|
if (!ConsoleIO.basicIO)
|
|
|
|
|
|
{
|
2013-08-23 10:48:26 +02:00
|
|
|
|
//Hide password length
|
|
|
|
|
|
Console.CursorTop--; Console.Write("Password : <******>");
|
2013-08-21 14:31:57 +02:00
|
|
|
|
for (int i = 19; i < Console.BufferWidth; i++) { Console.Write(' '); }
|
|
|
|
|
|
}
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
startupargs = args;
|
|
|
|
|
|
InitializeClient();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Start a new Client
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
private static void InitializeClient()
|
|
|
|
|
|
{
|
2014-05-31 01:59:03 +02:00
|
|
|
|
ProtocolHandler.LoginResult result;
|
2014-01-09 23:28:41 +01:00
|
|
|
|
Settings.Username = Settings.Login;
|
2014-01-08 23:58:49 +01:00
|
|
|
|
string sessionID = "";
|
2014-01-09 23:28:41 +01:00
|
|
|
|
string UUID = "";
|
2013-07-18 09:27:19 +02:00
|
|
|
|
|
2013-08-06 16:11:46 +02:00
|
|
|
|
if (Settings.Password == "-")
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
2014-06-11 20:40:25 +02:00
|
|
|
|
ConsoleIO.WriteLineFormatted("§8You chose to run in offline mode.");
|
2014-05-31 01:59:03 +02:00
|
|
|
|
result = ProtocolHandler.LoginResult.Success;
|
2014-01-08 23:58:49 +01:00
|
|
|
|
sessionID = "0";
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine("Connecting to Minecraft.net...");
|
2014-05-31 01:59:03 +02:00
|
|
|
|
result = ProtocolHandler.GetLogin(ref Settings.Username, Settings.Password, ref sessionID, ref UUID);
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
2014-05-31 01:59:03 +02:00
|
|
|
|
|
|
|
|
|
|
if (result == ProtocolHandler.LoginResult.Success)
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
2014-01-17 19:54:10 +01:00
|
|
|
|
if (Settings.ConsoleTitle != "")
|
2014-06-13 16:50:55 +02:00
|
|
|
|
Console.Title = Settings.expandVars(Settings.ConsoleTitle);
|
2014-06-30 13:55:51 +02:00
|
|
|
|
|
|
|
|
|
|
if (Settings.playerHeadAsIcon)
|
|
|
|
|
|
ConsoleIcon.setPlayerIconAsync(Settings.Username);
|
|
|
|
|
|
|
2013-07-18 09:27:19 +02:00
|
|
|
|
Console.WriteLine("Success. (session ID: " + sessionID + ')');
|
2014-06-30 13:55:51 +02:00
|
|
|
|
|
2013-08-06 16:11:46 +02:00
|
|
|
|
if (Settings.ServerIP == "")
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
|
|
|
|
|
Console.Write("Server IP : ");
|
2014-06-13 16:50:55 +02:00
|
|
|
|
Settings.setServerIP(Console.ReadLine());
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Get server version
|
2014-06-14 16:01:19 +02:00
|
|
|
|
int protocolversion = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (Settings.ServerVersion != "" && Settings.ServerVersion.ToLower() != "auto")
|
|
|
|
|
|
{
|
|
|
|
|
|
protocolversion = Protocol.ProtocolHandler.MCVer2ProtocolVersion(Settings.ServerVersion);
|
|
|
|
|
|
if (protocolversion != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
ConsoleIO.WriteLineFormatted("§8Using Minecraft version " + Settings.ServerVersion + " (protocol v" + protocolversion + ')');
|
|
|
|
|
|
}
|
|
|
|
|
|
else ConsoleIO.WriteLineFormatted("§8Unknown or not supported MC version '" + Settings.ServerVersion + "'.\nSwitching to autodetection mode.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (protocolversion == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine("Retrieving Server Info...");
|
|
|
|
|
|
if (!ProtocolHandler.GetServerInfo(Settings.ServerIP, Settings.ServerPort, ref protocolversion))
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine("Failed to ping this IP.");
|
|
|
|
|
|
if (Settings.AutoRelog_Enabled)
|
|
|
|
|
|
{
|
|
|
|
|
|
ChatBots.AutoRelog bot = new ChatBots.AutoRelog(Settings.AutoRelog_Delay, Settings.AutoRelog_Retries);
|
2014-08-18 15:10:15 +02:00
|
|
|
|
if (!bot.OnDisconnect(ChatBot.DisconnectReason.ConnectionLost, "Failed to ping this IP.")) { OfflineCommandPrompt(); }
|
2014-06-14 16:01:19 +02:00
|
|
|
|
}
|
2014-08-18 15:10:15 +02:00
|
|
|
|
else OfflineCommandPrompt();
|
2014-06-14 16:01:19 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (protocolversion != 0)
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
2014-05-31 01:59:03 +02:00
|
|
|
|
try
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
|
|
|
|
|
//Start the main TCP client
|
2013-08-06 16:11:46 +02:00
|
|
|
|
if (Settings.SingleCommand != "")
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
2014-06-13 16:50:55 +02:00
|
|
|
|
Client = new McTcpClient(Settings.Username, UUID, sessionID, Settings.ServerIP, Settings.ServerPort, protocolversion, Settings.SingleCommand);
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
2014-06-13 16:50:55 +02:00
|
|
|
|
else Client = new McTcpClient(Settings.Username, UUID, sessionID, protocolversion, Settings.ServerIP, Settings.ServerPort);
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
2014-05-31 01:59:03 +02:00
|
|
|
|
catch (NotSupportedException)
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine("Cannot connect to the server : This version is not supported !");
|
2014-08-18 15:10:15 +02:00
|
|
|
|
OfflineCommandPrompt();
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2014-06-14 16:01:19 +02:00
|
|
|
|
Console.WriteLine("Failed to determine server version.");
|
2014-08-18 15:10:15 +02:00
|
|
|
|
OfflineCommandPrompt();
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.ForegroundColor = ConsoleColor.Gray;
|
|
|
|
|
|
Console.Write("Connection failed : ");
|
|
|
|
|
|
switch (result)
|
|
|
|
|
|
{
|
2014-05-31 01:59:03 +02:00
|
|
|
|
case ProtocolHandler.LoginResult.AccountMigrated: Console.WriteLine("Account migrated, use e-mail as username."); break;
|
|
|
|
|
|
case ProtocolHandler.LoginResult.ServiceUnavailable: Console.WriteLine("Login servers are unavailable. Please try again later."); break;
|
|
|
|
|
|
case ProtocolHandler.LoginResult.WrongPassword: Console.WriteLine("Incorrect password."); break;
|
|
|
|
|
|
case ProtocolHandler.LoginResult.NotPremium: Console.WriteLine("User not premium."); break;
|
|
|
|
|
|
case ProtocolHandler.LoginResult.OtherError: Console.WriteLine("Network error."); break;
|
|
|
|
|
|
case ProtocolHandler.LoginResult.SSLError: Console.WriteLine("SSL Error.");
|
2014-03-26 10:12:05 +01:00
|
|
|
|
if (isUsingMono)
|
|
|
|
|
|
{
|
2014-05-31 01:59:03 +02:00
|
|
|
|
ConsoleIO.WriteLineFormatted("§8It appears that you are using Mono to run this program."
|
2014-03-26 10:12:05 +01:00
|
|
|
|
+ '\n' + "The first time, you have to import HTTPS certificates using:"
|
2014-06-11 20:40:25 +02:00
|
|
|
|
+ '\n' + "mozroots --import --ask-remove");
|
2014-03-26 10:12:05 +01:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
while (Console.KeyAvailable) { Console.ReadKey(false); }
|
2014-08-18 15:10:15 +02:00
|
|
|
|
if (Settings.SingleCommand == "") { OfflineCommandPrompt(); }
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Disconnect the current client from the server and restart it
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
public static void Restart()
|
|
|
|
|
|
{
|
2014-08-18 15:10:15 +02:00
|
|
|
|
new Thread(new ThreadStart(delegate
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Client != null) { Client.Disconnect(); ConsoleIO.Reset(); }
|
|
|
|
|
|
if (offlinePrompt != null) { offlinePrompt.Abort(); offlinePrompt = null; ConsoleIO.Reset(); }
|
|
|
|
|
|
Console.WriteLine("Restarting Minecraft Console Client...");
|
|
|
|
|
|
InitializeClient();
|
|
|
|
|
|
})).Start();
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-07-20 12:58:41 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Disconnect the current client from the server and exit the app
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
public static void Exit()
|
|
|
|
|
|
{
|
2014-08-18 15:10:15 +02:00
|
|
|
|
new Thread(new ThreadStart(delegate
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Client != null) { Client.Disconnect(); ConsoleIO.Reset(); }
|
|
|
|
|
|
if (offlinePrompt != null) { offlinePrompt.Abort(); offlinePrompt = null; ConsoleIO.Reset(); }
|
|
|
|
|
|
if (Settings.playerHeadAsIcon) { ConsoleIcon.revertToCMDIcon(); }
|
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
|
})).Start();
|
2013-07-20 12:58:41 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-07-18 09:27:19 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Pause the program, usually when an error or a kick occured, letting the user press Enter to quit OR type /reconnect
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
2014-08-18 15:10:15 +02:00
|
|
|
|
public static void OfflineCommandPrompt()
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
2014-08-18 15:10:15 +02:00
|
|
|
|
if (!Settings.exitOnFailure && offlinePrompt == null)
|
2013-07-18 09:27:19 +02:00
|
|
|
|
{
|
2014-08-18 15:10:15 +02:00
|
|
|
|
offlinePrompt = new Thread(new ThreadStart(delegate
|
2014-05-31 12:56:54 +02:00
|
|
|
|
{
|
2014-08-18 15:10:15 +02:00
|
|
|
|
string command = " ";
|
|
|
|
|
|
ConsoleIO.WriteLineFormatted("Not connected to any server. Use '" + (Settings.internalCmdChar == ' ' ? "" : "" + Settings.internalCmdChar) + "help' for help.");
|
|
|
|
|
|
ConsoleIO.WriteLineFormatted("Or press Enter to exit Minecraft Console Client.");
|
|
|
|
|
|
while (command.Length > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!ConsoleIO.basicIO) { ConsoleIO.Write('>'); }
|
|
|
|
|
|
command = Console.ReadLine().Trim();
|
|
|
|
|
|
if (command.Length > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Settings.internalCmdChar != ' ' && command[0] == Settings.internalCmdChar)
|
|
|
|
|
|
{
|
|
|
|
|
|
string message = "";
|
|
|
|
|
|
command = command.Substring(1);
|
|
|
|
|
|
if (command.StartsWith("reco"))
|
|
|
|
|
|
{
|
|
|
|
|
|
message = new Commands.Reco().Run(null, Settings.expandVars(command));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (command.StartsWith("connect"))
|
|
|
|
|
|
{
|
|
|
|
|
|
message = new Commands.Connect().Run(null, Settings.expandVars(command));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (command.StartsWith("exit") || command.StartsWith("quit"))
|
|
|
|
|
|
{
|
|
|
|
|
|
message = new Commands.Exit().Run(null, Settings.expandVars(command));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (command.StartsWith("help"))
|
|
|
|
|
|
{
|
|
|
|
|
|
ConsoleIO.WriteLineFormatted("§8MCC: " + (Settings.internalCmdChar == ' ' ? "" : "" + Settings.internalCmdChar) + new Commands.Reco().CMDDesc);
|
|
|
|
|
|
ConsoleIO.WriteLineFormatted("§8MCC: " + (Settings.internalCmdChar == ' ' ? "" : "" + Settings.internalCmdChar) + new Commands.Connect().CMDDesc);
|
|
|
|
|
|
}
|
|
|
|
|
|
else ConsoleIO.WriteLineFormatted("§8Unknown command '" + command.Split(' ')[0] + "'.");
|
|
|
|
|
|
if (message != "") { ConsoleIO.WriteLineFormatted("§8MCC: " + message); }
|
|
|
|
|
|
}
|
|
|
|
|
|
else ConsoleIO.WriteLineFormatted("§8Please type a command or press Enter to exit.");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}));
|
|
|
|
|
|
offlinePrompt.Start();
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-03-26 10:12:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Detect if the user is running Minecraft Console Client through Mono
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
public static bool isUsingMono
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Type.GetType("Mono.Runtime") != null;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-06-18 13:32:17 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Enumerate types in namespace through reflection
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="nameSpace">Namespace to process</param>
|
|
|
|
|
|
/// <param name="assembly">Assembly to use. Default is Assembly.GetExecutingAssembly()</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
|
|
|
|
public static Type[] GetTypesInNamespace(string nameSpace, Assembly assembly = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (assembly == null) { assembly = Assembly.GetExecutingAssembly(); }
|
|
|
|
|
|
return assembly.GetTypes().Where(t => String.Equals(t.Namespace, nameSpace, StringComparison.Ordinal)).ToArray();
|
|
|
|
|
|
}
|
2013-07-18 09:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|