本文整理汇总了C#中IServer类的典型用法代码示例。如果您正苦于以下问题:C# IServer类的具体用法?C# IServer怎么用?C# IServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IServer类属于命名空间,在下文中一共展示了IServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConsoleOutputTask
protected ConsoleOutputTask(IServer server, IEventAggregator events)
: base(events)
{
this.server = server;
Console = new BindableCollection<string>();
server.CurrentDatabaseChanged += delegate { ClearConsole(); };
}
示例2: UserQuitEventArgs
public UserQuitEventArgs(IUser user, IChannel channel, IServer server, string reason = null)
{
this.User = user;
this.Channel = channel;
this.Server = server;
this.Reason = reason;
}
示例3: Account
public Account(string username, string passwordHash, ICountry country, IServer server)
{
Username = username;
PasswordHash = passwordHash;
Country = country;
Server = server;
}
示例4: AddServer
public void AddServer(IServer server)
{
TreeIter iter = Store.Append();
//Store.SetValue(iter, 0, new Gdk.Pixbuf...)
Store.SetValue(iter, 1, server.Name);
Store.SetValue(iter, 2, server);
}
示例5: RemoveMethodFromNewClientEvent
protected static void RemoveMethodFromNewClientEvent(IServer server, ClientConnectedEventHandler clientConnectedEventHandler)
{
lock (clientConnectedEventHandler)
{
server.NewClientEvent -= clientConnectedEventHandler;
}
}
示例6: AddMethodToNewClientEvent
protected static void AddMethodToNewClientEvent(IServer server, ClientConnectedEventHandler clientConnectedEventHandler)
{
lock (newClientEventMonitor)
{
server.NewClientEvent += clientConnectedEventHandler;
}
}
示例7: Connector
public Connector(IServer server, string ip, int port)
{
Connections = new List<IWebSocketConnection>();
_server = server;
_ip = ip;
_port = port;
}
示例8: PacketManager
public PacketManager(TextWriter logger, IServer server)
{
Logger = logger;
Server = server;
_packetHandlers = new Dictionary<DataIdentifier, Func<EndPoint, ChatPacket, ChatPacket>>();
}
示例9: PadInt
public PadInt(int txid, int uid, IServer server, int version)
{
_txid = txid;
_uid = uid;
_server = server;
_version = version;
}
示例10: BaseConnection
/// <summary>
/// Add an socket to "server"-Server-Instance and register it
/// </summary>
/// <param name="ep">Socket to register</param>
/// <param name="server">Server-Instance</param>
public BaseConnection(Socket client, IServer server)
{
if (client == null)
throw new ArgumentNullException("client");
if (server == null)
throw new ArgumentNullException("server");
// this._encoding = Encoding.GetEncoding(28591);// iso_8859-1
this.handler = client;
this._server = server;
/*
int id = this.rnd.Next();
while (server.HasID(id) || server.SeedID(id)) // new seed id
{
id = this.rnd.Next();
}
this._id = id;
#if UNSTABLE
SocketManager socketManager = ((BaseServer)this._server).SocketManager;
socketManager.AddConnection(this);
#else
ThreadPool.QueueUserWorkItem(new WaitCallback(this.RecieveProc), null); // to/do: 25 Thread Limit!!!!
#endif
this.available = true;
Console.WriteLine("new BaseConnection with id: {0}, is availbale", id);*/
this.Initialize();
}
示例11: Use
public void Use(IServer server, string commandName, string[] tokens)
{
if (tokens.Length < 1)
{
Help(server);
return;
}
var toKick = server.GetClients();
if (toKick.Any() && tokens[0].ToLower() != "all")
{
foreach (var client1 in toKick.Where(client1 => !client1.GetOwner().CanUseCommand("chraft.kick.exempt")))
{
client1.Kick(tokens.Length > 1 ? tokens[1] : "Kicked");
server.GetLogger().Log(LogLevel.Info, "Kicked " + client1.GetOwner().Name);
}
}
else
{
foreach (IClient t in toKick.Where(t => t.GetOwner().Name.ToLower() == tokens[0].ToLower()).Where(t => !t.GetOwner().CanUseCommand("chraft.kick.exempt")))
{
t.Kick(tokens.Length > 1 ? tokens[1] : "Kicked");
server.GetLogger().Log(LogLevel.Info, "Kicked " + t.GetOwner().Name);
}
}
}
示例12: Run
public void Run(int port) {
using (var mefContainer = SetupMefContainer()) {
var server = mefContainer.GetExportedValue<IServer>();
Instance = server; // For debugging only.
server.Run(port);
}
}
示例13: GetModel
private Model GetModel(IServer server)
{
RequiresNotNull(server);
var r = server.PollCurrentStatus();
var model = new Model(r);
return model;
}
示例14: Start
/// <summary>
/// Starts the specified server.
/// </summary>
/// <param name="server">The server.</param>
public void Start(IServer server)
{
RequiresNotNull(server);
var instructions = new BuildInstructions(Guid.Empty, string.Empty, string.Empty);
try
{
instructions = GetBuildInstructions(server);
BuildProject(server, instructions);
ExecuteNUnitTestRunner(server, instructions);
}
catch (FileNotFoundException e)
{
log.Log(LogSeverity.Error, $"The file was not found: {e.FileName}");
var status = new ClientInformation(Environment.MachineName, instructions.Session, BuildStatus.Failed,
new TestResult[0]);
server.UpdateClientStatus(status);
}
catch (Win32Exception e)
{
log.Log(LogSeverity.Error, $"Error launching the build process: {e.Message}");
var status = new ClientInformation(Environment.MachineName, instructions.Session, BuildStatus.Failed,
new TestResult[0]);
server.UpdateClientStatus(status);
}
catch (ApplicationException e)
{
log.Log(LogSeverity.Error, $"Error building the project: {e.Message}");
var status = new ClientInformation(Environment.MachineName, instructions.Session, BuildStatus.Failed,
new TestResult[0]);
server.UpdateClientStatus(status);
}
}
示例15: SelectDatabaseViewModel
public SelectDatabaseViewModel(IServer server, IEventAggregator events)
: base(events)
{
DisplayName = "Home";
Server = server;
ShowCreateDatabaseForm = Visibility.Collapsed;
}