Exemplo n.º 1
0
 // Umbraco.Code.MapAll -Editor -View -Config -ContentTypeId -ContentTypeName -Locked
 private static void Map(MemberPropertyTypeBasic source, MemberPropertyTypeDisplay target, MapperContext context)
 {
     target.Alias = source.Alias;
     target.AllowCultureVariant = source.AllowCultureVariant;
     target.DataTypeId          = source.DataTypeId;
     target.Description         = source.Description;
     target.GroupId             = source.GroupId;
     target.Id                    = source.Id;
     target.Inherited             = source.Inherited;
     target.IsSensitiveData       = source.IsSensitiveData;
     target.Label                 = source.Label;
     target.MemberCanEditProperty = source.MemberCanEditProperty;
     target.MemberCanViewProperty = source.MemberCanViewProperty;
     target.SortOrder             = source.SortOrder;
     target.Validation            = source.Validation;
 }
Exemplo n.º 2
0
        // no MapAll - take care
        private void Map(IMemberType source, MemberTypeDisplay target, MapperContext context)
        {
            MapTypeToDisplayBase <MemberTypeDisplay, MemberPropertyTypeDisplay>(source, target);

            //map the MemberCanEditProperty,MemberCanViewProperty,IsSensitiveData
            foreach (IPropertyType propertyType in source.PropertyTypes)
            {
                IPropertyType             localCopy   = propertyType;
                MemberPropertyTypeDisplay displayProp = target.Groups.SelectMany(dest => dest.Properties)
                                                        .SingleOrDefault(dest => dest.Alias.InvariantEquals(localCopy.Alias));
                if (displayProp == null)
                {
                    continue;
                }

                displayProp.MemberCanEditProperty = source.MemberCanEditProperty(localCopy.Alias);
                displayProp.MemberCanViewProperty = source.MemberCanViewProperty(localCopy.Alias);
                displayProp.IsSensitiveData       = source.IsSensitiveProperty(localCopy.Alias);
            }
        }