You are viewing limited content. For full access, please sign in.

Question

Question

How to open a search window without searching?

asked on December 31, 2014
            using (ClientManager cm = new ClientManager())
            {
                bool loginFlag = false;

                MainWindow mainWindow = null;
                List<ClientWindow> clientWindows = (List<ClientWindow>)cm.GetAllClientWindows(ClientWindowType.Main);
                if (clientWindows.Count > 0)
                {
                    var clientWindowsEnum = clientWindows.GetEnumerator();
                    clientWindowsEnum.MoveNext();
                    mainWindow = (MainWindow)clientWindowsEnum.Current; // current client window

                    if (mainWindow.GetCurrentRepository() == null)
                    {
                        mainWindow.Close();
                        cm.Refresh();
                    }
                }

                LaunchOptions options = new LaunchOptions();
                options.RepositoryName = "Performance";
                options.ServerName = serverName;

                if (cm.IsClientOpen())
                {
                    IEnumerable<RepositoryConnection> lfRepoConnections = cm.GetAllRepositoryConnections();
                    var lfRepoConnectionsEnum = lfRepoConnections.GetEnumerator();
                    lfRepoConnectionsEnum.MoveNext();
                    RepositoryConnection currentRepo = lfRepoConnectionsEnum.Current;

                    IList<ClientInstance> lfClientInstances = cm.GetAllClientInstances();
                    var a = lfClientInstances[0].IsLoggedIn();

                    if (!lfClientInstances[0].IsLoggedIn())
                    {
                        loginFlag = true;
                    }

                    else if (currentRepo != null)
                    {
                        if (String.IsNullOrEmpty(currentRepo.RepositoryName))
                        {
                            loginFlag = true;
                        }
                        else if (!String.IsNullOrEmpty(userName) && currentRepo.UserName != userName)
                        {
                            currentRepo.LogOut();
                            loginFlag = true;
                        }
                        else if (currentRepo.RepositoryName != databaseName)
                        {
                            currentRepo.LogOut();
                            loginFlag = true;
                        }
                    }
                }
                else loginFlag = true;

                if (loginFlag)
                {
                    try
                    {
                        cm.LogIn(options, out mainWindow);
                    }
                    catch (LaserficheRepositoryException ex)
                    {
                        MessageBox.Show(this, ErrorMessages.CATError.Replace("\\n", "\n"), "Laserfiche Bridge - Search", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }

                SearchOptions searchOptions = new SearchOptions();
                searchOptions.NewWindow = false;
                searchOptions.EagerlyRetrieveResults = false;
                searchOptions.Query = " ";
                mainWindow.LaunchSearch(searchOptions);
            }

I use the above code to manage opening a new search window based on what windows are open. How do I launch the search window with no Query property to launch the search window without an error message? I want to launch the search window without searching.

0 0

Answer

SELECTED ANSWER
replied on December 31, 2014

This isn't currently supported, the only way to show the search pane is by launching a search. We will look into adding this to a future version.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.