public DialogResult CreateContentFromFile(IWin32Window dialogOwner, ISmartContent content, string[] files, object context)
        {
            bool youtubeEnabled = MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.YouTubeVideo);

            if (!youtubeEnabled)
            {
                return(DialogResult.Cancel);
            }

            Trace.Assert(files.Length == 1, "Cannot insert more then 1 video at once through drag and drop.");

            IBlogContext blogContext = dialogOwner as IBlogContext;

            List <MediaTab> videoSources = new List <MediaTab>();

            videoSources.Add(new WebVideoSource());

            VideoPublishSource videoPublishSource = new VideoPublishSource(Options.GetString("Video.lastPermission", String.Empty));

            videoPublishSource.SelectedPath = files[0];
            videoSources.Add(videoPublishSource);

            VideoServiceVideoSource source = new VideoServiceVideoSource();

            source.RegisterServices(new IVideoService[] { new YouTubeVideoService() });

            videoSources.Add(source);

            return(CreateContentForm(dialogOwner, content, videoSources, 1));
        }
        public DialogResult CreateContentFromTabbedDialog(IWin32Window dialogOwner, ISmartContent content, int selectedTab)
        {
            bool youtubeEnabled = MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.YouTubeVideo);

            if (!youtubeEnabled)
            {
                return(DialogResult.Cancel);
            }

            IBlogContext blogContext = dialogOwner as IBlogContext;

            List <MediaTab> videoSources = new List <MediaTab>();

            videoSources.Add(new WebVideoSource());

            VideoPublishSource videoPublishSource = new VideoPublishSource(Options.GetString("Video.lastPermission", String.Empty));

            //videoPublishSource.SelectedPath = files[0];
            videoSources.Add(videoPublishSource);

            VideoServiceVideoSource source = new VideoServiceVideoSource();

            source.RegisterServices(new IVideoService[] { new YouTubeVideoService() });

            videoSources.Add(source);

            return(CreateContentForm(dialogOwner, content, videoSources, selectedTab));
        }
Exemplo n.º 3
0
 public BlogRepository(IBlogContext context, ITagsInString tagsInString,
                       IPropertyMappingService mappingService, IQueryableSorter queryableSorter)
 {
     this.context         = context;
     this.tagsInString    = tagsInString;
     this.mappingService  = mappingService;
     this.queryableSorter = queryableSorter;
 }
Exemplo n.º 4
0
        public UnitOfWork(IBlogContext db)
        {
            _db = db;

            _questRepos = new Lazy <GenericGenericRepository <Question> >(
                () => new GenericGenericRepository <Question>(_db));
            _articleRepos = new Lazy <GenericGenericRepository <Article> >(
                () => new GenericGenericRepository <Article>(_db));
            _commentRepos = new Lazy <GenericGenericRepository <Comment> >(
                () => new GenericGenericRepository <Comment>(_db));
            _userRepos = new Lazy <GenericGenericRepository <User> >(
                () => new GenericGenericRepository <User>(_db));
            _tagRepos = new Lazy <GenericGenericRepository <Tag> >(
                () => new GenericGenericRepository <Tag>(_db));
            UserManager = new ApplicationUserManager(new UserStore <IdentityUser>((BlogContext)_db));
            RoleManager = new ApplicationRoleManager(new RoleStore <ApplicationRole>((BlogContext)_db));
        }
 public AccountController(
     //OpenIdMembershipService membershipService,
     IBlogContext context,
     IRepository <User> userRepository,
     IRepository <Data.Blog> blogRepo,
     IRepository <Invitation> invitationRepository,
     IAttacher <User> userAttacher,
     IAttacher <Securable> securableAttacher,
     ISecurityHelper securityHelper,
     IHttpContextService httpContext)
     : base(blogRepo, httpContext)
 {
     _context              = context;
     _userRepository       = userRepository;
     _invitationRepository = invitationRepository;
     _userAttacher         = userAttacher;
     _securableAttacher    = securableAttacher;
     _securityHelper       = securityHelper;
 }
        public override DialogResult CreateContent(IWin32Window dialogOwner, ISmartContent content)
        {
            IBlogContext blogContext = dialogOwner as IBlogContext;

            List <MediaTab> videoSources = new List <MediaTab>();

            videoSources.Add(new WebVideoSource());

            bool youtubeEnabled = MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.YouTubeVideo);

            if (youtubeEnabled)
            {
                videoSources.Add(new VideoPublishSource(Options.GetString("Video.lastPermission", String.Empty)));

                VideoServiceVideoSource source = new VideoServiceVideoSource();
                source.RegisterServices(new IVideoService[] { new YouTubeVideoService() });

                videoSources.Add(source);
            }

            return(CreateContentForm(dialogOwner, content, videoSources, 0));
        }
        public override DialogResult CreateContent(IWin32Window dialogOwner, ISmartContent newContent)
        {
            IBlogContext blogContext = dialogOwner as IBlogContext;

            if (blogContext != null)
            {
                _currentBlogId = blogContext.CurrentAccountId;
            }

            TagContext context = new TagContext(newContent, Options, _currentBlogId);

            using (TagForm form = new TagForm(context))
            {
                DialogResult result = form.ShowDialog(dialogOwner);
                if (result == DialogResult.OK)
                {
                    context.Tags            = form.Tags;
                    context.CurrentProvider = form.TagProvider;
                    context.AddTagsToHistory(form.Tags);
                }
                return(result);
            }
        }
Exemplo n.º 8
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            bool executeMigration = Convert.ToBoolean(Configuration.GetSection("Database:ExecuteEntityMigration").Value);

            if (executeMigration)
            {
                IBlogContext dbContext = app.ApplicationServices.GetService <IBlogContext>();
                dbContext.Database.Migrate();
                dbContext.User.Add(new User
                {
                    Id      = 1,
                    Name    = "Vikas Sharma",
                    Email   = "*****@*****.**",
                    Website = "vik-sharma.medium.com"
                });
                ((DbContext)dbContext).SaveChanges();
                dbContext.Post.Add(new Post
                {
                    Body   = "This is my first Herokuapp Postgres Db app",
                    Title  = "GraphQL+ EF + Postgres",
                    Id     = 1,
                    UserId = 1
                });
                ((DbContext)dbContext).SaveChanges();
            }
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();
            // Graph QL
            app.UseGraphQLPlayground();
            //app.UseGraphQLGraphiQL();
            app.UseMvc();
        }
        private DialogResult CreateContentForm(IWin32Window dialogOwner, ISmartContent content, List <MediaTab> videoSources, int selectedTab)
        {
            using (new WaitCursor())
            {
                IBlogContext      blogContext       = dialogOwner as IBlogContext;
                VideoSmartContent videoSmartContent = new VideoSmartContent(content);
                using (MediaInsertForm videoBrowserForm = new MediaInsertForm(videoSources, blogContext.CurrentAccountId, selectedTab, videoSmartContent, Res.Get(StringId.Plugin_Videos_Select_Video_Form), true))
                {
                    if (videoBrowserForm.ShowDialog(dialogOwner) == DialogResult.OK)
                    {
                        string VIDEO_LAST_PERMISSION = "Video.lastPermission";
                        Options.SetString(VIDEO_LAST_PERMISSION, videoSmartContent.Permission);

                        videoBrowserForm.SaveContent(videoSmartContent);

                        return(DialogResult.OK);
                    }
                    else
                    {
                        return(DialogResult.Cancel);
                    }
                }
            }
        }
Exemplo n.º 10
0
 public BlogRepository(IBlogContext newContext)
 {
     _context = newContext;
 }
Exemplo n.º 11
0
 public PostsWCFTest()
 {
     this._blogService    = new BlogService();
     this._blogContext    = new BlogContext();
     this._userController = new UserController();
 }
 public CategoriesViewComponent(IBlogContext context)
 {
     this.context = context;
 }
Exemplo n.º 13
0
 public GraphQlController(ISchema schema, IDocumentExecuter executer, IBlogContext context)
 {
     this.schema   = schema;
     this.executer = executer;
     this.context  = context;
 }
Exemplo n.º 14
0
 public BlogRepository()
 {
     _blogContext = new BlogContext();
 }
Exemplo n.º 15
0
 public GenderRepo(IBlogContext db)
 {
     this._db = db;
 }
Exemplo n.º 16
0
 public EfPostRepository(IBlogContext context, IMarkdownService markdown)
 {
     Context = context;
     Markdown = markdown;
 }
Exemplo n.º 17
0
 public CodeRepo(IBlogContext db)
 {
     this._db = db;
 }
Exemplo n.º 18
0
 public PostCommandRepository(IBlogContext context)
 {
     _context = context;
 }
Exemplo n.º 19
0
 public CreateProductCommandHandler(IBlogContext context)
 {
     _context = context;
 }
 public BlogController(IBlogContext context)
 {
     this.context = context;
 }
 public GetDraftQuery(IBlogContext context, int id, string postUrl)
 {
     this.context = context;
     this.id = id;
     this.postUrl = postUrl;
 }
Exemplo n.º 22
0
 public DeleteCustomerCardCommandHandler(IBlogContext context)
 {
     _context = context;
 }
Exemplo n.º 23
0
 public GetCategoriesQuery(IBlogContext context)
 {
     this.context = context;
 }
Exemplo n.º 24
0
 public BlogService(IBlogContext context, IMapper mapper)
 {
     _context    = context;
     _repository = _context.Set <Blog>();
     _mapper     = mapper;
 }
Exemplo n.º 25
0
 public CreateMerchantCommandHandler(IBlogContext context)
 {
     _context = context;
 }
Exemplo n.º 26
0
 public GetPostsQuery(IBlogContext context)
 {
     this.context = context;
 }
Exemplo n.º 27
0
 public SecurityHelper(IBlogContext context)
 {
     _context = context;
 }
Exemplo n.º 28
0
 public CreateCreatorCommandHandler(IBlogContext context)
 {
     _context = context;
 }
Exemplo n.º 29
0
 public GetProductQueryHandler(IBlogContext context)
 {
     _context = context;
 }
 public GetCategoriesRequestHandler(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
Exemplo n.º 31
0
 public UpdatePostRequestHandler(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
Exemplo n.º 32
0
 public GetSinglePostQueryHandler(IBlogContext blogContext, IMapper mapper)
 {
     _blogContext = blogContext;
     _mapper      = mapper;
 }
Exemplo n.º 33
0
 public UserRepo(IBlogContext db)
 {
     this._db = db;
 }
Exemplo n.º 34
0
 public DeleteCommentCommandHandler(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
Exemplo n.º 35
0
 public BlogRepository(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
Exemplo n.º 36
0
 public GetPostRequestHandler(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
 public GetMerchantQueryHandler(IBlogContext context)
 {
     _context = context;
 }
Exemplo n.º 38
0
 public GetPostQuery(IBlogContext context, string categoryCode, string postUrl)
 {
     this.context = context;
     this.categoryCode = categoryCode;
     this.postUrl = postUrl;
 }