• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IJsonSerializer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IJsonSerializer的典型用法代码示例。如果您正苦于以下问题:C# IJsonSerializer类的具体用法?C# IJsonSerializer怎么用?C# IJsonSerializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IJsonSerializer类属于命名空间,在下文中一共展示了IJsonSerializer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
        }
开发者ID:Djohnnie,项目名称:Sonarr,代码行数:27,代码来源:Connection.cs


示例2: RSS

 public RSS(string url, IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogger logger)
 {
     _httpClient = httpClient;
     _logger = logger;
     _jsonSerializer = jsonSerializer;
     this.url = url;
 }
开发者ID:Techywarrior,项目名称:MediaBrowser.Channels,代码行数:7,代码来源:RSS.cs


示例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;
 }
开发者ID:jabbera,项目名称:MediaBrowser,代码行数:14,代码来源:UdpServerEntryPoint.cs


示例4: SchedulesDirect

 public SchedulesDirect(ILogger logger, IJsonSerializer jsonSerializer, IHttpClient httpClient, IApplicationHost appHost)
 {
     _logger = logger;
     _jsonSerializer = jsonSerializer;
     _httpClient = httpClient;
     _appHost = appHost;
 }
开发者ID:softworkz,项目名称:Emby,代码行数:7,代码来源:SchedulesDirect.cs


示例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>();
            }
        }
开发者ID:liemqv,项目名称:EventFlow,代码行数:30,代码来源:FilesEventPersistence.cs


示例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();
        }
开发者ID:t-andre,项目名称:Emby,代码行数:51,代码来源:ScheduledTaskWorker.cs


示例7: TvMazeSeasonImageProvider

 public TvMazeSeasonImageProvider(IJsonSerializer jsonSerializer, IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem)
 {
     _config = config;
     _httpClient = httpClient;
     _fileSystem = fileSystem;
     _jsonSerializer = jsonSerializer;
 }
开发者ID:SvenVandenbrande,项目名称:Emby.Plugins,代码行数:7,代码来源:TvMazeSeasonImageProvider.cs


示例8: HtmlTemplateToJavaScriptTransformer

 public HtmlTemplateToJavaScriptTransformer(string javaScriptTemplate, HtmlTemplateBundle bundle, IJsonSerializer serializer, IHtmlTemplateIdStrategy idStrategy)
 {
     this.javaScriptTemplate = javaScriptTemplate;
     this.bundle = bundle;
     this.serializer = serializer;
     this.idStrategy = idStrategy;
 }
开发者ID:jlopresti,项目名称:cassette,代码行数:7,代码来源:HtmlTemplateToJavaScriptTransformer.cs


示例9: ViewHelperImplementation

 public ViewHelperImplementation(BundleCollection bundles, IAmdConfiguration configuration, IJsonSerializer jsonSerializer, IRequireJsConfigUrlProvider requireJsConfigUrlProvider)
 {
     this.bundles = bundles;
     this.configuration = configuration;
     this.jsonSerializer = jsonSerializer;
     this.requireJsConfigUrlProvider = requireJsConfigUrlProvider;
 }
开发者ID:joshperry,项目名称:cassette,代码行数:7,代码来源:ViewHelperImplementation.cs


示例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);
        }
开发者ID:Tensre,项目名称:MediaBrowser,代码行数:30,代码来源:ImageProcessor.cs


示例11: FanArtSeasonProvider

 public FanArtSeasonProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem, IJsonSerializer json)
 {
     _config = config;
     _httpClient = httpClient;
     _fileSystem = fileSystem;
     _json = json;
 }
开发者ID:rezafouladian,项目名称:Emby,代码行数:7,代码来源:FanArtSeasonProvider.cs


示例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);
 }
开发者ID:megakid,项目名称:Exceptionless.Net,代码行数:7,代码来源:PersistedDictionary.cs


示例13: AppThemeManager

 public AppThemeManager(IServerApplicationPaths appPaths, IFileSystem fileSystem, IJsonSerializer json, ILogger logger)
 {
     _appPaths = appPaths;
     _fileSystem = fileSystem;
     _json = json;
     _logger = logger;
 }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:7,代码来源:AppThemeManager.cs


示例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;
 }
开发者ID:JonJam,项目名称:marveluniverse,代码行数:12,代码来源:CharacterService.cs


示例15: FanartAlbumProvider

 public FanartAlbumProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem, IJsonSerializer jsonSerializer)
 {
     _config = config;
     _httpClient = httpClient;
     _fileSystem = fileSystem;
     _jsonSerializer = jsonSerializer;
 }
开发者ID:softworkz,项目名称:Emby,代码行数:7,代码来源:FanArtAlbumProvider.cs


示例16: BaseTunerHost

 protected BaseTunerHost(IConfigurationManager config, ILogger logger, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder)
 {
     Config = config;
     Logger = logger;
     JsonSerializer = jsonSerializer;
     MediaEncoder = mediaEncoder;
 }
开发者ID:NickBolles,项目名称:Emby,代码行数:7,代码来源:BaseTunerHost.cs


示例17: SyncFromTraktTask

 /// <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);
 }
开发者ID:ryu4000,项目名称:MediaBrowser.Plugins,代码行数:17,代码来源:SyncFromTraktTask.cs


示例18: TryGetCommand

        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;
        }
开发者ID:andyedinborough,项目名称:SignalR,代码行数:26,代码来源:SignalCommand.cs


示例19: MainWindow

        /// <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;
        }
开发者ID:Jon-theHTPC,项目名称:MediaBrowser,代码行数:39,代码来源:MainWindow.xaml.cs


示例20: SendReplyService

 public SendReplyService()
 {
     _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
     _sendReplyRemotingClientDict = new ConcurrentDictionary<string, SocketRemotingClient>();
     _remotingClientWaitHandleDict = new ConcurrentDictionary<string, ManualResetEvent>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
开发者ID:ivivisoft,项目名称:enode,代码行数:7,代码来源:SendReplyService.cs



注:本文中的IJsonSerializer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IJumpList类代码示例发布时间:2022-05-24
下一篇:
C# IJsonLineInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap