Example #1
1
        public Connection(IMessageBus newMessageBus,
                          IJsonSerializer jsonSerializer,
                          string baseSignal,
                          string connectionId,
                          IList<string> signals,
                          IList<string> groups,
                          ITraceManager traceManager,
                          IAckHandler ackHandler,
                          IPerformanceCounterManager performanceCounterManager,
                          IProtectedData protectedData)
        {
            if (traceManager == null)
            {
                throw new ArgumentNullException("traceManager");
            }

            _bus = newMessageBus;
            _serializer = jsonSerializer;
            _baseSignal = baseSignal;
            _connectionId = connectionId;
            _signals = new List<string>(signals.Concat(groups));
            _groups = new DiffSet<string>(groups);
            _traceSource = traceManager["SignalR.Connection"];
            _ackHandler = ackHandler;
            _counters = performanceCounterManager;
            _protectedData = protectedData;
        }
 public RokuSessionController(IHttpClient httpClient, IJsonSerializer json, IServerApplicationHost appHost, SessionInfo session)
 {
     _httpClient = httpClient;
     _json = json;
     _appHost = appHost;
     Session = session;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
        /// </summary>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="jsonSerializer">The json serializer.</param>
        /// <param name="logManager">The log manager.</param>
        /// <exception cref="System.ArgumentNullException">
        /// appPaths
        /// or
        /// jsonSerializer
        /// </exception>
        public SqliteItemRepository(IApplicationPaths appPaths, IJsonSerializer jsonSerializer, ILogManager logManager)
        {
            if (appPaths == null)
            {
                throw new ArgumentNullException("appPaths");
            }
            if (jsonSerializer == null)
            {
                throw new ArgumentNullException("jsonSerializer");
            }

            _appPaths = appPaths;
            _jsonSerializer = jsonSerializer;

            _criticReviewsPath = Path.Combine(_appPaths.DataPath, "critic-reviews");

            _logger = logManager.GetLogger(GetType().Name);

            var chapterDbFile = Path.Combine(_appPaths.DataPath, "chapters.db");
            var chapterConnection = SqliteExtensions.ConnectToDb(chapterDbFile, _logger).Result;
            _chapterRepository = new SqliteChapterRepository(chapterConnection, logManager);

            var mediaStreamsDbFile = Path.Combine(_appPaths.DataPath, "mediainfo.db");
            var mediaStreamsConnection = SqliteExtensions.ConnectToDb(mediaStreamsDbFile, _logger).Result;
            _mediaStreamsRepository = new SqliteMediaStreamsRepository(mediaStreamsConnection, logManager);

            var providerInfosDbFile = Path.Combine(_appPaths.DataPath, "providerinfo.db");
            var providerInfoConnection = SqliteExtensions.ConnectToDb(providerInfosDbFile, _logger).Result;
            _providerInfoRepository = new SqliteProviderInfoRepository(providerInfoConnection, logManager);
        }
 public FanArtMovieUpdatesPrescanTask(IJsonSerializer jsonSerializer, IServerConfigurationManager config, ILogger logger, IHttpClient httpClient)
 {
     _jsonSerializer = jsonSerializer;
     _config = config;
     _logger = logger;
     _httpClient = httpClient;
 }
 public RSS(string url, IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogger logger)
 {
     _httpClient = httpClient;
     _logger = logger;
     _jsonSerializer = jsonSerializer;
     this.url = url;
 }
Example #6
0
        public MainWindow()
        {
            InitializeComponent();
            ConnectionsListView.ItemsSource = _storageAccountConnections;
            IDeploymentRepositoryFactory deploymentRepositoryFactory = new DeploymentRepositoryFactory();
            _deploymentRepositoryManager = new DeploymentRepositoryManager(deploymentRepositoryFactory);
            _jsonSerializer = new JsonSerializer(new DiagnosticsTraceWriter());
            _deploymentConfigSerializer = new JsonDeploymentConfigSerializer(_jsonSerializer);
            if (File.Exists(SettingsFilePath))
            {
                string json = File.ReadAllText(SettingsFilePath);
                _storageAccountConnections = _jsonSerializer.Deserialize<List<StorageAccountConnectionInfo>>(json);
                ConnectionsListView.ItemsSource = _storageAccountConnections;
            }

            if (!Directory.Exists(DeploymentsConfigsDirPath))
            {
                Directory.CreateDirectory(DeploymentsConfigsDirPath);
            }

	        _deploymentConfigFileWatcher = new FileSystemWatcher
	        {
		        Path = Path.GetFullPath(DeploymentsConfigsDirPath),
		        NotifyFilter = NotifyFilters.LastWrite,
		        Filter = "*.json"
	        };
	        _deploymentConfigFileWatcher.Changed += OnDeploymentConfigFileChanged;
            _deploymentConfigFileWatcher.EnableRaisingEvents = true;
        }
Example #7
0
        public static async Task<MBRegistrationRecord> GetRegistrationStatus(IHttpClient httpClient, IJsonSerializer jsonSerializer, string feature, string mb2Equivalent = null)
        {
            var mac = GetMacAddress();
            var data = new Dictionary<string, string> {{"feature", feature}, {"key",SupporterKey}, {"mac",mac}, {"mb2equiv",mb2Equivalent}, {"legacykey", LegacyKey} };

            var reg = new RegRecord();
            try
            {
                using (var json = await httpClient.Post(MBValidateUrl, data, CancellationToken.None).ConfigureAwait(false))
                {
                    reg = jsonSerializer.DeserializeFromStream<RegRecord>(json);
                }

                if (reg.registered)
                {
                    LicenseFile.AddRegCheck(feature);
                }

            }
            catch (Exception)
            {
                //if we have trouble obtaining from web - allow it if we've validated in the past 30 days
                reg.registered = LicenseFile.LastChecked(feature) > DateTime.UtcNow.AddDays(-30);
            }

            return new MBRegistrationRecord {IsRegistered = reg.registered, ExpirationDate = reg.expDate, RegChecked = true};
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="UdpServerEntryPoint" /> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="networkManager">The network manager.</param>
 /// <param name="appHost">The application host.</param>
 /// <param name="json">The json.</param>
 public UdpServerEntryPoint(ILogger logger, INetworkManager networkManager, IServerApplicationHost appHost, IJsonSerializer json)
 {
     _logger = logger;
     _networkManager = networkManager;
     _appHost = appHost;
     _json = json;
 }
Example #9
0
        public OmdbProvider(IJsonSerializer jsonSerializer, IHttpClient httpClient)
        {
            _jsonSerializer = jsonSerializer;
            _httpClient = httpClient;

            Current = this;
        }
Example #10
0
 public SchedulesDirect(ILogger logger, IJsonSerializer jsonSerializer, IHttpClient httpClient, IApplicationHost appHost)
 {
     _logger = logger;
     _jsonSerializer = jsonSerializer;
     _httpClient = httpClient;
     _appHost = appHost;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow" /> class.
        /// </summary>
        /// <param name="logManager">The log manager.</param>
        /// <param name="appHost">The app host.</param>
        /// <param name="configurationManager">The configuration manager.</param>
        /// <param name="userManager">The user manager.</param>
        /// <param name="libraryManager">The library manager.</param>
        /// <param name="jsonSerializer">The json serializer.</param>
        /// <param name="displayPreferencesManager">The display preferences manager.</param>
        /// <exception cref="System.ArgumentNullException">logger</exception>
        public MainWindow(ILogManager logManager, IServerApplicationHost appHost, IServerConfigurationManager configurationManager, IUserManager userManager, ILibraryManager libraryManager, IJsonSerializer jsonSerializer, IDisplayPreferencesRepository displayPreferencesManager)
        {
            if (logManager == null)
            {
                throw new ArgumentNullException("logManager");
            }
            if (appHost == null)
            {
                throw new ArgumentNullException("appHost");
            }
            if (configurationManager == null)
            {
                throw new ArgumentNullException("configurationManager");
            }

            _logger = logManager.GetLogger("MainWindow");
            _appHost = appHost;
            _logManager = logManager;
            _configurationManager = configurationManager;
            _userManager = userManager;
            _libraryManager = libraryManager;
            _jsonSerializer = jsonSerializer;
            _displayPreferencesManager = displayPreferencesManager;

            InitializeComponent();

            Loaded += MainWindowLoaded;
        }
Example #12
0
        public FilesEventPersistence(
            ILog log,
            IJsonSerializer jsonSerializer,
            IFilesEventStoreConfiguration configuration,
            IFilesEventLocator filesEventLocator)
        {
            _log = log;
            _jsonSerializer = jsonSerializer;
            _filesEventLocator = filesEventLocator;
            _logFilePath = Path.Combine(configuration.StorePath, "Log.store");

            if (File.Exists(_logFilePath))
            {
                var json = File.ReadAllText(_logFilePath);
                var eventStoreLog = _jsonSerializer.Deserialize<EventStoreLog>(json);
                _globalSequenceNumber = eventStoreLog.GlobalSequenceNumber;
                _eventLog = eventStoreLog.Log ?? new Dictionary<long, string>();

                if (_eventLog.Count != _globalSequenceNumber)
                {
                    eventStoreLog = RecreateEventStoreLog(configuration.StorePath);
                    _globalSequenceNumber = eventStoreLog.GlobalSequenceNumber;
                    _eventLog = eventStoreLog.Log;
                }
            }
            else
            {
                _eventLog = new Dictionary<long, string>();
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="jsonSerializer"></param>
 /// <param name="userManager"></param>
 /// <param name="userDataManager"> </param>
 /// <param name="httpClient"></param>
 /// <param name="appHost"></param>
 /// <param name="fileSystem"></param>
 public SyncFromTraktTask(ILogManager logger, IJsonSerializer jsonSerializer, IUserManager userManager, IUserDataManager userDataManager, IHttpClient httpClient, IServerApplicationHost appHost, IFileSystem fileSystem)
 {
     _userManager = userManager;
     _userDataManager = userDataManager;
     _logger = logger.GetLogger("Trakt");
     _traktApi = new TraktApi(jsonSerializer, _logger, httpClient, appHost, userDataManager, fileSystem);
 }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduledTaskWorker" /> class.
        /// </summary>
        /// <param name="scheduledTask">The scheduled task.</param>
        /// <param name="applicationPaths">The application paths.</param>
        /// <param name="taskManager">The task manager.</param>
        /// <param name="jsonSerializer">The json serializer.</param>
        /// <param name="logger">The logger.</param>
        /// <exception cref="System.ArgumentNullException">
        /// scheduledTask
        /// or
        /// applicationPaths
        /// or
        /// taskManager
        /// or
        /// jsonSerializer
        /// or
        /// logger
        /// </exception>
        public ScheduledTaskWorker(IScheduledTask scheduledTask, IApplicationPaths applicationPaths, ITaskManager taskManager, IJsonSerializer jsonSerializer, ILogger logger, IFileSystem fileSystem)
        {
            if (scheduledTask == null)
            {
                throw new ArgumentNullException("scheduledTask");
            }
            if (applicationPaths == null)
            {
                throw new ArgumentNullException("applicationPaths");
            }
            if (taskManager == null)
            {
                throw new ArgumentNullException("taskManager");
            }
            if (jsonSerializer == null)
            {
                throw new ArgumentNullException("jsonSerializer");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            ScheduledTask = scheduledTask;
            ApplicationPaths = applicationPaths;
            TaskManager = taskManager;
            JsonSerializer = jsonSerializer;
            Logger = logger;
            _fileSystem = fileSystem;

            InitTriggerEvents();
        }
Example #15
0
 static LogManager()
 {
     _configuration = PulsusConfiguration.Default;
     _eventsFactory = new DefaultEventFactory();
     _eventDispatcher = new DefaultEventDispatcher(_configuration);
     _jsonSerializer = new JsonNetSerializer();
 }
 public TvMazeSeasonImageProvider(IJsonSerializer jsonSerializer, IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem)
 {
     _config = config;
     _httpClient = httpClient;
     _fileSystem = fileSystem;
     _jsonSerializer = jsonSerializer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LastfmArtistProvider"/> class.
 /// </summary>
 /// <param name="jsonSerializer">The json serializer.</param>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="logManager">The log manager.</param>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="providerManager">The provider manager.</param>
 /// <param name="libraryManager">The library manager.</param>
 public LastfmArtistProvider(IJsonSerializer jsonSerializer, IHttpClient httpClient, ILogManager logManager, IServerConfigurationManager configurationManager, IProviderManager providerManager, ILibraryManager libraryManager)
     : base(jsonSerializer, httpClient, logManager, configurationManager)
 {
     _providerManager = providerManager;
     LibraryManager = libraryManager;
     LocalMetaFileName = LastfmHelper.LocalArtistMetaFileName;
 }
Example #18
0
 public SendReplyService()
 {
     _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
     _sendReplyRemotingClientDict = new ConcurrentDictionary<string, SocketRemotingClient>();
     _remotingClientWaitHandleDict = new ConcurrentDictionary<string, ManualResetEvent>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
Example #19
0
 public FanartAlbumProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem, IJsonSerializer jsonSerializer)
 {
     _config = config;
     _httpClient = httpClient;
     _fileSystem = fileSystem;
     _jsonSerializer = jsonSerializer;
 }
Example #20
0
        public static async Task<MBRegistrationRecord> GetRegistrationStatus(IHttpClient httpClient, IJsonSerializer jsonSerializer, string feature, string mb2Equivalent = null, string version = null)
        {
            //check the reg file first to alleviate strain on the MB admin server - must actually check in every 30 days tho
            var reg = new RegRecord {registered = LicenseFile.LastChecked(feature) > DateTime.UtcNow.AddDays(-30)};

            if (!reg.registered)
            {
                var mac = _networkManager.GetMacAddress();
                var data = new Dictionary<string, string> { { "feature", feature }, { "key", SupporterKey }, { "mac", mac }, { "mb2equiv", mb2Equivalent }, { "legacykey", LegacyKey }, { "ver", version }, { "platform", Environment.OSVersion.VersionString } };

                try
                {
                    using (var json = await httpClient.Post(MBValidateUrl, data, CancellationToken.None).ConfigureAwait(false))
                    {
                        reg = jsonSerializer.DeserializeFromStream<RegRecord>(json);
                    }

                    if (reg.registered)
                    {
                        LicenseFile.AddRegCheck(feature);
                    }
                    else
                    {
                        LicenseFile.RemoveRegCheck(feature);
                    }

                }
                catch (Exception e)
                {
                    _logger.ErrorException("Error checking registration status of {0}", e, feature);
                }
            }

            return new MBRegistrationRecord {IsRegistered = reg.registered, ExpirationDate = reg.expDate, RegChecked = true};
        }
Example #21
0
 protected BaseTunerHost(IConfigurationManager config, ILogger logger, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder)
 {
     Config = config;
     Logger = logger;
     JsonSerializer = jsonSerializer;
     MediaEncoder = mediaEncoder;
 }
Example #22
0
        internal static bool TryGetCommand(Message message, IJsonSerializer serializer, out SignalCommand command)
        {
            command = null;
            if (!message.SignalKey.EndsWith(SignalrCommand, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            command = message.Value as SignalCommand;

            // Optimization for in memory message store
            if (command != null)
            {
                return true;
            }

            // Otherwise deserialize the message value
            string rawValue = message.Value as string;
            if (rawValue == null)
            {
                return false;
            }

            command = serializer.Parse<SignalCommand>(rawValue);
            return true;
        }
 public ViewHelperImplementation(BundleCollection bundles, IAmdConfiguration configuration, IJsonSerializer jsonSerializer, IRequireJsConfigUrlProvider requireJsConfigUrlProvider)
 {
     this.bundles = bundles;
     this.configuration = configuration;
     this.jsonSerializer = jsonSerializer;
     this.requireJsConfigUrlProvider = requireJsConfigUrlProvider;
 }
Example #24
0
        public ImageProcessor(ILogger logger, IServerApplicationPaths appPaths, IFileSystem fileSystem, IJsonSerializer jsonSerializer)
        {
            _logger = logger;
            _fileSystem = fileSystem;
            _jsonSerializer = jsonSerializer;
            _appPaths = appPaths;

            _saveImageSizeTimer = new Timer(SaveImageSizeCallback, null, Timeout.Infinite, Timeout.Infinite);

            Dictionary<Guid, ImageSize> sizeDictionary;

            try
            {
                sizeDictionary = jsonSerializer.DeserializeFromFile<Dictionary<Guid, ImageSize>>(ImageSizeFile) ?? 
                    new Dictionary<Guid, ImageSize>();
            }
            catch (FileNotFoundException)
            {
                // No biggie
                sizeDictionary = new Dictionary<Guid, ImageSize>();
            }
            catch (Exception ex)
            {
                logger.ErrorException("Error parsing image size cache file", ex);

                sizeDictionary = new Dictionary<Guid, ImageSize>();
            }

            _cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MovieDbImagesProvider"/> class.
 /// </summary>
 /// <param name="logManager">The log manager.</param>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="providerManager">The provider manager.</param>
 /// <param name="jsonSerializer">The json serializer.</param>
 /// <param name="httpClient">The HTTP client.</param>
 public MovieDbImagesProvider(ILogManager logManager, IServerConfigurationManager configurationManager, IProviderManager providerManager, IJsonSerializer jsonSerializer, IHttpClient httpClient)
     : base(logManager, configurationManager)
 {
     _providerManager = providerManager;
     _jsonSerializer = jsonSerializer;
     _httpClient = httpClient;
 }
 public PersistedDictionary(string path, IObjectStorage objectStorage, IJsonSerializer serializer, int delay = 250) {
     _objectStorage = objectStorage;
     _path = path;
     _delay = delay;
     Changed += OnChanged;
     _timer = new Timer(OnSaveTimer, null, -1, -1);
 }
 public FanArtSeasonProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem, IJsonSerializer json)
 {
     _config = config;
     _httpClient = httpClient;
     _fileSystem = fileSystem;
     _json = json;
 }
Example #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterService"/> class.
 /// </summary>
 /// <param name="webRequestor">The web requestor.</param>
 /// <param name="jsonSerializer">The JSON serializer.</param>
 public CharacterService(
     IWebRequestor webRequestor,
     IJsonSerializer jsonSerializer)
     : base(jsonSerializer)
 {
     this.webRequestor = webRequestor;
 }
 public AppThemeManager(IServerApplicationPaths appPaths, IFileSystem fileSystem, IJsonSerializer json, ILogger logger)
 {
     _appPaths = appPaths;
     _fileSystem = fileSystem;
     _json = json;
     _logger = logger;
 }
 public HtmlTemplateToJavaScriptTransformer(string javaScriptTemplate, HtmlTemplateBundle bundle, IJsonSerializer serializer, IHtmlTemplateIdStrategy idStrategy)
 {
     this.javaScriptTemplate = javaScriptTemplate;
     this.bundle = bundle;
     this.serializer = serializer;
     this.idStrategy = idStrategy;
 }
        public SmsVitriniClient(string userName, string password, TimeSpan timeOut, IPhoneNumberValidator phoneNumberValidator, IJsonSerializer serializer)
        {
            if (String.IsNullOrEmpty(userName))
            {
                throw new ArgumentNullException("userName");
            }

            if (String.IsNullOrEmpty(password))
            {
                throw new ArgumentNullException("password");
            }

            if (serializer == null)
            {
                throw new ArgumentNullException("serializer");
            }

            _userName             = userName;
            _password             = password;
            _timeOut              = timeOut;
            _serializer           = serializer;
            _phoneNumberValidator = phoneNumberValidator;
        }
 public MediaInfoService(IMediaSourceManager mediaSourceManager, IDeviceManager deviceManager, ILibraryManager libraryManager, IServerConfigurationManager config, INetworkManager networkManager, IMediaEncoder mediaEncoder, IUserManager userManager, IJsonSerializer json)
 {
     _mediaSourceManager = mediaSourceManager;
     _deviceManager      = deviceManager;
     _libraryManager     = libraryManager;
     _config             = config;
     _networkManager     = networkManager;
     _mediaEncoder       = mediaEncoder;
     _userManager        = userManager;
     _json = json;
 }
Example #33
0
 public ProcessingCommandMailbox(string aggregateRootId, IProcessingCommandHandler messageHandler, IJsonSerializer jsonSerializer, ILogger logger)
 {
     _messageDict            = new ConcurrentDictionary <long, ProcessingCommand>();
     _duplicateCommandIdDict = new ConcurrentDictionary <string, byte>();
     _messageHandler         = messageHandler;
     _jsonSerializer         = jsonSerializer;
     _logger         = logger;
     _batchSize      = ENodeConfiguration.Instance.Setting.CommandMailBoxProcessBatchSize;
     AggregateRootId = aggregateRootId;
     LastActiveTime  = DateTime.Now;
 }
Example #34
0
        public DefaultEventQueue(ExceptionlessConfiguration config, IExceptionlessLog log, ISubmissionClient client, IObjectStorage objectStorage, IJsonSerializer serializer, TimeSpan?processQueueInterval, TimeSpan?queueStartDelay)
        {
            _log        = log;
            _config     = config;
            _client     = client;
            _storage    = objectStorage;
            _serializer = serializer;
            if (processQueueInterval.HasValue)
            {
                _processQueueInterval = processQueueInterval.Value;
            }

            _queueTimer = new Timer(OnProcessQueue, null, queueStartDelay ?? TimeSpan.FromSeconds(2), _processQueueInterval);
        }
Example #35
0
 public DefaultEventQueue(ExceptionlessConfiguration config, IExceptionlessLog log, ISubmissionClient client, IObjectStorage objectStorage, IJsonSerializer serializer) : this(config, log, client, objectStorage, serializer, null, null)
 {
 }
Example #36
0
 public DynamicHlsService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager, IZipClient zipClient, IJsonSerializer jsonSerializer, INetworkManager networkManager)
     : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, dlnaManager, subtitleEncoder, deviceManager, mediaSourceManager, zipClient, jsonSerializer)
 {
     NetworkManager = networkManager;
 }
Example #37
0
 public EncodedRecorder(ILogger logger, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IServerApplicationPaths appPaths, IJsonSerializer json, LiveTvOptions liveTvOptions, IHttpClient httpClient, IProcessFactory processFactory, IServerConfigurationManager config)
 {
     _logger         = logger;
     _fileSystem     = fileSystem;
     _mediaEncoder   = mediaEncoder;
     _appPaths       = appPaths;
     _json           = json;
     _liveTvOptions  = liveTvOptions;
     _httpClient     = httpClient;
     _processFactory = processFactory;
     _config         = config;
 }
Example #38
0
 public EthController(IWeb3EthApi web3EthApi, IWeb3HandlerResolver handlerResolver, IJsonSerializer jsonSerializer)
 {
     _web3EthApi      = web3EthApi ?? throw new ArgumentNullException(nameof(web3EthApi));
     _handlerResolver = handlerResolver ?? throw new ArgumentNullException(nameof(handlerResolver));
     _jsonSerializer  = jsonSerializer ?? throw new ArgumentNullException(nameof(jsonSerializer));
 }
Example #39
0
 /// <summary>
 /// Creates an instance of <see cref="JwtValidator" />
 /// </summary>
 /// <param name="jsonSerializer">The Json Serializer</param>
 /// <param name="dateTimeProvider">The DateTime Provider</param>
 public JwtValidator(IJsonSerializer jsonSerializer, IDateTimeProvider dateTimeProvider)
 {
     _jsonSerializer   = jsonSerializer;
     _dateTimeProvider = dateTimeProvider;
 }
Example #40
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpResultFactory" /> class.
 /// </summary>
 /// <param name="logManager">The log manager.</param>
 /// <param name="fileSystem">The file system.</param>
 /// <param name="jsonSerializer">The json serializer.</param>
 public HttpResultFactory(ILogManager logManager, IFileSystem fileSystem, IJsonSerializer jsonSerializer)
 {
     _fileSystem     = fileSystem;
     _jsonSerializer = jsonSerializer;
     _logger         = logManager.GetLogger("HttpResultFactory");
 }
Example #41
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpResultFactory" /> class.
 /// </summary>
 public HttpResultFactory(ILoggerFactory loggerfactory, IFileSystem fileSystem, IJsonSerializer jsonSerializer, IBrotliCompressor brotliCompressor)
 {
     _fileSystem       = fileSystem;
     _jsonSerializer   = jsonSerializer;
     _brotliCompressor = brotliCompressor;
     _logger           = loggerfactory.CreateLogger("HttpResultFactory");
 }
Example #42
0
 public HdHomerunDiscovery(IDeviceDiscovery deviceDiscovery, IServerConfigurationManager config, ILogger logger, ILiveTvManager liveTvManager, IHttpClient httpClient, IJsonSerializer json)
 {
     _deviceDiscovery = deviceDiscovery;
     _config          = config;
     _logger          = logger;
     _liveTvManager   = liveTvManager;
     _httpClient      = httpClient;
     _json            = json;
 }
Example #43
0
        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");
        }
Example #44
0
 public KlarnaClient(IKlarnaSession session)
 {
     Session         = session;
     _client         = CreateRestClient();
     _jsonSerializer = new Klarna.Serialization.JsonSerializer();
 }
Example #45
0
 public SendQueueMessageService()
 {
     _jsonSerializer = ObjectContainer.Resolve <IJsonSerializer>();
     _logger         = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
 }
Example #46
0
 public RabbitMqProducer(RabbitMqPrimitiveProducer primitivePublisher, string queueName, IJsonSerializer serializer)
 {
     this.primitivePublisher = primitivePublisher;
     this.queueName          = queueName;
     this.serializer         = serializer;
 }
Example #47
0
 public SubtitleEncoder(ILibraryManager libraryManager, ILogger logger, IApplicationPaths appPaths, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IJsonSerializer json)
 {
     _libraryManager = libraryManager;
     _logger         = logger;
     _appPaths       = appPaths;
     _fileSystem     = fileSystem;
     _mediaEncoder   = mediaEncoder;
     _json           = json;
 }
Example #48
0
        public UserManager(ILogger logger, IServerConfigurationManager configurationManager, IUserRepository userRepository, IXmlSerializer xmlSerializer, INetworkManager networkManager, Func <IImageProcessor> imageProcessorFactory, Func <IDtoService> dtoServiceFactory, Func <IConnectManager> connectFactory, IServerApplicationHost appHost, IJsonSerializer jsonSerializer, IFileSystem fileSystem)
        {
            _logger                = logger;
            UserRepository         = userRepository;
            _xmlSerializer         = xmlSerializer;
            _networkManager        = networkManager;
            _imageProcessorFactory = imageProcessorFactory;
            _dtoServiceFactory     = dtoServiceFactory;
            _connectFactory        = connectFactory;
            _appHost               = appHost;
            _jsonSerializer        = jsonSerializer;
            _fileSystem            = fileSystem;
            ConfigurationManager   = configurationManager;
            Users = new List <User>();

            DeletePinFile();
        }
Example #49
0
 public TmdbImageProvider(IJsonSerializer jsonSerializer, IHttpClientFactory httpClientFactory, IFileSystem fileSystem)
 {
     _jsonSerializer    = jsonSerializer;
     _httpClientFactory = httpClientFactory;
     _fileSystem        = fileSystem;
 }
 public JsonHistoryRepositoryBase(IJsonSerializer serializer, string storageFile)
 {
     _serializer  = serializer;
     _storageFile = storageFile;
 }
Example #51
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DashboardService" /> class.
 /// </summary>
 /// <param name="appHost">The app host.</param>
 /// <param name="serverConfigurationManager">The server configuration manager.</param>
 /// <param name="fileSystem">The file system.</param>
 public DashboardService(IServerApplicationHost appHost, IServerConfigurationManager serverConfigurationManager, IFileSystem fileSystem, ILocalizationManager localization, IJsonSerializer jsonSerializer)
 {
     _appHost = appHost;
     _serverConfigurationManager = serverConfigurationManager;
     _fileSystem     = fileSystem;
     _localization   = localization;
     _jsonSerializer = jsonSerializer;
 }
Example #52
0
        public ImageProcessor(ILogger logger, IServerApplicationPaths appPaths, IFileSystem fileSystem, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder)
        {
            _logger         = logger;
            _fileSystem     = fileSystem;
            _jsonSerializer = jsonSerializer;
            _mediaEncoder   = mediaEncoder;
            _appPaths       = appPaths;

            _saveImageSizeTimer = new Timer(SaveImageSizeCallback, null, Timeout.Infinite, Timeout.Infinite);

            Dictionary <Guid, ImageSize> sizeDictionary;

            try
            {
                sizeDictionary = jsonSerializer.DeserializeFromFile <Dictionary <Guid, ImageSize> >(ImageSizeFile) ??
                                 new Dictionary <Guid, ImageSize>();
            }
            catch (FileNotFoundException)
            {
                // No biggie
                sizeDictionary = new Dictionary <Guid, ImageSize>();
            }
            catch (Exception ex)
            {
                logger.ErrorException("Error parsing image size cache file", ex);

                sizeDictionary = new Dictionary <Guid, ImageSize>();
            }

            _cachedImagedSizes = new ConcurrentDictionary <Guid, ImageSize>(sizeDictionary);
        }
Example #53
0
 public SettingsResponse GetSettings(ExceptionlessConfiguration config, IJsonSerializer serializer)
 {
     return(new SettingsResponse(true));
 }
Example #54
0
 public EthModule(IJsonSerializer jsonSerializer, IConfigProvider configProvider, ILogManager logManager, IBlockchainBridge blockchainBridge) : base(configProvider, logManager, jsonSerializer)
 {
     _blockchainBridge = blockchainBridge;
 }
Example #55
0
 public SubmissionResponse PostEvents(IEnumerable <Event> events, ExceptionlessConfiguration config, IJsonSerializer serializer)
 {
     foreach (Event e in events)
     {
         string data        = serializer.Serialize(e);
         string referenceId = !string.IsNullOrWhiteSpace(e.ReferenceId)
             ? e.ReferenceId
             : Guid.NewGuid().ToString("D");
         _eventRepository[referenceId] = data;
     }
     return(new SubmissionResponse(200));
 }
Example #56
0
 /// <summary>
 /// creates a new <see cref="ConditionalExpressionSerializer"/>
 /// </summary>
 /// <param name="serializer"></param>
 public ConditionalExpressionSerializer(IJsonSerializer serializer)
 {
     this.serializer = serializer;
 }
Example #57
0
 public LiveTvService(IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogger logger)
 {
     _httpClient     = httpClient;
     _jsonSerializer = jsonSerializer;
     _logger         = logger;
 }
Example #58
0
        public SubmissionResponse PostUserDescription(string referenceId, UserDescription description, ExceptionlessConfiguration config, IJsonSerializer serializer)
        {
            string data = serializer.Serialize(description);

            _userDescriptionRepository[referenceId] = data;
            return(new SubmissionResponse(200));
        }
Example #59
0
 public FanArtSeasonProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem, IJsonSerializer json)
 {
     _config     = config;
     _httpClient = httpClient;
     _fileSystem = fileSystem;
     _json       = json;
 }
Example #60
0
 /// <summary>
 /// Sets JWT serializer.
 /// </summary>
 /// <remarks>
 /// If not set then default <see cref="JsonNetSerializer" /> will be used.
 /// </remarks>
 /// <returns>Current builder instance</returns>
 public JwtBuilder WithSerializer(IJsonSerializer serializer)
 {
     _serializer = serializer;
     return(this);
 }