コード例 #1
0
 public void Describe(BindingDescribeContext context) {
     context.For<EnumerationField>()
         .Binding("SelectedValues", (contentItem, field, s) => {
             var items = (s ?? "").Split(new[] {',', ';'}, StringSplitOptions.RemoveEmptyEntries);
             field.SelectedValues = items;
         });
 }
コード例 #2
0
 public void Describe(BindingDescribeContext context)
 {
     context.For <EnumerationField>()
     .Binding("SelectedValues", (contentItem, field, s) => {
         var items            = (s ?? "").Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
         field.SelectedValues = items;
     });
 }
コード例 #3
0
 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);
         });
 }
コード例 #4
0
        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);
                });
        }
コード例 #5
0
        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);
            });
        }
コード例 #6
0
 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);
     });
 }
コード例 #7
0
        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;
                    }
                });
        }
コード例 #8
0
        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;
                }
            });
        }
コード例 #9
0
 public void Describe(BindingDescribeContext context) {
     context.For<InputField>()
         .Binding("Text", (contentItem, field, s) => field.Value = s);
 }
コード例 #10
0
 public void Describe(BindingDescribeContext context)
 {
     context.For <BooleanField>()
     .Binding("Value", (contentItem, field, s) => field.Value = IsTrueish(s));
 }
コード例 #11
0
 public void Describe(BindingDescribeContext context) {
     context.For<BooleanField>()
         .Binding("Value", (contentItem, field, s) => field.Value = IsTrueish(s));
 }
コード例 #12
0
 public void Describe(BindingDescribeContext context)
 {
     context.For <ImageFileField>()
     .Binding("Text", (contentItem, field, s) => field.FilePath = s);
 }
コード例 #13
0
 public void Describe(BindingDescribeContext context) {
     context.For<BodyPart>()
         .Binding("Text", (contentItem, part, s) => part.Text = s);
 }
コード例 #14
0
 public void Describe(BindingDescribeContext context)
 {
     context.For <NumericField>()
     .Binding("Value", (contentItem, field, s) => field.Value = XmlHelper.Parse <decimal>(s));
 }
コード例 #15
0
 public void Describe(BindingDescribeContext context) {
     context.For<ImageFileField>()
         .Binding("Text", (contentItem, field, s) => field.FilePath = s);
 }
コード例 #16
0
 public void Describe(BindingDescribeContext context)
 {
     context.For <TextField>()
     .Binding("Text", (contentItem, field, s) => field.Value = s);
 }
コード例 #17
0
 public void Describe(BindingDescribeContext context)
 {
     context.For <BodyPart>()
     .Binding("Text", (contentItem, part, s) => part.Text = s);
 }
コード例 #18
0
 public void Describe(BindingDescribeContext context) {
     context.For<TitlePart>()
         .Binding("Title", (contentItem, part, s) => part.Title = s);
 }
コード例 #19
0
 public void Describe(BindingDescribeContext context)
 {
     context.For <TitlePart>()
     .Binding("Title", (contentItem, part, s) => part.Title = s);
 }