private void StartResolve() { if (string.IsNullOrEmpty(UserTextBox.Text)) { MessageBox.Show("You must enter a search term.", "Missing Search Term", MessageBoxButton.OK); UserTextBox.Focus(); return; } try { this.Cursor = Cursors.Wait; PeopleSoapClient ps = new PeopleSoapClient(); ps.Endpoint.Address = new System.ServiceModel.EndpointAddress(Utils.GetSiteUrl() + "/_vti_bin/People.asmx"); ps.SearchPrincipalsCompleted += new EventHandler <SearchPrincipalsCompletedEventArgs>(ps_SearchPrincipalsCompleted); ps.SearchPrincipalsAsync(UserTextBox.Text, 50, SPPrincipalType.User); } catch (Exception ex) { MessageBox.Show("There was a problem executing the search; please try again " + "later.", "Search Error", MessageBoxButton.OK); this.Cursor = Cursors.Arrow; } }
private void UserTextBox_LostFocus(object sender, RoutedEventArgs e) { if (UserTextBox.Text.Length > 0) { try { PeopleSoapClient ps = new PeopleSoapClient(); //use the host name property to configure the request against the site in //which the control is hosted ps.Endpoint.Address = new System.ServiceModel.EndpointAddress(Utils.GetSiteUrl() + "/_vti_bin/People.asmx"); //create the handler for when the call completes ps.SearchPrincipalsCompleted += new EventHandler <SearchPrincipalsCompletedEventArgs>(ps_SearchPrincipalsCompleted); //execute the search ps.SearchPrincipalsAsync(UserTextBox.Text, 50, SPPrincipalType.User); } catch (Exception ex) { //ERROR LOGGING HERE Debug.WriteLine(ex.Message); MessageBox.Show("There was a problem executing the search; please try again " + "later.", "Search Error", MessageBoxButton.OK); //reset cursor this.Cursor = Cursors.Arrow; } } }
public DataHandlerUser(IExcelParams excelParams, MainPage page) { PeopleAsmx = Constants.InitParams.PeopleAsmx(page); _peopleService = new PeopleSoapClient("PeopleSoap", PeopleAsmx); _peopleService.ResolvePrincipalsCompleted += PeopleService_ResolvePrincipalsCompleted; _peopleService.SearchPrincipalsCompleted += PeopleService_SearchPrincipalsCompleted; _updateTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, Constants.UserTimerOffset) }; _updateTimer.Tick += updateTimer_Tick; _updateTimer.Start(); _resolvedUsers = new Dictionary<string, UserInfo>(); _resolveUsersQueue = new Dictionary<UserInfo, List<ResolveComplete>>(); _failedResolveUsers = new Dictionary<UserInfo, List<ResolveComplete>>(); }
private void SearchBtn_Click(object sender, RoutedEventArgs e) { //make sure a search value was entered if (string.IsNullOrEmpty(SearchTxt.Text)) { MessageBox.Show("You must enter a search term.", "Missing Search Term", MessageBoxButton.OK); SearchTxt.Focus(); return; } try { //change the cursor to hourglass this.Cursor = Cursors.Wait; PeopleSoapClient ps = new PeopleSoapClient(); //use the host name property to configure the request against the site in //which the control is hosted ps.Endpoint.Address = new System.ServiceModel.EndpointAddress(Utils.GetSiteUrl() + "/_vti_bin/People.asmx"); //create the handler for when the call completes ps.SearchPrincipalsCompleted += new EventHandler <SearchPrincipalsCompletedEventArgs>(ps_SearchPrincipalsCompleted); //execute the search ps.SearchPrincipalsAsync(SearchTxt.Text, 50, SPPrincipalType.User); } catch (Exception ex) { //ERROR LOGGING HERE Debug.WriteLine(ex.Message); MessageBox.Show("There was a problem executing the search; please try again " + "later.", "Search Error", MessageBoxButton.OK); //reset cursor this.Cursor = Cursors.Arrow; } }
public PermissionsServiceAgent(string PeopleAsmx, String PermissionsAsmx) { sitename = PeopleAsmx; peopleclient = new PeopleSoapClient("PeopleSoap", PeopleAsmx); custompermclient = new CustomPermissionsSoapClient("CustomPermissionsSoap", PermissionsAsmx); }
public PermissionsServiceAgent(string PeopleAsmx) { sitename = PeopleAsmx; peopleclient = new PeopleSoapClient("PeopleSoap", PeopleAsmx); }