Hi,
I have a class called ExtendedUserPrincipal which inherits from UserPrincipal and exposes a few extra properties not exposed in the default UserPrincipal class. In my main form I define an object called SelectedUser (which can be used in various forms throughout the application) which is an instance of ExtendedUserPrincipal
Whenever I want to ensure that the SelectedUser object contains the last information from Active Directory I simply do this again
However, what I would prefer to have is a method called Refresh in the ExtendedUserPrincipal class which does the same thing so I can just do
. How do I implement such a method though? Obviously I know how to create the function itself but how does it return the updated object to the SelectedUser object
I have a class called ExtendedUserPrincipal which inherits from UserPrincipal and exposes a few extra properties not exposed in the default UserPrincipal class. In my main form I define an object called SelectedUser (which can be used in various forms throughout the application) which is an instance of ExtendedUserPrincipal
Code:
Dim Me.SelectedUser as ExtendedUserPrincipal = ExtendedUserPrincipal.FindByIdentity(CurrentPrincipalContext, IdentityType.SamAccountName, lvi.SubItems(1).Text)
Code:
Me.SelectedUser = ExtendedUserPrincipal.FindByIdentity(CurrentPrincipalContext, IdentityType.SamAccountName, lvi.SubItems(1).Text)
Code:
Me.SelectedUser.Refresh