本文整理汇总了C#中IJsonSerializer类的典型用法代码示例。如果您正苦于以下问题:C# IJsonSerializer类的具体用法?C# IJsonSerializer怎么用?C# IJsonSerializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IJsonSerializer类属于命名空间,在下文中一共展示了IJsonSerializer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Connection
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;
}
示例2: RSS
public RSS(string url, IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogger logger)
{
_httpClient = httpClient;
_logger = logger;
_jsonSerializer = jsonSerializer;
this.url = url;
}
示例3: UdpServerEntryPoint
/// <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;
}
示例4: SchedulesDirect
public SchedulesDirect(ILogger logger, IJsonSerializer jsonSerializer, IHttpClient httpClient, IApplicationHost appHost)
{
_logger = logger;
_jsonSerializer = jsonSerializer;
_httpClient = httpClient;
_appHost = appHost;
}
示例5: FilesEventPersistence
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>();
}
}
示例6: ScheduledTaskWorker
/// <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();
}
示例7: TvMazeSeasonImageProvider
public TvMazeSeasonImageProvider(IJsonSerializer jsonSerializer, IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem)
{
_config = config;
_httpClient = httpClient;
_fileSystem = fileSystem;
_jsonSerializer = jsonSerializer;
}
示例8: HtmlTemplateToJavaScriptTransformer
public HtmlTemplateToJavaScriptTransformer(string javaScriptTemplate, HtmlTemplateBundle bundle, IJsonSerializer serializer, IHtmlTemplateIdStrategy idStrategy)
{
this.javaScriptTemplate = javaScriptTemplate;
this.bundle = bundle;
this.serializer = serializer;
this.idStrategy = idStrategy;
}
示例9: ViewHelperImplementation
public ViewHelperImplementation(BundleCollection bundles, IAmdConfiguration configuration, IJsonSerializer jsonSerializer, IRequireJsConfigUrlProvider requireJsConfigUrlProvider)
{
this.bundles = bundles;
this.configuration = configuration;
this.jsonSerializer = jsonSerializer;
this.requireJsConfigUrlProvider = requireJsConfigUrlProvider;
}
示例10: ImageProcessor
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);
}
示例11: FanArtSeasonProvider
public FanArtSeasonProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem, IJsonSerializer json)
{
_config = config;
_httpClient = httpClient;
_fileSystem = fileSystem;
_json = json;
}
示例12: PersistedDictionary
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);
}
示例13: AppThemeManager
public AppThemeManager(IServerApplicationPaths appPaths, IFileSystem fileSystem, IJsonSerializer json, ILogger logger)
{
_appPaths = appPaths;
_fileSystem = fileSystem;
_json = json;
_logger = logger;
}
示例14: CharacterService
/// <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;
}
示例15: FanartAlbumProvider
public FanartAlbumProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem, IJsonSerializer jsonSerializer)
{
_config = config;
_httpClient = httpClient;
_fileSystem = fileSystem;
_jsonSerializer = jsonSerializer;
}