public Transport( IConnectionConfigurationValues configurationValues, IConnection connection, IOrientdbSerializer serializer, IDateTimeProvider dateTimeProvider = null, IMemoryStreamProvider memoryStreamProvider = null ) { ConfigurationValues = configurationValues; Connection = connection ?? new HttpConnection(configurationValues); //_serializer = serializer ?? new OrientdbDefaultSerializer(); _serializer = serializer ?? new OrientdbSerializer(); _connectionPool = ConfigurationValues.ConnectionPool; _dateTimeProvider = dateTimeProvider ?? new DateTimeProvider(); _memoryStreamProvider = memoryStreamProvider ?? new MemoryStreamProvider(); _lastSniff = _dateTimeProvider.Now(); Settings.Serializer = _serializer; _requestHandler = new RequestHandler(Settings, _connectionPool, Connection, _serializer, _memoryStreamProvider, this); _requestHandlerAsync = new RequestHandlerAsync(Settings, _connectionPool, Connection, _serializer, _memoryStreamProvider, this); if (_connectionPool.AcceptsUpdates && Settings.SniffsOnStartup) { Self.SniffClusterState(); } }
public SqliteUserRepository(ILogManager logManager, IServerApplicationPaths appPaths, IJsonSerializer jsonSerializer, IDbConnector dbConnector, IMemoryStreamProvider memoryStreamProvider) : base(logManager, dbConnector) { _jsonSerializer = jsonSerializer; _memoryStreamProvider = memoryStreamProvider; DbFilePath = Path.Combine(appPaths.DataPath, "users.db"); }
/// <summary> /// Initializes a new instance of the <see cref="WebSocketConnection" /> class. /// </summary> /// <param name="socket">The socket.</param> /// <param name="remoteEndPoint">The remote end point.</param> /// <param name="jsonSerializer">The json serializer.</param> /// <param name="logger">The logger.</param> /// <exception cref="System.ArgumentNullException">socket</exception> public WebSocketConnection(IWebSocket socket, string remoteEndPoint, IJsonSerializer jsonSerializer, ILogger logger, IMemoryStreamProvider memoryStreamProvider) { if (socket == null) { throw new ArgumentNullException("socket"); } if (string.IsNullOrEmpty(remoteEndPoint)) { throw new ArgumentNullException("remoteEndPoint"); } if (jsonSerializer == null) { throw new ArgumentNullException("jsonSerializer"); } if (logger == null) { throw new ArgumentNullException("logger"); } Id = Guid.NewGuid(); _jsonSerializer = jsonSerializer; _socket = socket; _socket.OnReceiveBytes = OnReceiveInternal; _socket.OnReceive = OnReceiveInternal; RemoteEndPoint = remoteEndPoint; _logger = logger; _memoryStreamProvider = memoryStreamProvider; socket.Closed += socket_Closed; }
public SqliteDisplayPreferencesRepository(ILogManager logManager, IJsonSerializer jsonSerializer, IApplicationPaths appPaths, IDbConnector dbConnector, IMemoryStreamProvider memoryStreamProvider) : base(logManager, dbConnector) { _jsonSerializer = jsonSerializer; _memoryStreamProvider = memoryStreamProvider; DbFilePath = Path.Combine(appPaths.DataPath, "displaypreferences.db"); }
public SqliteUserRepository(ILogManager logManager, IServerApplicationPaths appPaths, IJsonSerializer jsonSerializer, IDbConnector dbConnector, IMemoryStreamProvider memoryStreamProvider) : base(logManager, dbConnector) { _jsonSerializer = jsonSerializer; _memoryStreamProvider = memoryStreamProvider; DbFilePath = Path.Combine(appPaths.DataPath, "users.db"); }
public Transport( IConnectionConfigurationValues configurationValues, IConnection connection, IElasticsearchSerializer serializer, IDateTimeProvider dateTimeProvider = null, IMemoryStreamProvider memoryStreamProvider = null ) { this.ConfigurationValues = configurationValues; this.Connection = connection ?? new HttpConnection(configurationValues); this._serializer = serializer ?? new ElasticsearchDefaultSerializer(); this._connectionPool = this.ConfigurationValues.ConnectionPool; this._dateTimeProvider = dateTimeProvider ?? new DateTimeProvider(); this._memoryStreamProvider = memoryStreamProvider ?? new MemoryStreamProvider(); this._lastSniff = this._dateTimeProvider.Now(); this.Settings.Serializer = this._serializer; this._requestHandler = new RequestHandler(this.Settings, this._connectionPool, this.Connection, this._serializer, this._memoryStreamProvider, this); this._requestHandlerAsync = new RequestHandlerAsync(this.Settings, this._connectionPool, this.Connection, this._serializer, this._memoryStreamProvider, this); if (this._connectionPool.AcceptsUpdates && this.Settings.SniffsOnStartup) { Self.SniffClusterState(); } }
public SqliteDisplayPreferencesRepository(ILogManager logManager, IJsonSerializer jsonSerializer, IApplicationPaths appPaths, IDbConnector dbConnector, IMemoryStreamProvider memoryStreamProvider) : base(logManager, dbConnector) { _jsonSerializer = jsonSerializer; _memoryStreamProvider = memoryStreamProvider; DbFilePath = Path.Combine(appPaths.DataPath, "displaypreferences.db"); }
/// <summary> /// Initializes a new instance of the <see cref="ImageSaver" /> class. /// </summary> /// <param name="config">The config.</param> /// <param name="libraryMonitor">The directory watchers.</param> /// <param name="fileSystem">The file system.</param> /// <param name="logger">The logger.</param> public ImageSaver(IServerConfigurationManager config, ILibraryMonitor libraryMonitor, IFileSystem fileSystem, ILogger logger, IMemoryStreamProvider memoryStreamProvider) { _config = config; _libraryMonitor = libraryMonitor; _fileSystem = fileSystem; _logger = logger; _memoryStreamProvider = memoryStreamProvider; }
public TicketsController(ITicketsFinder ticketsFinder, ITicketsModifier ticketsModifier, ICategoryFinder categoryFinder, IMemoryStreamProvider memoryStreamProvider) { _ticketsFinder = ticketsFinder; _ticketsModifier = ticketsModifier; _categoryFinder = categoryFinder; _memoryStreamProvider = memoryStreamProvider; }
/// <summary> /// Initializes a new instance of the <see cref="ImageSaver" /> class. /// </summary> /// <param name="config">The config.</param> /// <param name="libraryMonitor">The directory watchers.</param> /// <param name="fileSystem">The file system.</param> /// <param name="logger">The logger.</param> public ImageSaver(IServerConfigurationManager config, ILibraryMonitor libraryMonitor, IFileSystem fileSystem, ILogger logger, IMemoryStreamProvider memoryStreamProvider) { _config = config; _libraryMonitor = libraryMonitor; _fileSystem = fileSystem; _logger = logger; _memoryStreamProvider = memoryStreamProvider; }
public DlnaServerService(IDlnaManager dlnaManager, IContentDirectory contentDirectory, IConnectionManager connectionManager, IMediaReceiverRegistrar mediaReceiverRegistrar, IMemoryStreamProvider memoryStreamProvider) { _dlnaManager = dlnaManager; _contentDirectory = contentDirectory; _connectionManager = connectionManager; _mediaReceiverRegistrar = mediaReceiverRegistrar; _memoryStreamProvider = memoryStreamProvider; }
public WebSocketSharpRequest(HttpListenerContext httpContext, string operationName, RequestAttributes requestAttributes, ILogger logger, IMemoryStreamProvider memoryStreamProvider) { this.OperationName = operationName; this.RequestAttributes = requestAttributes; _memoryStreamProvider = memoryStreamProvider; this.request = httpContext.Request; this.response = new WebSocketSharpResponse(logger, httpContext.Response, this); this.RequestPreferences = new RequestPreferences(this); }
public RequestHandler( IConnectionConfigurationValues settings, IConnectionPool connectionPool, IConnection connection, IElasticsearchSerializer serializer, IMemoryStreamProvider memoryStreamProvider, ITransportDelegator delegator) : base(settings, connection, connectionPool, serializer, memoryStreamProvider, delegator) { }
/// <summary> /// Inits this instance. /// </summary> /// <returns>Task.</returns> public virtual async Task Init(IProgress <double> progress) { try { // https://github.com/ServiceStack/ServiceStack/blob/master/tests/ServiceStack.WebHost.IntegrationTests/Web.config#L4 Licensing.RegisterLicense("1001-e1JlZjoxMDAxLE5hbWU6VGVzdCBCdXNpbmVzcyxUeXBlOkJ1c2luZXNzLEhhc2g6UHVNTVRPclhvT2ZIbjQ5MG5LZE1mUTd5RUMzQnBucTFEbTE3TDczVEF4QUNMT1FhNXJMOWkzVjFGL2ZkVTE3Q2pDNENqTkQyUktRWmhvUVBhYTBiekJGUUZ3ZE5aZHFDYm9hL3lydGlwUHI5K1JsaTBYbzNsUC85cjVJNHE5QVhldDN6QkE4aTlvdldrdTgyTk1relY2eis2dFFqTThYN2lmc0JveHgycFdjPSxFeHBpcnk6MjAxMy0wMS0wMX0="); } catch { // Failing under mono } progress.Report(1); JsonSerializer = CreateJsonSerializer(); if (Environment.OSVersion.Platform == PlatformID.Win32NT) { MemoryStreamProvider = new RecyclableMemoryStreamProvider(); } else { MemoryStreamProvider = new MemoryStreamProvider(); } OnLoggerLoaded(true); LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false); IsFirstRun = !ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted; progress.Report(2); LogManager.LogSeverity = ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging ? LogSeverity.Debug : LogSeverity.Info; progress.Report(3); DiscoverTypes(); progress.Report(14); SetHttpLimit(); progress.Report(15); var innerProgress = new ActionableProgress <double>(); innerProgress.RegisterAction(p => progress.Report(.8 * p + 15)); await RegisterResources(innerProgress).ConfigureAwait(false); FindParts(); progress.Report(95); await InstallIsoMounters(CancellationToken.None).ConfigureAwait(false); progress.Report(100); }
public static ITransport ProvideDefaultTransport( AutoFake fake, IDateTimeProvider dateTimeProvider = null, IMemoryStreamProvider memoryStreamProvider = null ) { var dateTimeParam = new TypedParameter(typeof(IDateTimeProvider), dateTimeProvider); var memoryStreamParam = new TypedParameter(typeof(IMemoryStreamProvider), memoryStreamProvider); var serializerParam = new TypedParameter(typeof(IElasticsearchSerializer), null); return fake.Provide<ITransport, Transport>(dateTimeParam, serializerParam, memoryStreamParam); }
public TargetDataProvider(IServerSyncProvider provider, SyncTarget target, IServerApplicationHost appHost, ILogger logger, IJsonSerializer json, IFileSystem fileSystem, IApplicationPaths appPaths, IMemoryStreamProvider memoryStreamProvider) { _logger = logger; _json = json; _provider = provider; _target = target; _fileSystem = fileSystem; _appPaths = appPaths; _memoryStreamProvider = memoryStreamProvider; _appHost = appHost; }
public static ITransport ProvideDefaultTransport( AutoFake fake, IDateTimeProvider dateTimeProvider = null, IMemoryStreamProvider memoryStreamProvider = null ) { var dateTimeParam = new TypedParameter(typeof(IDateTimeProvider), dateTimeProvider); var memoryStreamParam = new TypedParameter(typeof(IMemoryStreamProvider), memoryStreamProvider); var serializerParam = new TypedParameter(typeof(IElasticsearchSerializer), null); return(fake.Provide <ITransport, Transport>(dateTimeParam, serializerParam, memoryStreamParam)); }
public SubtitleEncoder(ILibraryManager libraryManager, ILogger logger, IApplicationPaths appPaths, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IJsonSerializer json, IHttpClient httpClient, IMediaSourceManager mediaSourceManager, IMemoryStreamProvider memoryStreamProvider) { _libraryManager = libraryManager; _logger = logger; _appPaths = appPaths; _fileSystem = fileSystem; _mediaEncoder = mediaEncoder; _json = json; _httpClient = httpClient; _mediaSourceManager = mediaSourceManager; _memoryStreamProvider = memoryStreamProvider; }
/// <summary> /// Initializes a new instance of the <see cref="ProviderManager" /> class. /// </summary> /// <param name="httpClient">The HTTP client.</param> /// <param name="configurationManager">The configuration manager.</param> /// <param name="libraryMonitor">The directory watchers.</param> /// <param name="logManager">The log manager.</param> /// <param name="fileSystem">The file system.</param> public ProviderManager(IHttpClient httpClient, IServerConfigurationManager configurationManager, ILibraryMonitor libraryMonitor, ILogManager logManager, IFileSystem fileSystem, IServerApplicationPaths appPaths, Func <ILibraryManager> libraryManagerFactory, IJsonSerializer json, IMemoryStreamProvider memoryStreamProvider) { _logger = logManager.GetLogger("ProviderManager"); _httpClient = httpClient; ConfigurationManager = configurationManager; _libraryMonitor = libraryMonitor; _fileSystem = fileSystem; _appPaths = appPaths; _libraryManagerFactory = libraryManagerFactory; _json = json; _memoryStreamProvider = memoryStreamProvider; }
/// <summary> /// Creates the server. /// </summary> /// <returns>IHttpServer.</returns> public static IHttpServer CreateServer(IApplicationHost applicationHost, ILogManager logManager, IServerConfigurationManager config, INetworkManager _networkmanager, IMemoryStreamProvider streamProvider, string serverName, string defaultRedirectpath) { LogManager.LogFactory = new ServerLogFactory(logManager); return(new HttpListenerHost(applicationHost, logManager, config, serverName, defaultRedirectpath, _networkmanager, streamProvider)); }
/// <summary> /// Creates the server. /// </summary> /// <returns>IHttpServer.</returns> public static IHttpServer CreateServer(IApplicationHost applicationHost, ILogManager logManager, IServerConfigurationManager config, INetworkManager _networkmanager, IMemoryStreamProvider streamProvider, string serverName, string defaultRedirectpath) { LogManager.LogFactory = new ServerLogFactory(logManager); return new HttpListenerHost(applicationHost, logManager, config, serverName, defaultRedirectpath, _networkmanager, streamProvider); }
public SubtitleEncoder(ILibraryManager libraryManager, ILogger logger, IApplicationPaths appPaths, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IJsonSerializer json, IHttpClient httpClient, IMediaSourceManager mediaSourceManager, IMemoryStreamProvider memoryStreamProvider) { _libraryManager = libraryManager; _logger = logger; _appPaths = appPaths; _fileSystem = fileSystem; _mediaEncoder = mediaEncoder; _json = json; _httpClient = httpClient; _mediaSourceManager = mediaSourceManager; _memoryStreamProvider = memoryStreamProvider; }
/// <summary> /// Serializes to bytes. /// </summary> /// <returns>System.Byte[][].</returns> /// <exception cref="System.ArgumentNullException">obj</exception> public static byte[] SerializeToBytes(this IJsonSerializer json, object obj, IMemoryStreamProvider streamProvider) { if (obj == null) { throw new ArgumentNullException("obj"); } using (var stream = streamProvider.CreateNew()) { json.SerializeToStream(obj, stream); return(stream.ToArray()); } }
public HttpListenerHost(IApplicationHost applicationHost, ILogManager logManager, IServerConfigurationManager config, string serviceName, string defaultRedirectPath, INetworkManager networkManager, IMemoryStreamProvider memoryStreamProvider, params Assembly[] assembliesWithServices) : base(serviceName, assembliesWithServices) { DefaultRedirectPath = defaultRedirectPath; _networkManager = networkManager; _memoryStreamProvider = memoryStreamProvider; _config = config; _logger = logManager.GetLogger("HttpServer"); _containerAdapter = new ContainerAdapter(applicationHost); }
public HttpListenerHost(IApplicationHost applicationHost, ILogManager logManager, IServerConfigurationManager config, string serviceName, string defaultRedirectPath, INetworkManager networkManager, IMemoryStreamProvider memoryStreamProvider, params Assembly[] assembliesWithServices) : base(serviceName, assembliesWithServices) { DefaultRedirectPath = defaultRedirectPath; _networkManager = networkManager; _memoryStreamProvider = memoryStreamProvider; _config = config; _logger = logManager.GetLogger("HttpServer"); _containerAdapter = new ContainerAdapter(applicationHost); }
protected RequestHandlerBase( IConnectionConfigurationValues settings, IConnection connection, IConnectionPool connectionPool, IOrientdbSerializer serializer, IMemoryStreamProvider memoryStreamProvider, ITransportDelegator delegator) { _settings = settings; _connection = connection; _connectionPool = connectionPool; _serializer = serializer; _memoryStreamProvider = memoryStreamProvider; _delegator = delegator; _throwMaxRetry = !(_connectionPool is SingleNodeConnectionPool); }
static Stream GetSubStream(Stream stream, IMemoryStreamProvider streamProvider) { if (stream is MemoryStream) { var other = (MemoryStream)stream; try { return(new MemoryStream(other.GetBuffer(), 0, (int)other.Length, false, true)); } catch (UnauthorizedAccessException) { return(new MemoryStream(other.ToArray(), 0, (int)other.Length, false, true)); } } return(stream); }
public SyncManager(ILibraryManager libraryManager, ISyncRepository repo, IImageProcessor imageProcessor, ILogger logger, IUserManager userManager, Func<IDtoService> dtoService, IServerApplicationHost appHost, ITVSeriesManager tvSeriesManager, Func<IMediaEncoder> mediaEncoder, IFileSystem fileSystem, Func<ISubtitleEncoder> subtitleEncoder, IConfigurationManager config, IUserDataManager userDataManager, Func<IMediaSourceManager> mediaSourceManager, IJsonSerializer json, ITaskManager taskManager, IMemoryStreamProvider memoryStreamProvider) { _libraryManager = libraryManager; _repo = repo; _imageProcessor = imageProcessor; _logger = logger; _userManager = userManager; _dtoService = dtoService; _appHost = appHost; _tvSeriesManager = tvSeriesManager; _mediaEncoder = mediaEncoder; _fileSystem = fileSystem; _subtitleEncoder = subtitleEncoder; _config = config; _userDataManager = userDataManager; _mediaSourceManager = mediaSourceManager; _json = json; _taskManager = taskManager; _memoryStreamProvider = memoryStreamProvider; }
public SyncManager(ILibraryManager libraryManager, ISyncRepository repo, IImageProcessor imageProcessor, ILogger logger, IUserManager userManager, Func <IDtoService> dtoService, IServerApplicationHost appHost, ITVSeriesManager tvSeriesManager, Func <IMediaEncoder> mediaEncoder, IFileSystem fileSystem, Func <ISubtitleEncoder> subtitleEncoder, IConfigurationManager config, IUserDataManager userDataManager, Func <IMediaSourceManager> mediaSourceManager, IJsonSerializer json, ITaskManager taskManager, IMemoryStreamProvider memoryStreamProvider) { _libraryManager = libraryManager; _repo = repo; _imageProcessor = imageProcessor; _logger = logger; _userManager = userManager; _dtoService = dtoService; _appHost = appHost; _tvSeriesManager = tvSeriesManager; _mediaEncoder = mediaEncoder; _fileSystem = fileSystem; _subtitleEncoder = subtitleEncoder; _config = config; _userDataManager = userDataManager; _mediaSourceManager = mediaSourceManager; _json = json; _taskManager = taskManager; _memoryStreamProvider = memoryStreamProvider; }
/// <summary> /// Initializes a new instance of the <see cref="ServerManager" /> class. /// </summary> /// <param name="applicationHost">The application host.</param> /// <param name="jsonSerializer">The json serializer.</param> /// <param name="logger">The logger.</param> /// <param name="configurationManager">The configuration manager.</param> /// <exception cref="System.ArgumentNullException">applicationHost</exception> public ServerManager(IServerApplicationHost applicationHost, IJsonSerializer jsonSerializer, ILogger logger, IServerConfigurationManager configurationManager, IMemoryStreamProvider memoryStreamProvider) { if (applicationHost == null) { throw new ArgumentNullException("applicationHost"); } if (jsonSerializer == null) { throw new ArgumentNullException("jsonSerializer"); } if (logger == null) { throw new ArgumentNullException("logger"); } _logger = logger; _jsonSerializer = jsonSerializer; _applicationHost = applicationHost; ConfigurationManager = configurationManager; _memoryStreamProvider = memoryStreamProvider; }
/// <summary> /// Gets a stream from a DataReader at a given ordinal /// </summary> /// <returns>Stream.</returns> /// <exception cref="System.ArgumentNullException">reader</exception> public static Stream GetMemoryStream(this IDataReader reader, int ordinal, IMemoryStreamProvider streamProvider) { if (reader == null) { throw new ArgumentNullException("reader"); } var memoryStream = streamProvider.CreateNew(); var num = 0L; var array = new byte[4096]; long bytes; do { bytes = reader.GetBytes(ordinal, num, array, 0, array.Length); memoryStream.Write(array, 0, (int)bytes); num += bytes; } while (bytes > 0L); memoryStream.Position = 0; return memoryStream; }
/// <summary> /// Gets a stream from a DataReader at a given ordinal /// </summary> /// <returns>Stream.</returns> /// <exception cref="System.ArgumentNullException">reader</exception> public static Stream GetMemoryStream(this IDataReader reader, int ordinal, IMemoryStreamProvider streamProvider) { if (reader == null) { throw new ArgumentNullException("reader"); } var memoryStream = streamProvider.CreateNew(); var num = 0L; var array = new byte[4096]; long bytes; do { bytes = reader.GetBytes(ordinal, num, array, 0, array.Length); memoryStream.Write(array, 0, (int)bytes); num += bytes; }while (bytes > 0L); memoryStream.Position = 0; return(memoryStream); }
/// <summary> /// Initializes a new instance of the <see cref="HttpClientManager" /> class. /// </summary> /// <param name="appPaths">The app paths.</param> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <exception cref="System.ArgumentNullException">appPaths /// or /// logger</exception> public HttpClientManager(IApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem, IMemoryStreamProvider memoryStreamProvider) { if (appPaths == null) { throw new ArgumentNullException("appPaths"); } if (logger == null) { throw new ArgumentNullException("logger"); } _logger = logger; _fileSystem = fileSystem; _memoryStreamProvider = memoryStreamProvider; _appPaths = appPaths; // http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c ServicePointManager.Expect100Continue = false; // Trakt requests sometimes fail without this ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls; }
/// <summary> /// Initializes a new instance of the <see cref="HttpClientManager" /> class. /// </summary> /// <param name="appPaths">The app paths.</param> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <exception cref="System.ArgumentNullException">appPaths /// or /// logger</exception> public HttpClientManager(IApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem, IMemoryStreamProvider memoryStreamProvider) { if (appPaths == null) { throw new ArgumentNullException("appPaths"); } if (logger == null) { throw new ArgumentNullException("logger"); } _logger = logger; _fileSystem = fileSystem; _memoryStreamProvider = memoryStreamProvider; _appPaths = appPaths; // http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c ServicePointManager.Expect100Continue = false; // Trakt requests sometimes fail without this ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls; }
public DlnaServerService(IDlnaManager dlnaManager, IContentDirectory contentDirectory, IConnectionManager connectionManager, IMediaReceiverRegistrar mediaReceiverRegistrar, IMemoryStreamProvider memoryStreamProvider) { _dlnaManager = dlnaManager; _contentDirectory = contentDirectory; _connectionManager = connectionManager; _mediaReceiverRegistrar = mediaReceiverRegistrar; _memoryStreamProvider = memoryStreamProvider; }
/// <summary> /// Serializes to bytes. /// </summary> /// <returns>System.Byte[][].</returns> /// <exception cref="System.ArgumentNullException">obj</exception> public static byte[] SerializeToBytes(this IJsonSerializer json, object obj, IMemoryStreamProvider streamProvider) { if (obj == null) { throw new ArgumentNullException("obj"); } using (var stream = streamProvider.CreateNew()) { json.SerializeToStream(obj, stream); return stream.ToArray(); } }
public WebSocketSharpListener(ILogger logger, string certificatePath, IMemoryStreamProvider memoryStreamProvider) { _logger = logger; _certificatePath = certificatePath; _memoryStreamProvider = memoryStreamProvider; }
/// <summary> /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class. /// </summary> public SqliteItemRepository(IServerConfigurationManager config, IJsonSerializer jsonSerializer, ILogManager logManager, IDbConnector connector, IMemoryStreamProvider memoryStreamProvider) : base(logManager, connector) { if (config == null) { throw new ArgumentNullException("config"); } if (jsonSerializer == null) { throw new ArgumentNullException("jsonSerializer"); } _config = config; _jsonSerializer = jsonSerializer; _memoryStreamProvider = memoryStreamProvider; _criticReviewsPath = Path.Combine(_config.ApplicationPaths.DataPath, "critic-reviews"); DbFilePath = Path.Combine(_config.ApplicationPaths.DataPath, "library.db"); }
public MediaEncoder(ILogger logger, IJsonSerializer jsonSerializer, string ffMpegPath, string ffProbePath, bool hasExternalEncoder, IServerConfigurationManager configurationManager, IFileSystem fileSystem, ILiveTvManager liveTvManager, IIsoManager isoManager, ILibraryManager libraryManager, IChannelManager channelManager, ISessionManager sessionManager, Func<ISubtitleEncoder> subtitleEncoder, Func<IMediaSourceManager> mediaSourceManager, IHttpClient httpClient, IZipClient zipClient, IMemoryStreamProvider memoryStreamProvider) { _logger = logger; _jsonSerializer = jsonSerializer; ConfigurationManager = configurationManager; FileSystem = fileSystem; LiveTvManager = liveTvManager; IsoManager = isoManager; LibraryManager = libraryManager; ChannelManager = channelManager; SessionManager = sessionManager; SubtitleEncoder = subtitleEncoder; MediaSourceManager = mediaSourceManager; _httpClient = httpClient; _zipClient = zipClient; _memoryStreamProvider = memoryStreamProvider; FFProbePath = ffProbePath; FFMpegPath = ffMpegPath; _originalFFProbePath = ffProbePath; _originalFFMpegPath = ffMpegPath; _hasExternalEncoder = hasExternalEncoder; }
public ProbeResultNormalizer(ILogger logger, IFileSystem fileSystem, IMemoryStreamProvider memoryStreamProvider) { _logger = logger; _fileSystem = fileSystem; _memoryStreamProvider = memoryStreamProvider; }
public ProbeResultNormalizer(ILogger logger, IFileSystem fileSystem, IMemoryStreamProvider memoryStreamProvider) { _logger = logger; _fileSystem = fileSystem; _memoryStreamProvider = memoryStreamProvider; }
public WebSocketSharpListener(ILogger logger, string certificatePath, IMemoryStreamProvider memoryStreamProvider) { _logger = logger; _certificatePath = certificatePath; _memoryStreamProvider = memoryStreamProvider; }