public void Describe(BindingDescribeContext context) { context.For<EnumerationField>() .Binding("SelectedValues", (contentItem, field, s) => { var items = (s ?? "").Split(new[] {',', ';'}, StringSplitOptions.RemoveEmptyEntries); field.SelectedValues = items; }); }
public void Describe(BindingDescribeContext context) { context.For <EnumerationField>() .Binding("SelectedValues", (contentItem, field, s) => { var items = (s ?? "").Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries); field.SelectedValues = items; }); }
public void Describe(BindingDescribeContext context) { context.For<UserPart>() .Binding("UserName", (contentItem, part, s) => { part.UserName = s; part.NormalizedUserName = s.ToLowerInvariant(); }) .Binding("Email", (contentItem, part, s) => part.Email = s) .Binding("Password", (contentItem, part, s) => { part.HashAlgorithm = "SHA1"; _membershipService.SetPassword(part, s); }); }
public void Describe(BindingDescribeContext context) { context.For<TaxonomyField>() .Binding("Terms", (contentItem, field, s) => { var selectedTerms = s.Split(new []{',', ';'}, StringSplitOptions.RemoveEmptyEntries) .Select(XmlHelper.Parse<int?>) .Select(t => GetTerm(t.GetValueOrDefault())) .Where(t => t != null).ToList(); _taxonomyService.UpdateTerms(contentItem, selectedTerms, field.Name); }); }
public void Describe(BindingDescribeContext context) { context.For <TaxonomyField>() .Binding("Terms", (contentItem, field, s) => { var selectedTerms = s.Split(new [] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) .Select(XmlHelper.Parse <int?>) .Select(t => GetTerm(t.GetValueOrDefault())) .Where(t => t != null).ToList(); _taxonomyService.UpdateTerms(contentItem, selectedTerms, field.Name); }); }
public void Describe(BindingDescribeContext context) { context.For <UserPart>() .Binding("UserName", (contentItem, part, s) => { part.UserName = s; part.NormalizedUserName = s.ToLowerInvariant(); }) .Binding("Email", (contentItem, part, s) => part.Email = s) .Binding("Password", (contentItem, part, s) => { part.HashAlgorithm = "SHA1"; _membershipService.SetPassword(part, s); }); }
public void Describe(BindingDescribeContext context) { context.For<EnumerationField>() .Binding("SelectedValues", (contentItem, field, s) => { if (String.IsNullOrWhiteSpace(s)) { field.Value = ""; return; } var separators = new[] {',', ';'}; var hasMultipleValues = s.IndexOfAny(separators) >= 0; if (hasMultipleValues) field.SelectedValues = s.Split(separators, StringSplitOptions.RemoveEmptyEntries); else { field.Value = s; } }); }
public void Describe(BindingDescribeContext context) { context.For <EnumerationField>() .Binding("SelectedValues", (contentItem, field, s) => { if (String.IsNullOrWhiteSpace(s)) { field.Value = ""; return; } var separators = new[] { ',', ';' }; var hasMultipleValues = s.IndexOfAny(separators) >= 0; if (hasMultipleValues) { field.SelectedValues = s.Split(separators, StringSplitOptions.RemoveEmptyEntries); } else { field.Value = s; } }); }
public void Describe(BindingDescribeContext context) { context.For<InputField>() .Binding("Text", (contentItem, field, s) => field.Value = s); }
public void Describe(BindingDescribeContext context) { context.For <BooleanField>() .Binding("Value", (contentItem, field, s) => field.Value = IsTrueish(s)); }
public void Describe(BindingDescribeContext context) { context.For<BooleanField>() .Binding("Value", (contentItem, field, s) => field.Value = IsTrueish(s)); }
public void Describe(BindingDescribeContext context) { context.For <ImageFileField>() .Binding("Text", (contentItem, field, s) => field.FilePath = s); }
public void Describe(BindingDescribeContext context) { context.For<BodyPart>() .Binding("Text", (contentItem, part, s) => part.Text = s); }
public void Describe(BindingDescribeContext context) { context.For <NumericField>() .Binding("Value", (contentItem, field, s) => field.Value = XmlHelper.Parse <decimal>(s)); }
public void Describe(BindingDescribeContext context) { context.For<ImageFileField>() .Binding("Text", (contentItem, field, s) => field.FilePath = s); }
public void Describe(BindingDescribeContext context) { context.For <TextField>() .Binding("Text", (contentItem, field, s) => field.Value = s); }
public void Describe(BindingDescribeContext context) { context.For <BodyPart>() .Binding("Text", (contentItem, part, s) => part.Text = s); }
public void Describe(BindingDescribeContext context) { context.For<TitlePart>() .Binding("Title", (contentItem, part, s) => part.Title = s); }
public void Describe(BindingDescribeContext context) { context.For <TitlePart>() .Binding("Title", (contentItem, part, s) => part.Title = s); }