public static string Slugify(this IRegularExpressions expressions, string value) { string slug = ""; if (!string.IsNullOrEmpty(value)) { Regex regex = expressions.GetExpression("SlugReplace"); slug = value.Trim(); slug = slug.Replace(' ', '-'); slug = slug.Replace("---", "-"); slug = slug.Replace("--", "-"); if (regex != null) { slug = regex.Replace(slug, ""); } if (slug.Length * 2 < value.Length) { return(""); } if (slug.Length > 100) { slug = slug.Substring(0, 100); } } return(slug); }
public MetaWeblogAPI(IPostService postService, IAreaService areaService, IUserService userService, ITagService tagService, IRegularExpressions expressions) { this.postService = postService; this.areaService = areaService; this.userService = userService; this.tagService = tagService; this.expressions = expressions; }
public MetaWeblogController(IBlogService blogService, IPostService postService, ITagService tagService, IUserService userService, IRegularExpressions expressions, OxiteContext context) { this.blogService = blogService; this.postService = postService; this.tagService = tagService; this.userService = userService; this.expressions = expressions; this.context = context; }
public static bool IsUrl(this IRegularExpressions expressions, string value) { if (!(value.StartsWith("http://") || value.StartsWith("https://"))) { value = string.Format("http://{0}", value); } return(expressions.IsMatch("IsUrl", value)); }
public PostService(IPostRepository repository, ITrackbackOutboundRepository trackbackOutboundRepository, UrlHelper urlHelper, IRegularExpressions expressions, IValidationService validator, IPluginEngine pluginEngine, ITagService tagService, ICommentService commentService, IModulesLoaded modules, OxiteContext context) { this.repository = repository; this.trackbackOutboundRepository = trackbackOutboundRepository; this.urlHelper = urlHelper; this.expressions = expressions; this.validator = validator; this.pluginEngine = pluginEngine; this.tagService = tagService; this.commentService = commentService; this.cache = modules.GetModules <IOxiteCacheModule>().Reverse().First(); this.context = context; }
public PageValidator(ILocalizationService localizationService, Site site, IRegularExpressions expressions) : base(localizationService, site, expressions) { }
public SiteValidator(ILocalizationService localizationService, IRegularExpressions expressions, OxiteContext context) : base(localizationService, expressions, context) { }
protected ValidatorBase(ILocalizationService localizationService, Site site, IRegularExpressions expressions) { this.localizationService = localizationService; this.site = site; Expressions = expressions; }
protected ValidatorBase(IRegularExpressions expressions) { Expressions = expressions; }
public PluginPropertiesInputValidator(ILocalizationService localizationService, IRegularExpressions expressions, OxiteContext context) : base(localizationService, expressions, context) { }
public UserChangePasswordInputValidator(ILocalizationService localizationService, IRegularExpressions expressions, OxiteContext context) : base(localizationService, expressions, context) { }
public TagService(ITagRepository repository, IRegularExpressions expressions) { this.repository = repository; this.expressions = expressions; }
public PostRepository(OxiteLinqToSqlDataContext context, Site site, IRegularExpressions expressions) { this.context = context; siteID = site.ID; this.expressions = expressions; }
public SomeRequestValidator(IRegularExpressions expressions) : base(expressions) { }
protected ValidatorBase(ILocalizationService localizationService, IRegularExpressions expressions, OxiteContext context) { this.localizationService = localizationService; Expressions = expressions; this.context = context; }