public LDAPUser(SearchResult result) : this() { LDAPHelper.CatchException(delegate { this.Email = result.Properties["extensionAttribute3"][0].ToString(); }); LDAPHelper.CatchException(delegate { this.Office = result.Properties["physicalDeliveryOfficeName"][0].ToString(); }); LDAPHelper.CatchException(delegate { Title = result.Properties["title"][0].ToString(); }); LDAPHelper.CatchException(delegate { EmployeeType = result.Properties["employeeType"][0].ToString(); }); LDAPHelper.CatchException(delegate { Department = result.Properties["department"][0].ToString(); }); LDAPHelper.CatchException(delegate { SamAccountName = result.Properties["samaccountname"][0].ToString(); }); LDAPHelper.CatchException(delegate { FirstName = result.Properties["givenname"][0].ToString(); }); LDAPHelper.CatchException(delegate { LastName = result.Properties["sn"][0].ToString(); }); UPN = result.Properties["UserPrincipalName"][0].ToString(); DisplayName = result.Properties["displayName"][0].ToString(); UserAccountControl = (result.Properties["useraccountcontrol"][0] is int) ? (int)result.Properties["useraccountcontrol"][0] : 0; }
private void WriteException(Exception ex) { LDAPHelper.WriteException(ex, this.GetType().Name); }