예제 #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 void CreateViper(string postId)
        {
            var post   = DataService.RepositoryController.RepositoryPost.GetOnePostById(postId);
            var market = post.ModelPost.Market;

            _postView = _itemView.FindViewById <PostView>(Resource.Id.post_postView);
            _postView.SetPostMarket((EMarketTypes)Enum.Parse(typeof(EMarketTypes), market));
            _interactor = new InteractorPost(postId, new OnePostController(DataService.RepositoryController.RepositoryPost), _notification, _repository, _repositoryQc); //TODO remove _notification, _repository, _repositoryQc

            var presenter = new PresenterPost(
                view:                   _postView,
                interactor:             _interactor,
                router:                 new RouterPost(Application.Context),
                otherThemeStrings:      _otherThemeStrings,
                headerStylesHolder:     new PostHeaderStylesHolderDroid <GlobalControlsTheme>(DroidDAL.ThemeParser),
                socialStylesHolder:     new PostSocialStylesHolderDroid <GlobalControlsTheme>(DroidDAL.ThemeParser),
                bodyStylesHolder:       new PostBodyStylesHolderDroid <GlobalControlsTheme>(DroidDAL.ThemeParser),
                postLocale:             DataService.RepositoryController.RepositoryPost.LangPost,
                isPostDetailed:         false
                );

            _interactor.SendRequestForPosts();
        }