当前位置: 首页>>代码示例>>C#>>正文


C# Principal类代码示例

本文整理汇总了C#中Principal的典型用法代码示例。如果您正苦于以下问题:C# Principal类的具体用法?C# Principal怎么用?C# Principal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Principal类属于命名空间,在下文中一共展示了Principal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HasPermission

        public bool HasPermission(Principal principal, AclType aclType)
        {
            if (principal == null)
            {
                throw new ArgumentNullException("principal");
            }

            bool hasPermission = false;

            // if the principal and owner are the same, there is no need to
            // go to the DB

            if (principal.PrincipalId == this.Owner.PrincipalId)
            {
                hasPermission = true;
            }
            else
            {
                AclType permissions = AclsDbInteractor.Instance.GetAcls(this.ResourceId, GetActorId(), principal.PrincipalId);
                if (permissions != AclType.None)
                {
                    if ((permissions | aclType) == aclType)
                    {
                        hasPermission = true;
                    }
                }
            }

            return hasPermission;
        }
开发者ID:ratnazone,项目名称:ratna,代码行数:30,代码来源:Resource.cs

示例2: ControlBusquedaSocio

 public ControlBusquedaSocio(Principal principal, Operaciones operacion)
 {
     InitializeComponent();
     ConfiguracionComponentes();
     this.principal = principal;
     this.operacion = operacion;
 }
开发者ID:Fhernd,项目名称:CUPI2.NET-APO1-N4-ClubSocial,代码行数:7,代码来源:ControlBusquedaSocio.cs

示例3: ControlAfiliacion

        /// <summary>
        /// Crea un nuevo control de afiliación.
        /// </summary>
        /// <param name="principal">Referencia al formulario principal de la aplicación.</param>
        public ControlAfiliacion(Principal principal)
        {
            InitializeComponent();
            ConfiguracionComponentes();

            this.principal = principal;
        }
开发者ID:Fhernd,项目名称:CUPI2.NET-APO1-N4-ClubSocial,代码行数:11,代码来源:ControlAfiliacion.cs

示例4: ContrasenatextBox_KeyDown

        private void ContrasenatextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
               registro.NombreUsuario = NombretextBox.Text;
                registro.Contrasena = ContrasenatextBox.Text;

                if (registro.Login())
                {
                    if (NombretextBox.Text == registro.NombreUsuario && ContrasenatextBox.Text == registro.Contrasena)
                    {
                        Principal principal = new Principal();
                        principal.Show();
                        this.Visible = false;
                    }

                }
                else
                {

                    errorProvider.SetError(NombretextBox, "Usuario Incorrecto");
                    errorProvider.SetError(ContrasenatextBox, "Contrasena Incorrecta");

                }
            }
        }
开发者ID:elnata93,项目名称:CocoaExport,代码行数:26,代码来源:Login.cs

示例5: DatosPersonales

 public DatosPersonales(Principal p, Usuario us)
 {
     InitializeComponent();
     this.usuario = us;
     this.padre = p;
     //Pongo para que el cursor aparezca en el campo EMAIL
     emailTextBox.Select();
 }
开发者ID:jorgeeliecerballesteros,项目名称:controldeacceso,代码行数:8,代码来源:DatosPersonales.cs

示例6: AdUser

 public AdUser(Principal principal, IEnumerable<Principal> groups)
 {
     Name = principal.DisplayName;
     Login = principal.SamAccountName;
     Mail = principal.GetMail();
     Phone = principal.GetPhone();
     Company = principal.GetCompany();
     AdGroups = groups.Select(x => new AdGroup { Name = x.DisplayName, Code = x.SamAccountName }).ToArray();
 }
开发者ID:RenanMOliveira1,项目名称:AdAuthenticator,代码行数:9,代码来源:AdUser.cs

示例7: GetDirectoryEntry

        public static DirectoryEntry GetDirectoryEntry(Principal principal)
        {
            if (principal == null)
            {
                throw new ArgumentNullException("principal", "Value cannot be null!");
            }

            return principal.GetUnderlyingObject() as DirectoryEntry;
        }
开发者ID:Eugene-Ishkov,项目名称:RestService,代码行数:9,代码来源:LdapPrincipalManager.cs

示例8: ImmutableAuthentication

        /**
     * Constructor that accepts both a principal and a map.
     * 
     * @param principal Principal representing user
     * @param attributes Authentication attributes map.
     * @throws IllegalArgumentException if the principal is null.
     */
        public ImmutableAuthentication(Principal principal,
                                       Dictionary<string, Object> attributes)
            : base(principal, new Dictionary<string, object>())
        {
            //base(principal, attributes == null || attributes.isEmpty()
            //    ? EMPTY_MAP : Collections.unmodifiableMap(attributes));

            this.authenticatedDate = System.DateTime.Now;
        }
开发者ID:CSharpDev,项目名称:Dev.All,代码行数:16,代码来源:ImmutableAuthentication.cs

示例9: PrincipalSearcher

        public PrincipalSearcher(Principal queryFilter)
        {
            if (null == queryFilter)
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, StringResources.InvalidNullArgument, "queryFilter"));

            _ctx = queryFilter.Context;
            this.QueryFilter = queryFilter; // use property to enforce "no persisted principals" check

            SetDefaultPageSizeForContext();
        }
开发者ID:chcosta,项目名称:corefx,代码行数:10,代码来源:PrincipalSearcher.cs

示例10: AdMember

 /// <summary>
 /// Constructor that instantiates an AdMember object with the attribute values of
 /// the specified Principal.
 /// </summary>
 /// <param name="member"></param>
 public AdMember(Principal member)
 {
     this.Description = member.Description;
     this.DisplayName = member.DisplayName;
     this.DistinguishedName = member.DistinguishedName;
     this.Guid = member.Guid.ToString();
     this.Name = member.Name;
     this.SamAccountName = member.SamAccountName;
     this.Sid = member.Sid.Value;
     this.UserPrincipalName = member.UserPrincipalName;
 }
开发者ID:UAResLife,项目名称:AdApiService,代码行数:16,代码来源:AdMember.cs

示例11: Add_Command

    protected void Add_Command(object sender, CommandEventArgs e)
    {
        Control c = ((Control)sender).Parent;
        String FacultyId = ((DropDownList)c.FindControl("FacultyId")).SelectedValue;
        int Priority = int.Parse(((TextBox)c.FindControl("Priority")).Text);

        Principal p = new Principal();
        p.FacultyId = FacultyId;
        p.Priority = Priority;
        p.Save();
        GridView1.DataBind();
    }
开发者ID:sriharshakappala,项目名称:online-leave-planner,代码行数:12,代码来源:Principal.aspx.cs

示例12: timer1_Tick

 private void timer1_Tick(object sender, EventArgs e)
 {
     counter++;
     if (counter > 3) 
     {
         Principal P = new Principal();
         P.Show();
         P.FormClosed += P_FormClosed;
         this.Hide();
         timer1.Stop();
     }
 }
开发者ID:pernengo,项目名称:AutoForm,代码行数:12,代码来源:Splash.cs

示例13: GetByPriority

 public static Principal GetByPriority(int Priority)
 {
     DataTable dt = Database.ExecuteQuery("SELECT * FROM Principal WHERE Priority=" + Priority );
     if (dt != null && dt.Rows.Count == 1)
     {
         Principal p = new Principal();
         p.FacultyId = dt.Rows[0][0].ToString();
         p.Priority = int.Parse(dt.Rows[0][1].ToString());
         return p;
     }
     return null;
 }
开发者ID:sriharshakappala,项目名称:online-leave-planner,代码行数:12,代码来源:Principal.cs

示例14: CreateActiveDirectoryUser

 private static ActiveDirectoryUser CreateActiveDirectoryUser(Principal principal)
 {
     using (var userPrincipal = principal as UserPrincipal)
     {
         return new ActiveDirectoryUser
             {
                 UserAccount = userPrincipal.SamAccountName,
                 DisplayName = userPrincipal.DisplayName,
                 Sid = userPrincipal.Sid,
                 Email = userPrincipal.Description // TODO: If use AD, than map from EmailAddress field.
             };
     }
 }
开发者ID:ProcessingFinancialInformation,项目名称:TFIP,代码行数:13,代码来源:ActiveDirectoryHelper.cs

示例15: Main

 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (MenuInicial serve = new MenuInicial())
     {
         if (serve.ShowDialog() == DialogResult.OK)
         {
             sProgramIpDoServidor = MenuInicial.sIpdoServidor;
             using (Principal game = new Principal())
             {
                 game.Run();
             }
         }
     }
 }
开发者ID:EduardoPicettiTorezan,项目名称:Trabalho_RMI_Game,代码行数:17,代码来源:Program.cs


注:本文中的Principal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。