Beispiel #1
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            _badges.Clear();

            if ( !string.IsNullOrWhiteSpace( ComponentGuids ) )
            {
                var guids = new List<Guid>();
                ComponentGuids.SplitDelimitedValues().ToList().ForEach( g => guids.Add( Guid.Parse( g ) ) );

                foreach ( var component in BadgeContainer.Instance.Components )
                {
                    BadgeComponent badge = component.Value.Value;
                    if ( guids.Contains( badge.TypeGuid ) )
                    {
                        var badgeControl = new PersonProfileBadge();
                        badgeControl.BadgeEntityTypeName = badge.EntityType.Name;
                        _badges.Add( badgeControl );
                    }
                }
            }

            base.CreateChildControls();
            Controls.Clear();

            _badges.ForEach( b => Controls.Add( b ) );
        }
Beispiel #2
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            _badges.Clear();

            if (!string.IsNullOrWhiteSpace(ComponentGuids))
            {
                var guids = new List <Guid>();
                ComponentGuids.SplitDelimitedValues().ToList().ForEach(g => guids.Add(Guid.Parse(g)));

                foreach (var component in BadgeContainer.Instance.Components)
                {
                    BadgeComponent badge = component.Value.Value;
                    if (guids.Contains(badge.TypeGuid))
                    {
                        var badgeControl = new PersonProfileBadge();
                        badgeControl.BadgeEntityTypeName = badge.EntityType.Name;
                        _badges.Add(badgeControl);
                    }
                }
            }

            base.CreateChildControls();
            Controls.Clear();

            _badges.ForEach(b => Controls.Add(b));
        }
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            _badges.Clear();
            if (PersonBadges != null)
            {
                var currentPerson = ((RockPage)Page).CurrentPerson;
                foreach (var personBadge in PersonBadges.OrderBy(b => b.Order))
                {
                    if (personBadge.IsAuthorized(Authorization.VIEW, currentPerson))
                    {
                        var badgeControl = new PersonProfileBadge();
                        badgeControl.PersonBadge = personBadge;
                        _badges.Add(badgeControl);
                        Controls.Add(badgeControl);
                    }
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            _badges.Clear();
            if ( PersonBadges != null )
            {
                var currentPerson =  ((RockPage)Page).CurrentPerson;
                foreach ( var personBadge in PersonBadges.OrderBy( b => b.Order ) )
                {
                    if ( personBadge.IsAuthorized( Authorization.VIEW, currentPerson ) )
                    {
                        var badgeControl = new PersonProfileBadge();
                        badgeControl.PersonBadge = personBadge;
                        _badges.Add( badgeControl );
                        Controls.Add( badgeControl );
                    }
                }
            }
        }