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));
        }
 public BlogRepository(IBlogContext context, ITagsInString tagsInString,
                       IPropertyMappingService mappingService, IQueryableSorter queryableSorter)
 {
     this.context         = context;
     this.tagsInString    = tagsInString;
     this.mappingService  = mappingService;
     this.queryableSorter = queryableSorter;
 }
        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);
            }
        }
Beispiel #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);
                    }
                }
            }
        }
Beispiel #10
0
 public BlogRepository(IBlogContext newContext)
 {
     _context = newContext;
 }
 public PostsWCFTest()
 {
     this._blogService    = new BlogService();
     this._blogContext    = new BlogContext();
     this._userController = new UserController();
 }
 public CategoriesViewComponent(IBlogContext context)
 {
     this.context = context;
 }
Beispiel #13
0
 public GraphQlController(ISchema schema, IDocumentExecuter executer, IBlogContext context)
 {
     this.schema   = schema;
     this.executer = executer;
     this.context  = context;
 }
Beispiel #14
0
 public BlogRepository()
 {
     _blogContext = new BlogContext();
 }
 public GenderRepo(IBlogContext db)
 {
     this._db = db;
 }
 public EfPostRepository(IBlogContext context, IMarkdownService markdown)
 {
     Context = context;
     Markdown = markdown;
 }
Beispiel #17
0
 public CodeRepo(IBlogContext db)
 {
     this._db = db;
 }
Beispiel #18
0
 public PostCommandRepository(IBlogContext context)
 {
     _context = context;
 }
Beispiel #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;
 }
Beispiel #22
0
 public DeleteCustomerCardCommandHandler(IBlogContext context)
 {
     _context = context;
 }
Beispiel #23
0
 public GetCategoriesQuery(IBlogContext context)
 {
     this.context = context;
 }
 public BlogService(IBlogContext context, IMapper mapper)
 {
     _context    = context;
     _repository = _context.Set <Blog>();
     _mapper     = mapper;
 }
Beispiel #25
0
 public CreateMerchantCommandHandler(IBlogContext context)
 {
     _context = context;
 }
Beispiel #26
0
 public GetPostsQuery(IBlogContext context)
 {
     this.context = context;
 }
Beispiel #27
0
 public SecurityHelper(IBlogContext context)
 {
     _context = context;
 }
Beispiel #28
0
 public CreateCreatorCommandHandler(IBlogContext context)
 {
     _context = context;
 }
Beispiel #29
0
 public GetProductQueryHandler(IBlogContext context)
 {
     _context = context;
 }
 public GetCategoriesRequestHandler(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
Beispiel #31
0
 public UpdatePostRequestHandler(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
 public GetSinglePostQueryHandler(IBlogContext blogContext, IMapper mapper)
 {
     _blogContext = blogContext;
     _mapper      = mapper;
 }
 public UserRepo(IBlogContext db)
 {
     this._db = db;
 }
 public DeleteCommentCommandHandler(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
Beispiel #35
0
 public BlogRepository(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
Beispiel #36
0
 public GetPostRequestHandler(IBlogContext blogContext)
 {
     _blogContext = blogContext;
 }
 public GetMerchantQueryHandler(IBlogContext context)
 {
     _context = context;
 }
 public GetPostQuery(IBlogContext context, string categoryCode, string postUrl)
 {
     this.context = context;
     this.categoryCode = categoryCode;
     this.postUrl = postUrl;
 }