Example #1
0
 public CommentService(ICommentRepository commentRepository, IUnitOfWork unitOfWork, ICommentValidator commentValidator, IIdentityService identityService)
 {
     _commentRepository = commentRepository;
     _unitOfWork        = unitOfWork;
     _commentValidator  = commentValidator;
     _identityService   = identityService;
 }
		public HomeController(IOrchardServices orchardServices, IContactUsService contactUsService, ICommentValidator commentValidator, IMessageManager messageManager, IMembershipService membershipService)
		{
			Services	 = orchardServices;
			_contactUsService = contactUsService;
			_commentValidator = commentValidator;
			_membershipService = membershipService;
			_messageManager = messageManager;
		}
 public CommentService(IClock clock,
                       ICommentValidator commentValidator,
                       IOrchardServices orchardServices) {
     _clock = clock;
     _commentValidator = commentValidator;
     _orchardServices = orchardServices;
     Logger = NullLogger.Instance;
 }
Example #4
0
 public CommentService(IClock clock,
                       ICommentValidator commentValidator,
                       IOrchardServices orchardServices)
 {
     _clock            = clock;
     _commentValidator = commentValidator;
     _orchardServices  = orchardServices;
     Logger            = NullLogger.Instance;
 }
Example #5
0
 public CommentService(IRepository<ClosedCommentsRecord> closedCommentsRepository,
                       IClock clock,
                       ICommentValidator commentValidator,
                       IContentManager contentManager) {
     _closedCommentsRepository = closedCommentsRepository;
     _clock = clock;
     _commentValidator = commentValidator;
     _contentManager = contentManager;
     Logger = NullLogger.Instance;
 }
 public CommentProcessor(AppConfiguration appConfiguration,
                         ILogger logger,
                         IRedditService redditService,
                         ICommentValidator commentValidator,
                         ICommentDetector commentDetector,
                         IDeltaAwarder deltaAwarder,
                         ICommentReplier commentReplier,
                         IDB4Repository db4Repository)
 {
     _appConfiguration = appConfiguration;
     _logger           = logger;
     _redditService    = redditService;
     _commentValidator = commentValidator;
     _commentDetector  = commentDetector;
     _deltaAwarder     = deltaAwarder;
     _commentReplier   = commentReplier;
     _db4Repository    = db4Repository;
 }
Example #7
0
 public CommentService(ICommentRepository commentRepository, ICommentValidator commentValidator)
 {
     _commentValidator = commentValidator;
     _comRepo          = commentRepository;
 }
Example #8
0
 public ValidatedWriter(ICommentValidator validator, ICommentWriter writer)
 {
     _validator = validator;
     _writer    = writer;
 }
Example #9
0
        public CommentListViewModel(IODataClient oDataClient,
                                    ICommentValidator commentValidator,
                                    ISanaapAppTranslateService translateService,
                                    IUserDialogs userDialogs,
                                    IEventAggregator eventAggregator,
                                    ICommentService commentService,
                                    IPageDialogService pageDialogService)
        {
            _oDataClient    = oDataClient;
            _userDialogs    = userDialogs;
            _commentService = commentService;

            CommentTypes = EnumHelper <CommentType> .GetDisplayValues(CommentType.Complaint);

            SelectedCommentType = CommentTypes[1];

            CreateComment = new BitDelegateCommand(async() =>
            {
                submitCancellationTokenSource?.Cancel();
                submitCancellationTokenSource = new CancellationTokenSource();

                using (userDialogs.Loading(ConstantStrings.Loading, cancelText: ConstantStrings.Loading_Cancel, onCancel: submitCancellationTokenSource.Cancel))
                {
                    Comment.CommentType = (CommentType)CommentTypes.IndexOf(SelectedCommentType);

                    if (!commentValidator.IsValid(Comment, out string errorMessage))
                    {
                        await pageDialogService.DisplayAlertAsync(string.Empty, translateService.Translate(errorMessage), ConstantStrings.Ok);
                        return;
                    }

                    Comment = await commentService.AddAsync(Comment);

                    await pageDialogService.DisplayAlertAsync(string.Empty, ConstantStrings.SuccessfulProcess, ConstantStrings.Ok);

                    Comment = new CommentDto();

                    eventAggregator.GetEvent <OpenCreateCommentPopupEvent>().Publish(new OpenCreateCommentPopupEvent());

                    await loadComments();
                }
            });

            ShowComment = new BitDelegateCommand <CommentItemSource>(async(comment) =>
            {
                if (string.IsNullOrEmpty(comment.Answer))
                {
                    comment.Answer = ConstantStrings.ResponseNotFoundFromSupport;
                }

                await NavigationService.NavigateAsync(nameof(CommentAnswerPopupView), new NavigationParameters
                {
                    { nameof(Comment), comment }
                });
            });

            OpenCreatePopup = new BitDelegateCommand(async() =>
            {
                eventAggregator.GetEvent <OpenCreateCommentPopupEvent>().Publish(new OpenCreateCommentPopupEvent());
            });
        }