Пример #1
0
        /// <summary>
        /// Create an instance of the hosting class
        /// </summary>
        /// <param name="serviceProvider">Service provider</param>
        public SOSHost(IServiceProvider serviceProvider)
        {
            DataReader     = serviceProvider.GetService <IDataReader>();
            _console       = serviceProvider.GetService <IConsoleService>();
            AnalyzeContext = serviceProvider.GetService <AnalyzeContext>();
            _memoryService = serviceProvider.GetService <MemoryService>();
            _threadService = serviceProvider.GetService <IThreadService>();
            _versionCache  = new ReadVirtualCache(_memoryService);

            string rid = InstallHelper.GetRid();

            SOSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), rid);
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                var debugClient = new DebugClient(this);
                _ccw       = debugClient;
                _interface = debugClient.IDebugClient;
            }
            else
            {
                var lldbServices = new LLDBServices(this);
                _ccw       = lldbServices;
                _interface = lldbServices.ILLDBServices;
            }
        }
Пример #2
0
        /// <summary>
        /// Create an instance of the hosting class
        /// </summary>
        /// <param name="target">target instance</param>
        public SOSHost(ITarget target)
        {
            Target                 = target;
            ConsoleService         = target.Services.GetService <IConsoleService>();
            ModuleService          = target.Services.GetService <IModuleService>();
            ThreadService          = target.Services.GetService <IThreadService>();
            MemoryService          = target.Services.GetService <IMemoryService>();
            _ignoreAddressBitsMask = MemoryService.SignExtensionMask();

            string rid = InstallHelper.GetRid();

            SOSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), rid);

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                var debugClient = new DebugClient(this);
                _interface = debugClient.IDebugClient;
            }
            else
            {
                var lldbServices = new LLDBServices(this);
                _interface = lldbServices.ILLDBServices;
            }
            _hostWrapper = new HostWrapper(target.Host);
            _hostWrapper.AddServiceWrapper(SymbolServiceWrapper.IID_ISymbolService, () => new SymbolServiceWrapper(target.Host));
        }
Пример #3
0
 public PostController(IMapper mapper, IPostService postService, IUserService userService, IThreadService threadService)
 {
     _mapper        = mapper;
     _postService   = postService;
     _userService   = userService;
     _threadService = threadService;
 }
Пример #4
0
        public SubscriptionController(
            IOrchardServices orchardServices,
            IForumService forumService,
            IThreadService threadService,
            IPostService postService,
            ISiteService siteService,
            IShapeFactory shapeFactory,
            IAuthorizationService authorizationService,
            IAuthenticationService authenticationService,
            ISubscriptionService subscriptionService,
            IThreadLastReadService threadLastReadService
            )
        {
            _orchardServices = orchardServices;
            _forumService = forumService;
            _threadService = threadService;
            _postService = postService;
            _siteService = siteService;
            _subscriptionService = subscriptionService;
            _authorizationService = authorizationService;
            _authenticationService = authenticationService;
            _threadLastReadService = threadLastReadService;

            T = NullLocalizer.Instance;
            Shape = shapeFactory;
        }
Пример #5
0
        public PostPartHandler(IRepository<PostPartRecord> repository, 
            IPostService postService, 
            IThreadService threadService, 
            IForumService forumService)
        {
            _postService = postService;
            _threadService = threadService;
            _forumService = forumService;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape<PostPart>(SetModelProperties);
            OnGetEditorShape<PostPart>(SetModelProperties);
            OnUpdateEditorShape<PostPart>(SetModelProperties);

            OnCreated<PostPart>((context, part) => UpdatePostCount(part));
            OnPublished<PostPart>((context, part) => UpdatePostCount(part));
            OnUnpublished<PostPart>((context, part) => UpdatePostCount(part));
            OnVersioned<PostPart>((context, part, newVersionPart) => UpdatePostCount(newVersionPart));
            OnRemoved<PostPart>((context, part) => UpdatePostCount(part));

            OnRemoved<ThreadPart>((context, b) =>
                _postService
                    .Get(context.ContentItem.As<ThreadPart>())
                    .ToList()
                    .ForEach(post => context.ContentManager.Remove(post.ContentItem)));
        }
        public ThreadPartHandler(IRepository<ThreadPartRecord> repository, 
            IPostService postService,
            IThreadService threadService,
            IForumService forumService,
            IContentManager contentManager)
        {
            _postService = postService;
            _threadService = threadService;
            _forumService = forumService;
            _contentManager = contentManager;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape<ThreadPart>(SetModelProperties);
            OnGetEditorShape<ThreadPart>(SetModelProperties);
            OnUpdateEditorShape<ThreadPart>(SetModelProperties);

            OnActivated<ThreadPart>(PropertySetHandlers);
            OnLoading<ThreadPart>((context, part) => LazyLoadHandlers(part));
            OnCreated<ThreadPart>((context, part) => UpdateForumPartCounters(part));
            OnPublished<ThreadPart>((context, part) => UpdateForumPartCounters(part));
            OnUnpublished<ThreadPart>((context, part) => UpdateForumPartCounters(part));
            OnVersioning<ThreadPart>((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart));
            OnVersioned<ThreadPart>((context, part, newVersionPart) => UpdateForumPartCounters(newVersionPart));
            OnRemoved<ThreadPart>((context, part) => UpdateForumPartCounters(part));

            OnRemoved<ForumPart>((context, b) =>
                _threadService
                    .Get(context.ContentItem.As<ForumPart>())
                    .ToList()
                    .ForEach(thread => context.ContentManager.Remove(thread.ContentItem)));
        }
Пример #7
0
 public ApiController(IBoardService boardService, IThreadService threadService, IPostService postService /*, IMapper mapper*/)
 {
     this._boardService  = boardService;
     this._threadService = threadService;
     this._postService   = postService;
     //this._mapper = mapper;
 }
Пример #8
0
        public PostPartHandler(IRepository<PostPartRecord> repository, 
            IPostService postService, 
            IThreadService threadService, 
            IForumService forumService,
            IClock clock) {
            _postService = postService;
            _threadService = threadService;
            _forumService = forumService;
            _clock = clock;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape<PostPart>(SetModelProperties);
            OnGetEditorShape<PostPart>(SetModelProperties);
            OnUpdateEditorShape<PostPart>(SetModelProperties);

            OnCreated<PostPart>((context, part) => UpdateCounters(part));
            OnPublished<PostPart>((context, part) => { 
                UpdateCounters(part);
                UpdateThreadVersioningDates(part);
            });
            OnUnpublished<PostPart>((context, part) => UpdateCounters(part));
            OnVersioned<PostPart>((context, part, newVersionPart) => UpdateCounters(newVersionPart));
            OnRemoved<PostPart>((context, part) => UpdateCounters(part));

            OnRemoved<ThreadPart>((context, b) =>
                _postService.Delete(context.ContentItem.As<ThreadPart>()));

            OnIndexing<PostPart>((context, postPart) => context.DocumentIndex
                                                    .Add("body", postPart.Record.Text).RemoveTags().Analyze()
                                                    .Add("format", postPart.Record.Format).Store());
        }
Пример #9
0
 public FormsDialogService(
     IFormsApplicationProxy application,
     IThreadService threadService)
 {
     _application   = application;
     _threadService = threadService;
 }
Пример #10
0
 public ThreadController(IThreadService threadService, ICategoryService categoryService, IUserService userService, IPostService postService)
 {
     _threadService   = threadService;
     _categoryService = categoryService;
     _userService     = userService;
     _postService     = postService;
 }
Пример #11
0
        internal CorDebugDataTargetWrapper(IServiceProvider services)
        {
            Debug.Assert(services != null);
            _target                = services.GetService <ITarget>();
            _symbolService         = services.GetService <ISymbolService>();
            _memoryService         = services.GetService <IMemoryService>();
            _threadService         = services.GetService <IThreadService>();
            _threadUnwindService   = services.GetService <IThreadUnwindService>();
            _ignoreAddressBitsMask = _memoryService.SignExtensionMask();

            VTableBuilder builder = AddInterface(IID_ICorDebugDataTarget, validate: false);

            builder.AddMethod(new GetPlatformDelegate(GetPlatform));
            builder.AddMethod(new ReadVirtualDelegate(ReadVirtual));
            builder.AddMethod(new GetThreadContextDelegate(GetThreadContext));
            ICorDebugDataTarget = builder.Complete();

            builder = AddInterface(IID_ICorDebugDataTarget4, validate: false);
            builder.AddMethod(new VirtualUnwindDelegate(VirtualUnwind));
            builder.Complete();

            builder = AddInterface(IID_ICorDebugMutableDataTarget, validate: false);
            builder.AddMethod(new WriteVirtualDelegate(WriteVirtual));
            builder.AddMethod(new SetThreadContextDelegate((self, threadId, contextSize, context) => HResult.E_NOTIMPL));
            builder.AddMethod(new ContinueStatusChangeDelegate((self, continueStatus) => HResult.E_NOTIMPL));
            builder.Complete();

            builder = AddInterface(IID_ICorDebugMetaDataLocator, validate: false);
            builder.AddMethod(new GetMetaDataDelegate(GetMetaData));
            builder.Complete();

            AddRef();
        }
Пример #12
0
        public PostPartHandler(IRepository<PostPartRecord> repository, 
            IPostService postService, 
            IThreadService threadService, 
            IForumService forumService)
        {
            _postService = postService;
            _threadService = threadService;
            _forumService = forumService;

            T = NullLocalizer.Instance;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape<PostPart>(SetModelProperties);
            OnGetEditorShape<PostPart>(SetModelProperties);
            OnUpdateEditorShape<PostPart>(SetModelProperties);

            OnCreated<PostPart>((context, part) => UpdatePostCount(part));
            OnPublished<PostPart>((context, part) => UpdatePostCount(part));
            OnUnpublished<PostPart>((context, part) => UpdatePostCount(part));
            OnVersioned<PostPart>((context, part, newVersionPart) => UpdatePostCount(newVersionPart));
            OnRemoved<PostPart>((context, part) => UpdatePostCount(part));

            OnRemoved<ThreadPart>((context, b) =>
                _postService
                    .Get(context.ContentItem.As<ThreadPart>())
                    .ToList()
                    .ForEach(post => context.ContentManager.Remove(post.ContentItem)));

            OnIndexing<PostPart>((context, postPart) => context.DocumentIndex
                                                    .Add("body", postPart.Record.Text).RemoveTags().Analyze()
                                                    .Add("format", postPart.Record.Format).Store());
        }
Пример #13
0
        private IServiceProvider GetServices()
        {
            // If there is no target, then provide just the global services
            ServiceProvider services = _serviceProvider;

            if (_target != null)
            {
                // Create a per command invocation service provider. These services may change between each command invocation.
                services = new ServiceProvider(_target.Services);

                // Add the current thread if any
                services.AddServiceFactory <IThread>(() =>
                {
                    IThreadService threadService = _target.Services.GetService <IThreadService>();
                    if (threadService != null && threadService.CurrentThreadId.HasValue)
                    {
                        return(threadService.GetThreadFromId(threadService.CurrentThreadId.Value));
                    }
                    return(null);
                });

                // Add the current runtime and related services
                var runtimeService = _target.Services.GetService <IRuntimeService>();
                if (runtimeService != null)
                {
                    services.AddServiceFactory <IRuntime>(() => runtimeService.CurrentRuntime);
                    services.AddServiceFactory <ClrRuntime>(() => services.GetService <IRuntime>()?.Services.GetService <ClrRuntime>());
                    services.AddServiceFactory <ClrMDHelper>(() => new ClrMDHelper(services.GetService <ClrRuntime>()));
                }
            }
            return(services);
        }
Пример #14
0
        public ThreadPartHandler(IRepository <ThreadPartRecord> repository,
                                 IPostService postService,
                                 IThreadService threadService,
                                 IForumService forumService,
                                 IContentManager contentManager)
        {
            _postService    = postService;
            _threadService  = threadService;
            _forumService   = forumService;
            _contentManager = contentManager;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape <ThreadPart>(SetModelProperties);
            OnGetEditorShape <ThreadPart>(SetModelProperties);
            OnUpdateEditorShape <ThreadPart>(SetModelProperties);

            OnActivated <ThreadPart>(PropertyHandlers);
            OnLoading <ThreadPart>((context, part) => LazyLoadHandlers(part));
            OnCreated <ThreadPart>((context, part) => UpdateForumPartCounters(part));
            OnPublished <ThreadPart>((context, part) => UpdateForumPartCounters(part));
            OnUnpublished <ThreadPart>((context, part) => UpdateForumPartCounters(part));
            OnVersioning <ThreadPart>((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart));
            OnVersioned <ThreadPart>((context, part, newVersionPart) => UpdateForumPartCounters(newVersionPart));
            OnRemoved <ThreadPart>((context, part) => UpdateForumPartCounters(part));

            OnRemoved <ForumPart>((context, b) =>
                                  _threadService.Delete(context.ContentItem.As <ForumPart>()));
        }
Пример #15
0
        public PostPartHandler(IRepository <PostPartRecord> repository,
                               IPostService postService,
                               IThreadService threadService,
                               IForumService forumService,
                               IClock clock)
        {
            _postService   = postService;
            _threadService = threadService;
            _forumService  = forumService;
            _clock         = clock;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape <PostPart>(SetModelProperties);
            OnGetEditorShape <PostPart>(SetModelProperties);
            OnUpdateEditorShape <PostPart>(SetModelProperties);

            OnCreated <PostPart>((context, part) => UpdateCounters(part));
            OnPublished <PostPart>((context, part) => {
                UpdateCounters(part);
                UpdateThreadVersioningDates(part);
            });
            OnUnpublished <PostPart>((context, part) => UpdateCounters(part));
            OnVersioned <PostPart>((context, part, newVersionPart) => UpdateCounters(newVersionPart));
            OnRemoved <PostPart>((context, part) => UpdateCounters(part));

            OnRemoved <ThreadPart>((context, b) =>
                                   _postService.Delete(context.ContentItem.As <ThreadPart>()));

            OnIndexing <PostPart>((context, postPart) => context.DocumentIndex
                                  .Add("body", postPart.Record.Text).RemoveTags().Analyze()
                                  .Add("format", postPart.Record.Format).Store());
        }
Пример #16
0
 public ReportPostAdminController(
     IOrchardServices orchardServices,
     IForumService forumService,
     IThreadService threadService,
     IPostService postService,
     ISiteService siteService,
     IShapeFactory shapeFactory,
     IAuthorizationService authorizationService,
     IAuthenticationService authenticationService,
     ISubscriptionService subscriptionService,
     IReportPostService reportPostService,
     ICountersService countersService
     )
 {
     _orchardServices = orchardServices;
     _forumService = forumService;
     _threadService = threadService;
     _postService = postService;
     _siteService = siteService;
     _subscriptionService = subscriptionService;
     _authorizationService = authorizationService;
     _authenticationService = authenticationService;
     _reportPostService = reportPostService;
     _countersService = countersService;
     T = NullLocalizer.Instance;
     Shape = shapeFactory;
 }
Пример #17
0
        /// <summary>
        /// Create an instance of the hosting class. Has the lifetime of the target. Depends on the
        /// context service for the current thread and runtime.
        /// </summary>
        /// <param name="services">service provider</param>
        public SOSHost(IServiceProvider services)
        {
            Services      = services;
            Target        = services.GetService <ITarget>() ?? throw new DiagnosticsException("No target");
            TargetWrapper = new TargetWrapper(services);
            Target.DisposeOnDestroy(this);
            ConsoleService = services.GetService <IConsoleService>();
            ModuleService  = services.GetService <IModuleService>();
            ThreadService  = services.GetService <IThreadService>();
            MemoryService  = services.GetService <IMemoryService>();
            TargetWrapper.ServiceWrapper.AddServiceWrapper(SymbolServiceWrapper.IID_ISymbolService, () => new SymbolServiceWrapper(services.GetService <ISymbolService>(), MemoryService));
            _ignoreAddressBitsMask = MemoryService.SignExtensionMask();
            _sosLibrary            = services.GetService <SOSLibrary>();

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                var debugClient = new DebugClient(this);
                _interface = debugClient.IDebugClient;
            }
            else
            {
                var lldbServices = new LLDBServices(this);
                _interface = lldbServices.ILLDBServices;
            }
        }
Пример #18
0
        public override void Start()
        {
            base.Start();

            _Target = _Settings.SyncChannel;

            IThreadService.QueueUserWorkItem(x =>
            {
                Start:

                try
                {
                    using (var client = IRedisClientFactory.GetClient())
                        using (var subscription = client.CreateSubscription())
                        {
                            subscription.OnMessage = OnMessage;
                            subscription.SubscribeToChannels(new[] { _Target });
                        }
                }
                catch (RedisException)
                {
                    IThreadService.Sleep(TimeSpan.FromSeconds(30));
                    goto Start;
                }
            });
        }
Пример #19
0
 public PostController(IPostService postService, IThreadService threadService, IUserService userService, IAlertService alertService)
 {
     _postService   = postService;
     _threadService = threadService;
     _userService   = userService;
     _alertService  = alertService;
 }
Пример #20
0
        public DataTargetWrapper(IServiceProvider services, IRuntime runtime)
        {
            Debug.Assert(services != null);
            Debug.Assert(runtime != null);
            _services              = services;
            _runtimeBaseAddress    = runtime.RuntimeModule.ImageBase;
            _symbolService         = services.GetService <ISymbolService>();
            _memoryService         = services.GetService <IMemoryService>();
            _threadService         = services.GetService <IThreadService>();
            _threadUnwindService   = services.GetService <IThreadUnwindService>();
            _moduleService         = services.GetService <IModuleService>();
            _remoteMemoryService   = services.GetService <IRemoteMemoryService>();
            _ignoreAddressBitsMask = _memoryService.SignExtensionMask();

            VTableBuilder builder = AddInterface(IID_ICLRDataTarget, false);

            AddDataTarget(builder);
            IDataTarget = builder.Complete();

            builder = AddInterface(IID_ICLRDataTarget2, false);
            AddDataTarget2(builder);
            builder.Complete();

            builder = AddInterface(IID_ICLRDataTarget4, validate: false);
            builder.AddMethod(new VirtualUnwindDelegate(VirtualUnwind));
            builder.Complete();

            builder = AddInterface(IID_ICLRMetadataLocator, false);
            builder.AddMethod(new GetMetadataDelegate(GetMetadata));
            builder.Complete();

            builder = AddInterface(IID_ICLRRuntimeLocator, false);
            builder.AddMethod(new GetRuntimeBaseDelegate(GetRuntimeBase));
            builder.Complete();
        }
        public ThreadServiceUnitTests()
        {
            var clientFactory = new BlipClientFactory();
            var sender        = clientFactory.BuildBlipClient("dGVzdGluZ2JvdHM6OU8zZEpWbHVaSWZNYmVnOWZaZzM=", Models.BlipProtocol.Http);

            _threadService = new ThreadService(sender);
            _logger        = Substitute.For <ILogger>();
        }
Пример #22
0
 public HotlineController(IHotlineService hotlineService, IThreadService threadService, IOptions <AppSettings> appSettings, IBusinessService businessService, ILoggingService logService)
 {
     _hotlineService  = hotlineService;
     _appSettings     = appSettings;
     _logService      = logService;
     _threadService   = threadService;
     _businessService = businessService;
 }
 public DirectMessageReceivedHandler(IThreadService threadService, IDiscordGuildService discordGuildService,
                                     IBehaviourConfigurationService behaviourConfigurationService, IWorkflowService workflowService)
 {
     _threadService                 = threadService;
     _discordGuildService           = discordGuildService;
     _behaviourConfigurationService = behaviourConfigurationService;
     _workflowService               = workflowService;
 }
Пример #24
0
 public NoteController(INoteService noteService, IThreadService threadService, IOptions <AppSettings> appSettings, IBusinessService businessService, ILoggingService logService)
 {
     _noteService     = noteService;
     _appSettings     = appSettings;
     _logService      = logService;
     _threadService   = threadService;
     _businessService = businessService;
 }
Пример #25
0
 public ReportService(IReportRepository reportRepository, ITicketService ticketService, ICustomerService customerService, IAgentService agentService, IThreadService threadService)
 {
     _reportRepository = reportRepository;
     _agentService     = agentService;
     _threadService    = threadService;
     _customerService  = customerService;
     _ticketService    = ticketService;
 }
Пример #26
0
        public ThreadsController(IThreadService threadService)
        {
            if (threadService == null)
            {
                throw new ArgumentNullException("Thread Service");
            }

            this.threadService = threadService;
        }
Пример #27
0
 public TicketController(ITicketService ticketService, ICustomerService customerService, IThreadService threadService, IOptions <AppSettings> appSettings, IBusinessService businessService, ILoggingService logService)
 {
     _ticketService   = ticketService;
     _appSettings     = appSettings;
     _logService      = logService;
     _threadService   = threadService;
     _customerService = customerService;
     _businessService = businessService;
 }
Пример #28
0
 public Log(
     IDateTimeService dateTimeService,
     IThreadService threadService,
     ILogProvider logProvider)
 {
     _dateTimeService = dateTimeService;
     _threadService   = threadService;
     _logProvider     = logProvider;
 }
Пример #29
0
 public ThreadController(IThreadService threadService,
                         IMapper mapper,
                         UserManager <ApplicationUser> userManager,
                         IPostService postService)
 {
     _threadService = threadService;
     _mapper        = mapper;
     _userManager   = userManager;
     _postService   = postService;
 }
Пример #30
0
 public ZaloService(ICustomerService customerService, IThreadService threadService, IChannelService channelService, IMessageService messageService, ILoggingService logService, IOptions <AppSettings> appSettings, IAgentService agentService)
 {
     _messageService  = messageService;
     _channelService  = channelService;
     _customerService = customerService;
     _threadService   = threadService;
     _logService      = logService;
     _appSettings     = appSettings;
     _agentService    = agentService;
 }
Пример #31
0
        public ThreadServiceShould()
        {
            this.repo             = new MockRepository(MockBehavior.Strict);
            this.threadRepository = repo.Create <IThreadRepository>();
            this.postRepository   = repo.Create <IPostRepository>();
            this.boardRepository  = repo.Create <IBoardRepository>();
            this.fileRepository   = repo.Create <IFileRepository>();

            ts = new ThreadService(this.threadRepository.Object, this.postRepository.Object, this.fileRepository.Object, this.boardRepository.Object);
        }
Пример #32
0
 /// <summary>
 /// Kill the thread service control
 /// </summary>
 public override void Kill()
 {
     lock (this)
     {
         service.Stop();
         service = null;
         state   = Service.State.Stopped;
         Manager.logger.Info("\"{0}\" service killed.", Name);
     }
 }
Пример #33
0
 public HotlineService(ICustomerService customerService, IThreadService threadService, IChannelService channelService,
                       IMessageService messageService, ILoggingService logService, IBusinessService businessService)
 {
     _messageService  = messageService;
     _channelService  = channelService;
     _customerService = customerService;
     _threadService   = threadService;
     _logService      = logService;
     _businessService = businessService;
 }
Пример #34
0
 public ThreadController(IThreadService threads,
                         IStringLocalizer <ThreadController> localizer,
                         ILogger <ThreadController> logger,
                         IMapper mapper)
 {
     this.threads   = threads;
     this.localizer = localizer;
     this.logger    = logger;
     this.mapper    = mapper;
 }
 /// <summary>
 /// Default c'tor with predefined Services
 /// </summary>
 public PredefinedServiceFacade()
 {
     RequestService            = new RequestService();
     RequestParameterService   = new UrlRequestParameterService();
     MappingService            = new JsonMapperService();
     GeolocationMappingService = new GoogleGeolocationMappingService();
     CachingService            = new CachingService();
     SerializationService      = new JsonSerializationService();
     ThreadService             = new ThreadService();
 }
Пример #36
0
        public ServiceFacade(IUserService userService, IMessageService messageService, INotificationService notificationService, IPostService postService, IThreadService threadService)
        {
            AutomapperInitializer.InitAutoMapper();

            _userService         = userService;
            _messageService      = messageService;
            _notificationService = notificationService;
            _postService         = postService;
            _threadService       = threadService;
        }
Пример #37
0
 public CountersService(
     IForumService forumService,
     IThreadService threadService,
     IPostService postService,
     IContentManager contentManager
    )
 {
     _forumService = forumService;
     _threadService = threadService;
     _postService = postService;
     _contentManager = contentManager;
 }
Пример #38
0
        public ForumController(IOrchardServices orchardServices, 
            IForumService forumService,
            IThreadService threadService,
            ISiteService siteService,
            IShapeFactory shapeFactory) {
            _orchardServices = orchardServices;
            _forumService = forumService;
            _threadService = threadService;
            _siteService = siteService;

            Shape = shapeFactory;
            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }
Пример #39
0
        public ThreadPartHandler(IRepository<ThreadPartRecord> repository, 
            IPostService postService,
            IThreadService threadService,
            IContentManager contentManager,
            ICountersService countersService,
            ISubscriptionService subscriptionService,
            IOrchardServices orchardServices
            
            ) {
            _postService = postService;
            _threadService = threadService;
            _contentManager = contentManager;
            _countersService = countersService;
            _subscriptionService = subscriptionService;
            _orchardServices = orchardServices;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape<ThreadPart>(SetModelProperties);
            OnGetEditorShape<ThreadPart>(SetModelProperties);
            OnUpdateEditorShape<ThreadPart>(SetModelProperties);

            OnActivated<ThreadPart>(PropertyHandlers);
            OnLoading<ThreadPart>((context, part) => LazyLoadHandlers(part));

            OnCreated<ThreadPart>((context, part) => { 
                _countersService.UpdateForumPartCounters(part);
                //bit expensive but doesn't happen frequently
                part.ForumsHomepageId = part.ForumPart.ForumCategoryPart.ForumsHomePagePart.Id;   
            });

            OnPublished<ThreadPart>((context, part) => {
                _countersService.UpdateForumPartCounters(part);
                part.LastestValidPostDate = DateTime.UtcNow;
                //bit expensive but doesn't happen frequently
                part.ForumsHomepageId = part.ForumPart.ForumCategoryPart.ForumsHomePagePart.Id;              
            });

            OnUnpublished<ThreadPart>((context, part) => _countersService.UpdateForumPartCounters(part));
            OnVersioning<ThreadPart>((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart));
            OnVersioned<ThreadPart>((context, part, newVersionPart) => _countersService.UpdateForumPartCounters(newVersionPart));
            OnRemoved<ThreadPart>((context, part) => OnThreadRemoved(context, part));
            
            OnRemoved<ForumPart>((context, b) =>
                _threadService.Delete(context.ContentItem.As<ForumPart>(), true));
        }
Пример #40
0
  public ThreadLastReadService(
      IContentManager contentManager,
      IRepository<ThreadLastReadRecord> threadLastReadRepository,
      IRepository<ForumsHomePageLastReadRecord> forumsHomepageLastReadRepository,
      IThreadService threadService,
      IOrchardServices orchardServices,
      ICacheManager cacheManager,
      IClock clock
 )
  {
      _contentManager = contentManager;
      _threadLastReadRepository = threadLastReadRepository;
      _forumsHomepageLastReadRepository = forumsHomepageLastReadRepository;
      _threadService = threadService;
      _orchardServices = orchardServices;
      _cacheManager = cacheManager;
      _clock = clock;
  }
Пример #41
0
        public ForumController(IOrchardServices orchardServices, 
            IForumService forumService,
            IForumPathConstraint forumPathConstraint,
            IThreadService threadService,
            ISiteService siteService,
            IShapeFactory shapeFactory,
            IFeedManager feedManager)
        {
            _orchardServices = orchardServices;
            _forumService = forumService;
            _forumPathConstraint = forumPathConstraint;
            _threadService = threadService;
            _siteService = siteService;
            _feedManager = feedManager;

            T = NullLocalizer.Instance;
            Shape = shapeFactory;
        }
 public void Init()
 {
     this.threadService = TestObjectsFactory.GetThreadService();
 }
 public void Init()
 {
     this.users = TestObjectsFactory.GetUsersRepository();
     this.threads = TestObjectsFactory.GetThreadsRepository();
     this.threadsService = new ThreadService(this.threads, this.users);
 }
 /// <summary>
 /// Parametrized c'tor with variable services
 /// </summary>
 /// <param name="requestService">Reference to the request service</param>
 /// <param name="requestParameterService">refernece to the request paramter service</param>
 /// <param name="mappingService">reference to a mapping service</param>
 /// <param name="geolocationMappingService">Reference to a geolocation mapping service</param>
 /// <param name="cachingService">Reference to a caching service</param>
 /// <param name="serializationService">Reference to a serialization service</param>
 /// <param name="threadService">Reference to a thread service</param>
 /// <param name="mailService">Reference to Mail Service</param>
 public PredefinedServiceFacade(
     IRequestService requestService,
     IRequestParameterService requestParameterService,
     IMappingService mappingService,
     IGeolocationMappingService geolocationMappingService,
     ICachingService cachingService,
     ISerializationService serializationService,
     IThreadService threadService,
     IMailService mailService)
 {
     RequestParameterService = requestParameterService;
     RequestService = requestService;
     MappingService = mappingService;
     GeolocationMappingService = geolocationMappingService;
     CachingService = cachingService;
     SerializationService = serializationService;
     ThreadService = threadService;
     MailService = mailService;
 }
Пример #45
0
 public PingCommand(IThreadService thread)
 {
     _thread = thread;
 }