Esempio n. 1
0
        public override void WriteXml(System.Xml.XmlWriter writer)
        {
            if (IsDisabled)
            {
                writer.WriteAttributeString("IsDisabled", IsDisabled.ToString());
            }
            if (!CanHide)
            {
                writer.WriteAttributeString("CanHide", CanHide.ToString());
            }
            if (!CanAutoHide)
            {
                writer.WriteAttributeString("CanAutoHide", CanAutoHide.ToString(CultureInfo.InvariantCulture));
            }
            if (AutoHideWidth > 0)
            {
                writer.WriteAttributeString("AutoHideWidth", AutoHideWidth.ToString(CultureInfo.InvariantCulture));
            }
            if (AutoHideHeight > 0)
            {
                writer.WriteAttributeString("AutoHideHeight", AutoHideHeight.ToString(CultureInfo.InvariantCulture));
            }
            if (AutoHideMinWidth != 25.0)
            {
                writer.WriteAttributeString("AutoHideMinWidth", AutoHideMinWidth.ToString(CultureInfo.InvariantCulture));
            }
            if (AutoHideMinHeight != 25.0)
            {
                writer.WriteAttributeString("AutoHideMinHeight", AutoHideMinHeight.ToString(CultureInfo.InvariantCulture));
            }


            base.WriteXml(writer);
        }
Esempio n. 2
0
        public async Task <ClaimsIdentity> GenerateUserIdentityAsync(UserManager <ApplicationUser> manager)
        {
            // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
            var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);

            // Add custom user claims here
            userIdentity.AddClaim(new Claim("EmployeeId", EmployeeId.ToString()));
            userIdentity.AddClaim(new Claim("IsDisabled", IsDisabled.ToString()));
            userIdentity.AddClaim(new Claim("Email", Email.ToString()));
            return(userIdentity);
        }