public DeleteImageCommand(ObjectRepository repository, string galleryDirectoryPath, Image image, string imageTitle) { GalleryDirectoryPath = galleryDirectoryPath; _targetName = "Image"; itemTitle = imageTitle; Image = image; }
public DeleteCategoryCommand(ObjectRepository repository, int categoryID, string categoryTitle) { _targetName = "Category"; _targetID = categoryID; itemTitle = categoryTitle; Repository = repository; }
public DeletePostCommand(ObjectRepository repository, int postID, ISearchEngineService searchEngineService) { _targetName = "Post"; _targetID = postID; Repository = repository; SearchEngine = searchEngineService; }
public ImportLinksCommand(ObjectRepository repository, OpmlItemCollection links, int catID) : this() { _linksToImport = links; _categoryID = catID; Repository = repository; }
public DeleteKeyWordCommand(ObjectRepository repository, int keyWordId, string word) { AutoRedirect = true; _targetName = "KeyWord"; _targetID = keyWordId; itemTitle = word; _repository = repository; }
public DeleteGalleryCommand(ObjectRepository repository, HttpServerUtilityBase server, string galleryDirectoryPath, int galleryId, string galleryTitle) { _server = server; _targetID = galleryId; itemTitle = galleryTitle; GalleryDirectoryPath = galleryDirectoryPath; Repository = repository; }
public DeleteLinkCommand(ObjectRepository repository, int linkId, string linkTitle) { AutoRedirect = true; _targetName = "Link"; _targetID = linkId; itemTitle = linkTitle; Repository = repository; }
public SubtextContext(Blog blog, RequestContext requestContext, BlogUrlHelper urlHelper, ObjectRepository repository, IPrincipal user, ICache cache, IDependencyResolver serviceLocator) { Blog = blog; RequestContext = requestContext; UrlHelper = urlHelper; Repository = repository; User = user ?? requestContext.HttpContext.User; Cache = cache ?? new SubtextCache(requestContext.HttpContext.Cache); ServiceLocator = serviceLocator; }
public KeywordExpander(ObjectRepository repository) { _repository = repository; }
public BlogLookupService(ObjectRepository repository, LazyNotNull<HostInfo> hostInfo) { Repository = repository; _hostInfo = hostInfo; }
private static void CreateWelcomeComment(ObjectRepository repository, AdminUrlHelper adminUrlHelper, Entry entry) { string commentBody = ScriptHelper.UnpackEmbeddedScriptAsString("WelcomeComment.htm"); string feedbackUrl = adminUrlHelper.FeedbackList(); commentBody = string.Format(commentBody, feedbackUrl); var comment = new FeedbackItem(FeedbackType.Comment) { Title = "re: Welcome to Subtext!", Entry = entry, Author = "Subtext", Approved = true, Body = commentBody }; repository.Create(comment); }
private static void CreateWelcomeCategories(ObjectRepository repository, Blog blog) { repository.CreateLinkCategory(new LinkCategory { Title = "Programming", Description = "Blog posts related to programming", BlogId = blog.Id, IsActive = true, CategoryType = CategoryType.PostCollection, }); repository.CreateLinkCategory(new LinkCategory { Title = "Personal", Description = "Personal musings, random thoughts.", BlogId = blog.Id, IsActive = true, CategoryType = CategoryType.PostCollection }); }
public AjaxServices(ObjectRepository repository) { Repository = repository; }
public HostAccountService(HostInfo hostInfo, ISubtextContext context) : base(context) { _repository = context.Repository; _hostInfo = hostInfo; }
/// <summary> /// Creates the host in the persistent store. /// </summary> /// <returns></returns> public static bool CreateHost(ObjectRepository repository, string hostUserName, string hostPassword, string email) { if (_instance.Value != null) { throw new InvalidOperationException(Resources.InvalidOperation_HostRecordAlreadyExists); } var host = new HostInfo(ConfigurationManager.AppSettings) { HostUserName = hostUserName, Email = email }; SetHostPassword(host, hostPassword); return repository.UpdateHost(host); }
public SlugGenerator(FriendlyUrlSettings slugSettings, ObjectRepository repository) { SlugSettings = slugSettings ?? DefaultSettings; Repository = repository; }
public static HostInfo LoadHostInfoFromDatabase(ObjectRepository repository, bool suppressException) { try { return repository.LoadHostInfo(new HostInfo(ConfigurationManager.AppSettings)); } catch (SqlException e) { // LoadHostInfo now executes the stored proc subtext_GetHost, instead of checking the table subtext_Host if (e.Message.IndexOf("Invalid object name 'subtext_Host'") >= 0 || e.Message.IndexOf("Could not find stored procedure 'subtext_GetHost'") >= 0) { if (suppressException) { return null; } throw new HostDataDoesNotExistException(); } throw; } }
/// <summary> /// Updates the host in the persistent store. /// </summary> /// <param name="host">Host.</param> /// <returns></returns> public static bool UpdateHost(ObjectRepository repository, HostInfo host) { if (repository.UpdateHost(host)) { return true; } return false; }
public DeleteImageCommand(ObjectRepository repository, Image image, string galleryDirectoryPath) : this(repository, galleryDirectoryPath, image, "Image " + image.ImageID.ToString(CultureInfo.InvariantCulture)) { }
public static Mock<ISubtextContext> SetupRepository(this Mock<ISubtextContext> context, ObjectRepository repository) { context.Setup(c => c.Repository).Returns(repository); return context; }
static Link CreateLink(ObjectRepository repository, string title, int? categoryId, int? postId) { var link = new Link(); link.IsActive = true; link.BlogId = Config.CurrentBlog.Id; if (categoryId != null) { link.CategoryId = (int)categoryId; } link.Title = title; if (postId != null) { link.PostId = (int)postId; } int linkId = repository.CreateLink(link); Assert.AreEqual(linkId, link.Id); return link; }
public BlogImportSetup(Blog blog, ObjectRepository repository) { Blog = blog; Repository = repository; SetupBlogForImport(); }
static int[] CreateSomePostCategories(ObjectRepository repository) { var categoryIds = new int[3]; categoryIds[0] = repository.CreateLinkCategory(CreateCategory("My Favorite Feeds", "Some of my favorite RSS feeds", CategoryType.PostCollection, true)); categoryIds[1] = repository.CreateLinkCategory(CreateCategory("Google Blogs", "My favorite Google blogs", CategoryType.PostCollection, true)); categoryIds[2] = repository.CreateLinkCategory(CreateCategory("Microsoft Blogs", "My favorite Microsoft blogs", CategoryType.PostCollection, false)); return categoryIds; }
/// <summary> /// Updates the host in the persistent store. /// </summary> /// <param name="host">Host.</param> /// <returns></returns> public static bool UpdateHost(ObjectRepository repository, HostInfo host) { if (repository.UpdateHost(host)) { _instance = new Lazy<HostInfo>(() => host); return true; } return false; }
public IPagedCollection<BlogAlias> GetBlogAliases(ObjectRepository repository, int pageIndex, int pageSize) { return repository.GetPagedBlogDomainAlias(this, pageIndex, pageSize); }