public AuthKeyNegotiator( [NotNull] IClientTransportConfig clientTransportConfig, [NotNull] IMTProtoClientBuilder mtProtoBuilder, [NotNull] TLRig tlRig, [NotNull] INonceGenerator nonceGenerator, [NotNull] IHashServices hashServices, [NotNull] IEncryptionServices encryptionServices, [NotNull] IKeyChain keyChain) { Argument.IsNotNull(() => clientTransportConfig); Argument.IsNotNull(() => mtProtoBuilder); Argument.IsNotNull(() => tlRig); Argument.IsNotNull(() => nonceGenerator); Argument.IsNotNull(() => hashServices); Argument.IsNotNull(() => encryptionServices); Argument.IsNotNull(() => keyChain); _clientTransportConfig = clientTransportConfig; _mtProtoBuilder = mtProtoBuilder; _tlRig = tlRig; _nonceGenerator = nonceGenerator; _hashServices = hashServices; _encryptionServices = encryptionServices; _keyChain = keyChain; }
public TelegramClient(IClientTransportConfig transportConfig, ConnectionConfig connectionConfig, TelegramAppInfo appInfo, IMTProtoClientBuilder builder = null) { if (builder == null) { builder = MTProtoClientBuilder.Default; } _transportConfig = transportConfig; _appInfo = appInfo; _connection = builder.BuildConnection(_transportConfig); _connection.Configure(connectionConfig); _methods = new TelegramAsyncMethods(_connection); }
public AuthKeyNegotiator( [NotNull] IClientTransportConfig clientTransportConfig, [NotNull] IMTProtoClientBuilder mtProtoBuilder, [NotNull] TLRig tlRig, [NotNull] INonceGenerator nonceGenerator, [NotNull] IHashServices hashServices, [NotNull] IEncryptionServices encryptionServices, [NotNull] IKeyChain keyChain) { _clientTransportConfig = clientTransportConfig; _mtProtoBuilder = mtProtoBuilder; _tlRig = tlRig; _nonceGenerator = nonceGenerator; _hashServices = hashServices; _encryptionServices = encryptionServices; _keyChain = keyChain; }
static MTProtoClientBuilder() { Default = CreateDefault(); }