public void PerformSearch() { var initialSearchCommand = new AimDataServiceSearchCommand(); initialSearchCommand.Coordinator = this; SearchResultsComponent.Table.Items.Clear(); _uiThreadSynchronizationContext = SynchronizationContext.Current; _totalCommandsToExecute = 1; _commandsExecuted = 0; _cancel = false; _resultsAdded = false; SearchResultsComponent.Title = "Searching..."; ApiKeyCredentials credentials = AimDataServiceLoginTool.Credentials; if (credentials == null) { AimDataServiceLoginTool.RequestLogin(); credentials = AimDataServiceLoginTool.Credentials; } if (credentials != null) { _threadPool.Start(); _threadPool.Enqueue(initialSearchCommand.Execute); } }
private List <AimeAnnotationContainer> Find() { var results = new List <AimeAnnotationContainer>(); AimeSearchCriteria searchCriteria = Coordinator.CriteriaComponent.SearchCriteria; ApiKeyCredentials credentials = AimDataServiceLoginTool.Credentials; if (!String.IsNullOrEmpty(credentials.ApiKey)) { results = AimeWebService.Find(credentials.ApiKey, searchCriteria); } return(results); }
public void Login(string username, string password) { try { Credentials = AimeWebService.Login(username, password); base.ExitCode = ApplicationComponentExitCode.Accepted; Host.Exit(); } catch (Exception ex) { Host.DesktopWindow.ShowMessageBox(ex.Message, "Login Error", MessageBoxActions.Ok); Platform.Log(LogLevel.Error, ex, "AIM Data Service 2 Login Error", null); } }