Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27406

VS 2010 [RESOLVED] Implementing a Refresh method on my own custom UserPrincipal class

$
0
0
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

Code:

Dim Me.SelectedUser as ExtendedUserPrincipal = ExtendedUserPrincipal.FindByIdentity(CurrentPrincipalContext, IdentityType.SamAccountName, lvi.SubItems(1).Text)
Whenever I want to ensure that the SelectedUser object contains the last information from Active Directory I simply do this again

Code:

Me.SelectedUser = ExtendedUserPrincipal.FindByIdentity(CurrentPrincipalContext, IdentityType.SamAccountName, lvi.SubItems(1).Text)
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
Code:

Me.SelectedUser.Refresh
. 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

Viewing all articles
Browse latest Browse all 27406

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>