本文整理汇总了C#中IConnectionManager.GetClientConnection方法的典型用法代码示例。如果您正苦于以下问题:C# IConnectionManager.GetClientConnection方法的具体用法?C# IConnectionManager.GetClientConnection怎么用?C# IConnectionManager.GetClientConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConnectionManager
的用法示例。
在下文中一共展示了IConnectionManager.GetClientConnection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Session
public Session(string target, IConnectionManager connectionManager)
{
this.connectionManager = connectionManager;
this.Target = target;
this.Name = target;
this.connection = connectionManager.GetClientConnection(target);
if (connection == null)
{
connection = connectionManager.AddClientConnection(target);
connection.ConnectionReset += connection_ConnectionReset;
connection.ConnectionTimedOut += connection_ConnectionTimedOut;
connection.RemoteErrorOccurred += connection_RemoteErrorOccurred;
}
//authComponent = (AuthenticationComponent)connection.GetClientComponent(ComponentNamesExtended.Authentication);
//clientInfoComponent = (ClientInfoClientComponent)connection.GetClientComponent(ComponentNamesExtended.ClientInfoProvider);
//loggingConfigurator = (XmppLoggingConfiguratorComponent)connection.GetClientComponent(ComponentNamesExtended.XmppLoggingConfigurator);
//fileShareComponent = (FileShareClientComponent)connection.GetClientComponent(ComponentNamesExtended.FileShare);
authComponent = new AuthenticationComponent() { ClientConnection = connection };
clientInfoComponent = new ClientInfoClientComponent() { ClientConnection = connection };
loggingConfigurator = new XmppLoggingConfiguratorComponent() { ClientConnection = connection };
fileShareComponent = new FileShareClientComponent() { ClientConnection = connection };
//CommandInfo info = new CommandInfo();
commands.Add("get-status", new CommandInfo() { ParameterCount = 0, CommandMethod = getStatusCommand, CheckConnection = false});
commands.Add("connect", new CommandInfo() { ParameterCount = 0, CommandMethod = connectCommand, CheckConnection = false });
commands.Add("disconnect", new CommandInfo() { ParameterCount = 0, CommandMethod = disconnectCommand });
commands.Add("userauth", new CommandInfo() { ParameterCount = 1, CommandMethod = userauthCommand });
commands.Add("get-info", new CommandInfo() { ParameterCount = 0, CommandMethod = getInfoCommand });
commands.Add("exit-session", new CommandInfo() { CheckConnection=false, ParameterCount = 0, CommandMethod = exitSessionCommand });
commands.Add("logger.get-enabled", new CommandInfo() { ParameterCount = 0, CommandMethod = loggerGetEnabledCommand });
commands.Add("logger.set-enabled", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerSetEnabledCommand });
commands.Add("logger.get-loglevel", new CommandInfo() { ParameterCount = 0, CommandMethod = loggerGetLogLevelCommand });
commands.Add("logger.set-loglevel", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerSetLogLevelCommand });
commands.Add("logger.get-recipient", new CommandInfo() { ParameterCount = 0, CommandMethod = loggerGetRecipientCommand });
commands.Add("logger.set-recipient", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerSetRecipientCommand });
commands.Add("logger.get-debuglogging", new CommandInfo() { ParameterCount = 0, CommandMethod = loggerGetDebugLoggingCommand });
commands.Add("logger.set-debuglogging", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerSetDebugLoggingCommand });
commands.Add("logger.test-logging", new CommandInfo() { ParameterCount = 1, CommandMethod = loggerTestLoggingCommand });
commands.Add("fileshare.add-directory", new CommandInfo() { ParameterCount = 2, CommandMethod = fileshareAddDirectoryCommand });
commands.Add("fileshare.remove-directory", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareRemoveDirectoryCommand });
commands.Add("fileshare.get-directory", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareGetDirectoryCommand });
commands.Add("fileshare.get-file", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareGetFileCommand });
commands.Add("fileshare.add-permission", new CommandInfo() { ParameterCount = -2, CommandMethod = fileshareAddPermissionCommand });
commands.Add("fileshare.remove-permission", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareRemovePermissionCommand });
commands.Add("fileshare.get-mounts", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareGetMountsCommand });
commands.Add("fileshare.check-permission", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareCheckPermissionCommand });
commands.Add("fileshare.get-permissions", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareGetPermissionsCommand });
commands.Add("fileshare.get-rootdirectory", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareGetRootDirectoryCommand });
commands.Add("fileshare.set-rootdirectory", new CommandInfo() { ParameterCount = 1, CommandMethod = fileshareSetRootDirectoryCommand });
commands.Add("fileshare.create-snapshot", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareCreateSnapshotCommand });
commands.Add("fileshare.get-snapshots", new CommandInfo() { ParameterCount = 0, CommandMethod = fileshareGetSnapshotsCommand });
}