本文整理汇总了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;
}
示例2: ControlBusquedaSocio
public ControlBusquedaSocio(Principal principal, Operaciones operacion)
{
InitializeComponent();
ConfiguracionComponentes();
this.principal = principal;
this.operacion = operacion;
}
示例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;
}
示例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");
}
}
}
示例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();
}
示例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();
}
示例7: GetDirectoryEntry
public static DirectoryEntry GetDirectoryEntry(Principal principal)
{
if (principal == null)
{
throw new ArgumentNullException("principal", "Value cannot be null!");
}
return principal.GetUnderlyingObject() as DirectoryEntry;
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
}
示例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;
}
示例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.
};
}
}
示例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();
}
}
}
}