コード例 #1
0
 public ChannelsController(IChannelService ChannelService, UserManager <IdentityUser> userManager,
                           ApplicationDbContext context)
 {
     _ChannelService = ChannelService;
     _userManager    = userManager;
     _context        = context ?? throw new ArgumentNullException(nameof(context));
 }
コード例 #2
0
 public CommentsController(ICommentService commentService, IChannelService channelService, IUserService userService, IHistoryService historyService)
 {
     this.commentService = commentService;
     this.channelService = channelService;
     this.userService    = userService;
     this.historyService = historyService;
 }
コード例 #3
0
 public VideoManager(IVideoDal videoDal, IChannelService channelService, IUserService userService, IFileSystem fileSystem)
 {
     _videoDal       = videoDal;
     _channelService = channelService;
     _userService    = userService;
     _fileSystem     = fileSystem;
 }
コード例 #4
0
 public BaseController(IPostService postService, IChannelService channelService, ICategoryService categoryService, IMapper mapper)
 {
     _postService     = postService;
     _channelService  = channelService;
     _categoryService = categoryService;
     _mapper          = mapper;
 }
コード例 #5
0
 public AgentUKeyController(IAgentUKeyService agentUKeyService, IChannelService channelService, IChannelStatusByUkeyIdService channelStatusByUkeyIdService)
 {
     _agentUKeyService             = agentUKeyService;
     _channelService               = channelService;
     _channelStatusByUkeyIdService = channelStatusByUkeyIdService;
     _logInfo = LogManager.GetLogger("INFO");
 }
コード例 #6
0
 public ChannelsController(IChannelService channelService, IMapper mapper, IPhotoUpload photoUpload, ICountService countService)
 {
     _channelService = channelService;
     _mapper         = mapper;
     _photoUpload    = photoUpload;
     _countService   = countService;
 }
コード例 #7
0
        public override bool GetChannel(int channelId, out IChannel channel)
        {
            IChannelService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelService>();

            channel = channelGroupService.GetChannel(channelId).ToChannel();
            return(true);
        }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var serviceProvider = new ServiceCollection()
                                  .AddSingleton <IPublisherService, PublisherService>()
                                  .AddSingleton <IChannelService, ChannelService>()
                                  .AddSingleton <ISubscriberService, SubscriberService>()
                                  .BuildServiceProvider();

            publisherService  = serviceProvider.GetService <IPublisherService>();
            channelService    = serviceProvider.GetService <IChannelService>();
            subscriberService = serviceProvider.GetService <ISubscriberService>();

            var channelCentre = new Channel();
            var publisher     = new Publisher("Publisher");

            for (int i = 0; i < 5; i++)
            {
                channelService.SubscribeChannel(channelCentre, new Subscriber());
            }

            publisherService.Post(publisher, new Message("Update from Publisher"), channelCentre);
            channelService.Broadcast(channelCentre);

            int           subno = 0;
            StringBuilder html  = new StringBuilder();

            foreach (var subscriber in channelCentre.Subscribers)
            {
                subno += 1;
                RetrieveMessages(html, subscriber, subno);
            }
            SubscriberMessage.Controls.Add(new Literal {
                Text = html.ToString()
            });
        }
コード例 #9
0
 public ServiceAndChannelService(IContextManager contextManager,
                                 ITranslationEntity translationEntToVm,
                                 ITranslationViewModel translationVmtoEnt,
                                 ILogger <ServiceAndChannelService> logger,
                                 ServiceUtilities utilities,
                                 DataUtils dataUtils,
                                 IServiceService serviceService,
                                 IChannelService channelService,
                                 IPublishingStatusCache publishingStatusCache,
                                 IVersioningManager versioningManager,
                                 IUserOrganizationChecker userOrganizationChecker,
                                 ICacheManager cacheManager,
                                 IUserOrganizationService userOrganizationService
                                 )
     : base(translationEntToVm, translationVmtoEnt, publishingStatusCache, userOrganizationChecker)
 {
     this.contextManager          = contextManager;
     this.logger                  = logger;
     this.utilities               = utilities;
     this.dataUtils               = dataUtils;
     this.serviceService          = serviceService;
     this.channelService          = channelService;
     this.versioningManager       = versioningManager;
     this.userOrganizationService = userOrganizationService;
     typesCache = cacheManager.TypesCache;
 }
コード例 #10
0
        public MessageServiceTests()
        {
            _channelService = LifetimeScope.Resolve <IChannelService>();
            _messageService = LifetimeScope.Resolve <IMessageService>();

            var member = new Member
            {
                Id           = _memberId,
                LastActivity = DateTimeOffset.UtcNow,
                Status       = UserStatus.Active,
                SaasUserId   = SaasUserId
            };

            UnitOfWork.MemberRepository.AddMemberAsync(member).GetAwaiter().GetResult();

            var channel = new Channel
            {
                Id           = _channelId,
                CreatorId    = member.Id,
                Name         = "testMessageService",
                MembersCount = 0,
                Type         = ChannelType.Public
            };

            UnitOfWork.ChannelRepository.AddChannelAsync(channel).GetAwaiter().GetResult();
        }
コード例 #11
0
 public UploadController(FootageManager fm,
                         IFootageStorageService ifss,
                         IRegisteredDeviceService irds,
                         IAPIResultTypeService iapits,
                         IDeviceEventIntermediateService ideis,
                         IEventService ies,
                         IChannelContactService iccs,
                         IAWSService iawss,
                         IChannelService ics,
                         IStaffEventIntermediateService iseis,
                         IContactService icos
                         )
 {
     _FootageManager                 = fm;
     _FootageStorageService          = ifss;
     _RegisteredDeviceService        = irds;
     _APIResultTypeService           = iapits;
     _DeviceEventIntermediateService = ideis;
     _EventService                  = ies;
     _AWSService                    = iawss;
     _ChannelContactService         = iccs;
     _ChannelService                = ics;
     _StaffEventIntermediateService = iseis;
     _ContactService                = icos;
 }
コード例 #12
0
 public TaskService(ICustomerService customerService, IChannelService channelService, IConversationService conversationService, IAgentService agentService)
 {
     _customerService     = customerService;
     _conversationService = conversationService;
     _channelService      = channelService;
     _agentService        = agentService;
 }
コード例 #13
0
        public MainInitializer(IAllianceInitializer allianceInitializer,
                               IMapGInitializer mapGInitializer,
                               IAuthUsersInitializer authUsersInitializer,
                               IGameUserService gameUserService,
                               INpcInitializer npcInitializer,
                               IUserInitializer userInitializer,
                               IUserNameSercherPkCache userNameSercherPkCache,
                               IUserLocalStorageCache userCache,
                               IUserRepository userRepo,
                               IAllianceService allianceService,
                               IChannelService channelService, IDbProvider provider)
        {
            _allianceInitializer  = allianceInitializer;
            _mapGInitializer      = mapGInitializer;
            _authUsersInitializer = authUsersInitializer;
            _gameUserService      = gameUserService;
            _npcInitializer       = npcInitializer;
            _userInitializer      = userInitializer;

            _userNameSercherPkCache = userNameSercherPkCache;
            _userCache       = userCache;
            _userRepo        = userRepo;
            _allianceService = allianceService;
            _provider        = provider;

            _channelService = (ChannelService)channelService;

            _admUser  = MainUserRepository.GetAdminUser();
            _textUser = MainUserRepository.GetTextureUser();
            _demoUser = MainUserRepository.GetUser(MainUserRepository.DemoUserName);
        }
コード例 #14
0
 public AllianceService(
     IAllianceRepository aRepo,
     IAllianceLocalStorageCache aCache,
     IAllianceUserRepository aUserRepo,
     IAllianceUserLocalStorageCache aUserCache,
     IAllianceRequestMessageRepository armRepo,
     IAllianceRequestMessageLocalStorageCache armCache,
     IAllianceRoleRepository aRolesRepo,
     IAllianceRoleLocalStorageCache aRolesCache,
     IAlianceNameSercherPkCache aNameSercher,
     IGDetailPlanetLocalStorageCache planetDetailCache,
     IAllianceTechLocalStorageCache aTechCahce,
     IAllianceFleetLocalStorageCache aFleetCache,
     IAllianceTechRepository aTechRepo,
     IChannelService channelService, ILocalizerService localizer)
 {
     _aRepo             = aRepo;
     _aCache            = aCache;
     _aUserRepo         = aUserRepo;
     _aUserCache        = aUserCache;
     _armRepo           = armRepo;
     _armCache          = armCache;
     _aRolesRepo        = aRolesRepo;
     _aRolesCache       = aRolesCache;
     _aNameSercher      = aNameSercher;
     _planetDetailCache = planetDetailCache;
     _aTechCahce        = aTechCahce;
     _aFleetCache       = aFleetCache;
     _aTechRepo         = aTechRepo;
     _localizer         = localizer;
     _channelService    = (ChannelService)channelService;
 }
コード例 #15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="channel"></param>
        /// <param name="msg"></param>
        public static void CheckReceiveMessage(this IChannelService channel, Message msg)
        {
            #region Validate parameters
            if (channel == null)
            {
                throw new ArgumentNullException("channel");
            }

            if (msg == null)
            {
                throw new ArgumentNullException("msg");
            }
            #endregion

            if (String.IsNullOrEmpty(msg.GUID))
            {
                throw new MessageException($"В сообщении {msg} отсутствует GUID.");
            }

            if (msg.Direction != MessageDirection.IN)
            {
                throw new MessageException($"Cообщение {msg} не является входящим.");
            }

            if (!msg.Status.IsDraft && !msg.Status.IsNew)
            {
                throw new MessageException($"Некорректный статус '{msg.Status}' принимаемого сообщения {msg}.");
            }
        }
コード例 #16
0
 public static void ConfigureProviders()
 {
     twitchService  = ServiceProvider.GetService <ITwitchService>();
     commandService = ServiceProvider.GetService <ICommandService>();
     channelService = ServiceProvider.GetService <IChannelService>();
     messageHandler = ServiceProvider.GetService <IMessageHandler>();
 }
コード例 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceBaseController"/> class.
 /// </summary>
 /// <param name="serviceService">The service service.</param>
 /// <param name="commonService">The common service.</param>
 /// <param name="codeService">The code service.</param>
 /// <param name="settings">The settings.</param>
 /// <param name="generalDescriptionService">The general description service.</param>
 /// <param name="fintoService">The finto service.</param>
 /// <param name="serviceAndChannelService">The service and channel service.</param>
 /// <param name="channelService">The channel service.</param>
 /// <param name="userOrganizationService">The user organization service.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="versionNumber">Open api version.</param>
 public ServiceBaseController(
     IServiceService serviceService,
     ICommonService commonService,
     ICodeService codeService,
     IOptions <AppSettings> settings,
     IGeneralDescriptionService generalDescriptionService,
     IFintoService fintoService,
     IServiceAndChannelService serviceAndChannelService,
     IChannelService channelService,
     IUserOrganizationService userOrganizationService,
     ILogger logger,
     int versionNumber)
     : base(serviceAndChannelService, serviceService, channelService, userOrganizationService, settings, logger, versionNumber)
 {
     this.serviceService            = serviceService;
     this.generalDescriptionService = generalDescriptionService;
     this.serviceAndChannelService  = serviceAndChannelService;
     this.codeService             = codeService;
     this.fintoService            = fintoService;
     this.commonService           = commonService;
     this.channelService          = channelService;
     this.userOrganizationService = userOrganizationService;
     pageSize           = Settings.PageSize > 0 ? Settings.PageSize : 1000;
     this.versionNumber = versionNumber;
 }
コード例 #18
0
 public ListController(
     IListService listService,
     IChannelService channelService)
 {
     _listService    = listService;
     _channelService = channelService;
 }
コード例 #19
0
        public MediaItem CreateMediaItem(int slotIndex, string streamUrl, IChannel channel)
        {
            // Channel is usually only passed as placeholder with ID only, so query the details here
            IChannelService channelService = GlobalServiceProvider.Get <IChannelService>();
            Channel         fullChannel    = channelService.GetChannel(channel.ChannelId);

            bool            isTv     = fullChannel.MediaType == 0;
            LiveTvMediaItem tvStream = isTv
        ? SlimTvMediaItemBuilder.CreateMediaItem(slotIndex, streamUrl, fullChannel.ToChannel())
        : SlimTvMediaItemBuilder.CreateRadioMediaItem(slotIndex, streamUrl, fullChannel.ToChannel());

            if (tvStream != null)
            {
                // Add program infos to the LiveTvMediaItem
                IProgram currentProgram;
                IProgram nextProgram;
                if (GetNowNextProgram(channel, out currentProgram, out nextProgram))
                {
                    tvStream.AdditionalProperties[LiveTvMediaItem.CURRENT_PROGRAM] = currentProgram;
                    tvStream.AdditionalProperties[LiveTvMediaItem.NEXT_PROGRAM]    = nextProgram;
                }
                return(tvStream);
            }
            return(null);
        }
コード例 #20
0
        public override Task <AsyncResult <IChannel> > GetChannelAsync(IProgram program)
        {
            IChannelService channelService = GlobalServiceProvider.Instance.Get <IChannelService>();
            var             channel        = channelService.GetChannel(program.ChannelId).ToChannel();

            return(Task.FromResult(new AsyncResult <IChannel>(true, channel)));
        }
コード例 #21
0
 /// <summary>
 /// Constructor of service and channel connections controller
 /// </summary>
 /// <param name="serviceAndChannelService">service and channel connections service responsible for operation related to service and channel connections - injected by framework</param>
 /// <param name="serviceService">service service responsible for operation related to service - injected by framework</param>
 /// <param name="channelService">channel service responsible for operation related to channel - injected by framework</param>
 /// <param name="serviceManager">manager responsible for wrapping of individual service call to UI output format - injected by framework</param>
 /// <param name="logger">logger commponent to support logging - injected by framework</param>
 public RESTServiceAndChannelController(IServiceAndChannelService serviceAndChannelService, IServiceService serviceService, IChannelService channelService, IServiceManager serviceManager, ILogger <RESTServiceController> logger) : base(logger)
 {
     this.serviceAndChannelService = serviceAndChannelService;
     this.serviceService           = serviceService;
     this.channelService           = channelService;
     this.serviceManager           = serviceManager;
 }
コード例 #22
0
 /// <summary>
 /// Creates a new <see cref="ModerationService"/>, with the given injected dependencies.
 /// </summary>
 public ModerationService(
     IDiscordClient discordClient,
     IAuthorizationService authorizationService,
     IChannelService channelService,
     IUserService userService,
     IModerationActionRepository moderationActionRepository,
     IDesignatedRoleMappingRepository designatedRoleMappingRepository,
     IInfractionRepository infractionRepository,
     IDeletedMessageRepository deletedMessageRepository,
     IDeletedMessageBatchRepository deletedMessageBatchRepository,
     IRoleService roleService,
     IDesignatedChannelService designatedChannelService,
     IDogStatsd stats = null)
 {
     DiscordClient                   = discordClient;
     AuthorizationService            = authorizationService;
     ChannelService                  = channelService;
     UserService                     = userService;
     ModerationActionRepository      = moderationActionRepository;
     DesignatedRoleMappingRepository = designatedRoleMappingRepository;
     InfractionRepository            = infractionRepository;
     DeletedMessageRepository        = deletedMessageRepository;
     DeletedMessageBatchRepository   = deletedMessageBatchRepository;
     RoleService                     = roleService;
     DesignatedChannelService        = designatedChannelService;
     Stats = stats;
 }
コード例 #23
0
 public ModerationService(
     IDiscordClient discordClient,
     IAuthorizationService authorizationService,
     IChannelService channelService,
     IUserService userService,
     IModerationActionRepository moderationActionRepository,
     IDesignatedRoleMappingRepository designatedRoleMappingRepository,
     IInfractionRepository infractionRepository,
     IDeletedMessageRepository deletedMessageRepository,
     IDeletedMessageBatchRepository deletedMessageBatchRepository,
     IRoleService roleService,
     IDesignatedChannelService designatedChannelService,
     IDogStatsd dogStatsd)
 {
     _discordClient                   = discordClient;
     _authorizationService            = authorizationService;
     _channelService                  = channelService;
     _userService                     = userService;
     _moderationActionRepository      = moderationActionRepository;
     _designatedRoleMappingRepository = designatedRoleMappingRepository;
     _infractionRepository            = infractionRepository;
     _deletedMessageRepository        = deletedMessageRepository;
     _deletedMessageBatchRepository   = deletedMessageBatchRepository;
     _roleService                     = roleService;
     _designatedChannelService        = designatedChannelService;
     _dogStatsd = dogStatsd;
 }
コード例 #24
0
 public ServerMqttHandlerService(
     ILogger logger, IChannelService channelService, IMqttBehaviorProvider mqttBehaviorProvider)
 {
     _logger               = logger;
     _channelService       = channelService;
     _mqttBehaviorProvider = mqttBehaviorProvider;
 }
コード例 #25
0
        public bool GetChannel(IProgram program, out IChannel channel)
        {
            IChannelService channelService = GlobalServiceProvider.Get <IChannelService>();

            channel = channelService.GetChannel(program.ChannelId).ToChannel();
            return(true);
        }
コード例 #26
0
 public ChatDomainEntryPoint(IDatabaseAdapter databaseAdapter, IPushNotificationAdapter pushNotificationAdapter)
 {
     _userService             = new UserService();
     _databaseAdapter         = databaseAdapter;
     _channelService          = new ChannelService();
     _pushNotificationAdapter = pushNotificationAdapter;
 }
コード例 #27
0
 public ReportController()
 {
     this.reportService       = Injector.Container.Resolve <IReportService>();
     this.videoService        = Injector.Container.Resolve <IVideoService>();
     this.subscriptionService = Injector.Container.Resolve <ISubscriptionService>();
     this.channelService      = Injector.Container.Resolve <IChannelService>();
 }
コード例 #28
0
        public ControllerTestBase()
        {
            organizationServiceMockSetup = new Mock <IOrganizationService>();
            organizationService          = organizationServiceMockSetup.Object;
            channelServiceMockSetup      = new Mock <IChannelService>();
            channelService = channelServiceMockSetup.Object;
            serviceAndChannelServiceMockSetup = new Mock <IServiceAndChannelService>();
            //serviceAndChannelService = serviceAndChannelServiceMockSetup.Object;
            serviceServiceMockSetup = new Mock <IServiceService>();
            serviceService          = serviceServiceMockSetup.Object;
            commonServiceMockSetup  = new Mock <ICommonService>();
            commonService           = commonServiceMockSetup.Object;
            codeServiceMockSetup    = new Mock <ICodeService>();
            codeService             = codeServiceMockSetup.Object;
            gdServiceMockSetup      = new Mock <IGeneralDescriptionService>();
            gdService = gdServiceMockSetup.Object;

            userServiceMockSetup = new Mock <IUserOrganizationService>();
            userServiceMockSetup.Setup(u => u.GetAllUserOrganizations()).Returns(new List <Guid>()
            {
                Guid.NewGuid()
            });
            userService = userServiceMockSetup.Object;

            var settingsMock = new Mock <IOptions <AppSettings> >();

            settingsMock.Setup(s => s.Value).Returns(new AppSettings());
            settings = settingsMock.Object;
        }
コード例 #29
0
        public SynchronizationPageViewModel(ISynchronizationService synchronizationService, IChannelService channelService)
        {
            _synchronizationService = synchronizationService;
            _channelService         = channelService;

            _synchronizationService.ProgressChanged += _synchronizationService_ProgressChanged;
        }
コード例 #30
0
        public override Task <AsyncResult <IChannel> > GetChannelAsync(int channelId)
        {
            IChannelService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelService>();
            var             channel             = channelGroupService.GetChannel(channelId).ToChannel();

            return(Task.FromResult(new AsyncResult <IChannel>(channel != null, channel)));
        }
コード例 #31
0
ファイル: SiteCache.cs プロジェクト: fengxing/FxCacheService
 /// <summary>
 /// 默认构造函数
 /// </summary>
 /// <param name="site">站点基础信息接口</param>
 /// <param name="channel">一级频道服务接口 配合物品二级列表获取</param>
 /// <param name="car">站点下车辆基础信息接口</param>     
 /// <param name="house">站点下房屋基础信息接口</param>
 public SiteCache(ISite site,
     IChannelService channel,
     ICar car,
     IHouse house)
 {
     this.site = site;
     this.channel = channel;
     this.car = car;
     //this.goods = goods;//因goods 采用二级频道 所以使用IChannelService
     this.house = house;
 }
コード例 #32
0
        /// <summary>
        /// Retrieve the Show list based on the provided service
        /// </summary>
        /// <param name="service">Discovery Network Channel Service</param>
        /// <returns>A list of shows</returns>
        public IEnumerable<Show> RetrieveShows(IChannelService service)
        {
            var doc = service.Get();

            var shows = from showRow in doc.DocumentNode.QuerySelectorAll("div.contentFrame tr")
                        select new Show
                        {
                            ChannelName = "Discovery",
                            Description = BuildDescription(showRow),
                            EpisodeTitle = showRow.QuerySelector("td:nth-child(3) em").InnerText,
                            Name = showRow.QuerySelector("td:nth-child(3) strong").InnerText,
                            StartTime = showRow.QuerySelector("td:nth-child(1) div.cellPad").InnerText
                        };

            return CleanName(CleanTimeData(shows));
        }
コード例 #33
0
 /// <summary>
 /// 频道管理初始化
 /// </summary>
 /// <param name="channelService">channelService</param>
 /// <param name="workContent">workContent</param>
 /// <param name="contentService">contentService</param>
 public ChannelController(IChannelService channelService,IWorkContext workContent,IContentService contentService) {
     _channelService = channelService;
     _workContent = workContent;
     _contentService = contentService;
 }
コード例 #34
0
 public ChannelController(IChannelService channelService, ITemplateRepository templateRepository)
 {
     this.channelService = channelService;
     this.templateRepository = templateRepository;
 }
コード例 #35
0
 /// <summary>
 /// 默认构造函数
 /// </summary>
 /// <param name="channelService">一级频道服务接口</param>
 public BuyController(IChannelService channelService)
 {
     this.channelService = channelService;
 }
コード例 #36
0
 public IEnumerable<Show> RetrieveShows(IChannelService service)
 {
     throw new NotImplementedException();
 }
コード例 #37
0
 /// <summary>
 /// 默认构造函数
 /// </summary>
 /// <param name="channelService">一级频道服务接口</param>
 public TransferController(IChannelService channelService)
 {
     this.channelService = channelService;
 }
コード例 #38
0
ファイル: Program.cs プロジェクト: odinhaus/Suffuz
 /// <summary>
 /// Creates communication channels to listen for incoming messages
 /// </summary>
 private static void OpenChannels()
 {
     // creates the local channel instance for the CHANNEL service
     _channelService = App.Resolve<IChannelService>();
     _channelService.Create(Channels.CHANNEL);
 }