コード例 #1
0
        /// <summary>
        /// Handles the RowDataBound event of the gGroupMembers control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="GridViewRowEventArgs"/> instance containing the event data.</param>
        protected void gGroupMembers_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            const string photoFormat        = "<div class=\"photo-icon photo-round photo-round-xs pull-left margin-r-sm js-person-popover\" personid=\"{0}\" data-original=\"{1}&w=50\" style=\"background-image: url( '{2}' ); background-size: cover; background-repeat: no-repeat;\"></div>";
            GroupMember  groupMember        = e.Row.DataItem as GroupMember;
            Literal      lPersonNameHtml    = e.Row.FindControl("lPersonNameHtml") as Literal;
            Literal      lPersonProfileLink = e.Row.FindControl("lPersonProfileLink") as Literal;

            if (groupMember != null)
            {
                lPersonNameHtml.Text = string.Format(photoFormat, groupMember.PersonId, groupMember.Person.PhotoUrl, ResolveUrl("~/Assets/Images/person-no-photo-unknown.svg"))
                                       + groupMember.ToString();

                string personUrl = this.ResolveUrl(string.Format("~/Person/{0}", groupMember.PersonId));
                lPersonProfileLink.Text = string.Format(@"<a href='{0}'><div class='btn btn-default btn-sm'><i class='fa fa-user'></i></div></a>", personUrl);
            }
        }
コード例 #2
0
        public void TestToString()
        {
            GroupMember member = new GroupMember(validGuid, "Name", GroupMemberTypes.OnPremAd);

            Assert.Equal("Name", member.ToString());
        }