예제 #1
0
        public void SetConfig(IRepositoryPost repository, IRepositoryQc repositoryQc, INotificationCenter notification, PostOtherThemeStrings otherThemeStrings,
                              PostsViewController viewController, string id, int bodyWidth, int row, Action <int, nfloat> postHeightCounted, nfloat height)
        {
            var post = DataService.RepositoryController.RepositoryPost.GetOnePostById(id);

            _market = (EMarketTypes)Enum.Parse(typeof(EMarketTypes), post.ModelPost.Market);
            PostView.SetPostMarket(_market);

            Console.WriteLine(_market + "   " + post.ModelPost.Content);

            PostInteractor = new InteractorPost(id, new OnePostController(DataService.RepositoryController.RepositoryPost), notification, repository, repositoryQc);
            var presenter = new PresenterPost(
                view:               PostView,
                interactor:         PostInteractor,
                router:             new RouterPost(viewController),
                otherThemeStrings:  otherThemeStrings,
                headerStylesHolder: new PostHeaderStylesHolderIOS <GlobalControlsTheme>(iOS_DAL.ThemeParser),
                socialStylesHolder: new PostSocialStylesHolderIOS <GlobalControlsTheme>(iOS_DAL.ThemeParser),
                bodyStylesHolder:   new PostBodyStylesHolderIOS <GlobalControlsTheme>(iOS_DAL.ThemeParser),
                postLocale:         DataService.RepositoryController.RepositoryPost.LangPost,
                isPostDetailed:     false
                );

            SetCellWidth(bodyWidth);
            TransfareActionToView(postHeightCounted, row);

            PostInteractor.SendRequestForPosts();

            var fr = PostView.Frame;

            fr.Height      = height;
            PostView.Frame = fr;
        }
예제 #2
0
        public InteractorPostBody(string postId, INotificationCenterPostBody notificationCenter, IRepositoryPost repository)
        {
            PostId = postId;

            _repository         = repository;
            _notificationCenter = notificationCenter;
            //  _notificationCenter.PostBodyDataIncome = OnNotificationIncome;
        }
예제 #3
0
        public PostsController(IContactCreator contactCreator, Func <string, List <DataModelPost> > parseResponsePost, IRepositoryPost repositoryPost)
        {
            ContactCreator     = contactCreator;
            _parseResponsePost = parseResponsePost;
            _repositoryPost    = repositoryPost;

            _repositoryPost.OnAllPostsIncome += AllPostsIncome;
        }
예제 #4
0
        public InteractorPostSocial(string postId, IPostSocialController postSocialController, INotificationCenterPostSocial notificationCenter, IRepositoryPost repository)
        {
            _postId               = postId;
            _repository           = repository;
            _postSocialController = postSocialController;

            _postSocialController.OnRecieveModel += ControllerOnMessage;
        }
예제 #5
0
        public InteractorPostHeader(string postId, IPostHeaderController postHeaderController, IRepositoryPost repository)
        {
            PostId                = postId;
            _repository           = repository;
            _postHeaderController = postHeaderController;

            _postHeaderController.OnRecieveModel  += ControllerOnMessage;
            _postHeaderController.OnQcModelUpdate += OnMessageQc;
        }
예제 #6
0
        public PostsViewHolder(View itemView, INotificationCenter notification, IRepositoryPost repository, IRepositoryQc repositoryQc,
                               PostOtherThemeStrings otherThemeStrings) : base(itemView)
        {
            _repository   = repository;
            _repositoryQc = repositoryQc;
            _notification = notification;

            _otherThemeStrings = otherThemeStrings;

            _itemView = itemView;
        }
예제 #7
0
        public InteractorPost(string postId, IOnePostController onePostsController, INotificationCenter notificationCenter, IRepositoryPost repository, IRepositoryQc repositoryQc)
        {
            _postId = postId;

            _repository = repository;

            _onePostController = onePostsController;
            _onePostController.OnRecieveModel += ControllerOnMessage;

            InteractorPostBody   = new InteractorPostBody(_postId, notificationCenter, repository);
            InteractorPostChart  = new InteractorPostChart(notificationCenter, repository);
            InteractorPostHeader = new InteractorPostHeader(_postId, new PostHeaderController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseDeletePost, notificationCenter, repositoryQc,
                                                                                              repository.GetPostById(_postId).Quote), repository);
            InteractorPostSocial = new InteractorPostSocial(_postId, new PostSocialController(ConnectionController.GetInstance(), WebMsgParser.ParseResponsePostLike), notificationCenter, repository);
            //InteractorPostStatistics = new InteractorPostStatistics(notificationCenter, repository);
            InteractorTrade = new InteractorTrade(notificationCenter, repository);
        }
예제 #8
0
 public OnePostController(IRepositoryPost repositoryPost)
 {
     _repositoryPost = repositoryPost;
 }
예제 #9
0
 public UpdatePostController(IContactCreator connectionController, Func <string, DataModelPost> parseResponseFunc, INotificationCenterQc notificationCenterQc,
                             IRepositoryQcPrice repositoryQc, IRepositoryPost repositoryPost) : base(connectionController, parseResponseFunc, notificationCenterQc, repositoryQc)
 {
     _repositoryPost = repositoryPost;
 }
예제 #10
0
 public BusinessPost(IRepositoryPost postRepository, IRepositoryUser userRepository)
     : base(postRepository)
 {
     _postRepository = postRepository;
     _userRepository = userRepository;
 }
예제 #11
0
        public InteractorUpdatePost(string postId, IUpdatePostController updatePostController, IRepositoryUpdatePost repositoryUpdatePost, IRepositoryPost repositoryPost, IRepositoryUserAuth repositoryUser)
        {
            if (string.IsNullOrWhiteSpace(postId))
            {
                throw new ArgumentNullException(nameof(postId));
            }
            _updatePostController = updatePostController ?? throw new ArgumentNullException(nameof(updatePostController));
            _repository           = repositoryUpdatePost ?? throw new ArgumentNullException(nameof(repositoryUpdatePost));
            _repositoryUser       = repositoryUser ?? throw new ArgumentNullException(nameof(repositoryUser));

            if (repositoryPost == null)
            {
                throw new ArgumentNullException(nameof(repositoryPost));
            }

            var postModel = repositoryPost.GetPostById(postId);


            if (_repository.UpdatePostModel == null)
            {
                _repository.UpdatePostModel = new UpdatePostModel(postModel.Market == "Simple", postId,
                                                                  postModel.Quote, postModel.Forecast, postModel.Price, postModel.Recommend, postModel.Access, postModel.Image,
                                                                  postModel.Content);
            }

            _updatePostController.OnRecieveModel += ControllerOnMessage;
        }
예제 #12
0
 public BusinessCategory(IRepositoryCategory categoryRepository, IRepositoryPost postRepository)
     : base(categoryRepository)
 {
     _categoryRepository = categoryRepository;
     _postRepository     = postRepository;
 }
 public InteractorPostStatistics(INotificationCenter notificationCenter, IRepositoryPost repository)
 {
     _repository         = repository;
     _notificationCenter = notificationCenter;
 }
예제 #14
0
 public InteractorPostChart(INotificationCenter notificationCenter, IRepositoryPost repository)
 {
     _repository         = repository;
     _notificationCenter = notificationCenter;
 }
예제 #15
0
 public ServicePost(IRepositoryPost repositoryPost, IRepositoryAnswerPost repositoryAnswer)
     : base(repositoryPost)
 {
     _repositoryPost       = repositoryPost;
     _repositoryAnswerPost = repositoryAnswer;
 }