Example #1
0
        public void WhenISeekLookupID(string LookupID)
        {
            try
            {
                string XPathStart      = "//div[(contains (@class,'x-window bbui-dialog-search bbui-dialog x-resizable-pinned') and contains(@style, 'visibility: visible'))]//div[contains(@id,'_ConstituentSearchbyNameorLookupID')]";
                string getXLookupField = "//*[contains(@class,'bbui-dialog-search') and not(contains(@style,'hidden'))]//*[starts-with(@id, 'ctrl_') and contains(@id, '_CONSTITUENTQUICKFIND_value')]";
                SearchDialog.SetTextField(getXLookupField, LookupID); // enter lookup ID for a search

                string xPathLookup = "//div[(contains (@class,'x-window bbui-dialog-search bbui-dialog x-resizable-pinned') and contains(@style, 'visibility: visible'))]//div[contains(@id,'_ConstituentSearchbyNameorLookupID')]//a[contains(@id,'_SHOWADVANCEDOPTIONS_action')and not(contains(@style, 'display: none;'))]";
                SearchDialog.WaitClick(xPathLookup, 15);

                // set advanced options so that we are looking for individuals who have an active status
                SearchDialog.SetCheckbox(XPathStart + "//input[contains(@id,'_INCLUDEORGANIZATIONS_value')]", false);
                SearchDialog.SetCheckbox(XPathStart + "//input[contains(@id,'_INCLUDEGROUPS_value')]", false);
                SearchDialog.SetCheckbox(XPathStart + "//input[contains(@id,'_INCLUDEINDIVIDUALS_value')]", true);
                SearchDialog.SetCheckbox(XPathStart + "//input[contains(@id,'_INCLUDEINACTIVE_value')]", true);

                SearchDialog.Search(); //search for a specific lookupid
                SearchDialog.SelectFirstResult();
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not find the constituent with the specified Lookup ID. " + ex.Message);
            }
        }
Example #2
0
        private void ButtonEquipmentAppearance_OnClick(object sender, RoutedEventArgs e)
        {
            var currentChara = _currentItem.Character;

            if (currentChara > 6)
            {
                currentChara = 0;
            }

            var searchList = new List <string>();

            for (var n = 0; n < EquipAppearance.EquipAppearances.Length; n++)
            {
                searchList.Add(
                    $"{EquipAppearance.EquipAppearances[n].ID.ToString("X2")} {EquipAppearance.EquipAppearances[n].Name}");
            }

            var currentAppearance = _currentItem.Appearance;

            var searchDialog   = new SearchDialog(searchList, currentAppearance.ToString("X4"), false);
            var searchComplete = searchDialog.ShowDialog();

            if (!searchComplete.Value)
            {
                return;
            }
            var searchIndex = searchDialog.ResultIndex;
            var searchItem  = EquipAppearance.EquipAppearances[searchIndex];

            var offset = Equipment.Offset + _selectedItem * Equipment.BlockLength + (int)Marshal.OffsetOf <EquipmentItem>("Appearance");

            GameMemory.Write(offset, (ushort)searchItem.ID, false);

            RefreshSelectedItem();
        }
Example #3
0
        private void SearchModel()
        {
            SearchDialog Dialog = new SearchDialog(TemplateTree);
            Form         Owner  = Cache.CustomCache[SystemString.主窗口] as Form;

            Dialog.Show(Owner);
        }
        private void ButtonPlayer_OnClick(object sender, RoutedEventArgs e)
        {
            var playerButton = (sender as Button);
            var playerIndex  = int.Parse(playerButton.Name.Substring(12)) - 1;
            var teamIndex    = TabTeam.SelectedIndex;

            var playerNames = BlitzballValues.Players.Select(player => player.Name);

            var playerSearchDialog = new SearchDialog(playerNames.ToList())
            {
                Owner = this.TryFindParent <Window>()
            };

            var search = playerSearchDialog.ShowDialog();

            if (!search.Value)
            {
                return;
            }

            int selectedPlayer = -1;
            var searchIndex    = playerSearchDialog.ResultIndex;

            if (searchIndex != -1)
            {
                selectedPlayer = BlitzballValues.Players[searchIndex].Index;
            }

            MovePlayer(selectedPlayer, teamIndex, playerIndex);

            Refresh();
        }
Example #5
0
        public void WhenISearchForOrganization(string organizationName)
        {
            try
            {
                SearchDialog.SetLastNameToSearch(organizationName); // search for the person's last name
                //For the advanced search options, allow for including organizations, groups and individuals
                SearchDialog.WaitClick("//a[contains(@id,'_SHOWADVANCEDOPTIONS_action')]", 20);
                SearchDialog.SetCheckbox("//input[contains(@id,'_INCLUDEORGANIZATIONS_value')]", true);
                SearchDialog.SetCheckbox("//input[contains(@id,'_INCLUDEGROUPS_value')]", true);
                SearchDialog.SetCheckbox("//input[contains(@id,'_INCLUDEINDIVIDUALS_value')]", true);
                SearchDialog.Search();

                try
                {
                    //verify that the results are what is needed
                    SearchDialog.CheckConstituentSearchResultsContain(organizationName);
                    SearchDialog.SelectFirstResult();
                }
                catch
                {
                    Dialog.Cancel();
                    AddOrganization(organizationName);
                    AddMatchingGiftConditions();
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not create a test organization. " + ex.Message);
            }
        }
Example #6
0
 private void findToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (SearchDialog dlg = new SearchDialog(tbEmailBody))
     {
         dlg.ShowDialog(this);
     }
 }
Example #7
0
        private async void Init()
        {
            #region WeatherClientInit
            string wClientPath = string.Format(@"{0}\wClientSettings", Environment.CurrentDirectory);
            if (!File.Exists(wClientPath))
            {
                settings          = new ClientSettings();
                settings.DayCount = 5;
                settings.Locale   = "en";
                settings.Units    = "e";

                using (SearchDialog diag = new SearchDialog())
                {
                    diag.CancelButtonEx.Visible = false;

                    if (diag.ShowDialog() == DialogResult.OK)
                    {
                        settings.Location = (WeatherLocation)diag.SelectedItem.Tag;
                    }
                }

                await settings.Save(wClientPath);
            }
            else
            {
                settings = await ClientSettings.Load(wClientPath);
            }

            client = new WeatherClient(settings);
            client.WeatherDataReceived += Client_WeatherDataReceived;
            #endregion
        }
        private void Search_Click(object sender, RoutedEventArgs e)
        {
            BigBox.Text = "";
            SearchDialog d = new SearchDialog(CraftingDatabase.StatTemplates, RepeatResults.Filter)
            {
                Owner = this
            };
            bool?res = d.ShowDialog();

            if (!res.HasValue || !res.Value)
            {
                return;
            }
            FilterCondition filter = d.GetFilterCondition();

            if (filter == null)
            {
                SearchButton.ClearValue(Button.BackgroundProperty);
            }
            else
            {
                SearchButton.Background = Brushes.Green;
            }
            RepeatResults.Filter = filter;
        }
        public void WhenISearchFor(string name)
        {
            try
            {
                if (name != "Baltimore")
                {
                    name += uniqueStamp;
                }
                SearchDialog.SetLastNameToSearch(name); // search for the person's last name
                //For the advanced search options, allow for including organizations, groups and individuals
                SearchDialog.WaitClick("//a[contains(@id,'_SHOWADVANCEDOPTIONS_action')]", 20);
                SearchDialog.SetCheckbox("//input[contains(@id,'_INCLUDEORGANIZATIONS_value')]", true);
                SearchDialog.SetCheckbox("//input[contains(@id,'_INCLUDEGROUPS_value')]", false);
                SearchDialog.SetCheckbox("//input[contains(@id,'_INCLUDEINDIVIDUALS_value')]", true);
                //search for a specific last name
                SearchDialog.Search();

                if (name != "Baltimore")
                {
                    SearchDialog.SelectFirstResult();
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not search for specified name. " + ex.Message);
            }
        }
Example #10
0
        public void GivenADeletePhoneRequest(Table phonedeleteTable)
        {
            try
            {
                string requestreason = "Reason for delete phone and email request.";
                //click on the link to edit a change request;
                Dialog.WaitClick("//button[contains(@class,'linkbutton')]/div[text()='Add a Constituent Change Request']", 10);

                //fill in the textarea - request reason
                Dialog.SetTextField(Dialog.getXTextArea("UNCConstituentChangeRequestConsolidatedAddDataForm", "REQUESTREASON"), requestreason); // enter the reason for the request.

                SearchDialog.WaitClick("//a[contains(@id,'_SHOWPHONES_action')]", 20);

                //save the new phone info in the grid.
                var columnCaptionToIndex = Dialog.MapColumnCaptionsToIndex(phonedeleteTable.Rows[0].Keys,
                                                                           Dialog.getXGridHeaders("UNCConstituentChangeRequestConsolidatedAddDataForm", "EDITPHONEINFO_value"));

                var cellxPath = Dialog.getXGridCell("UNCConstituentChangeRequestConsolidatedAddDataForm", "EDITPHONEINFO_value", 1, columnCaptionToIndex["Delete?"]);

                Dialog.SetCheckbox(cellxPath, true);  //set the delete checkbox to true
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not update a delete phone request. " + ex.Message);
            }
        }
Example #11
0
        public override async Task Execute(params object[] args)
        {
            copying = false;

            var dialog = new SearchDialog();

            dialog.RunModeless((sender, e) =>
            {
                var d = sender as SearchDialog;
                if (d.DialogResult == DialogResult.OK)
                {
                    copying = dialog.CopySelections;
                    pageIds = dialog.SelectedPages;

                    var desc = copying
                                                ? Resx.SearchQF_DescriptionCopy
                                                : Resx.SearchQF_DescriptionMove;

                    using (var one = new OneNote())
                    {
                        one.SelectLocation(Resx.SearchQF_Title, desc, OneNote.Scope.Sections, Callback);
                    }
                }
            },
                               20);

            await Task.Yield();
        }
        private void AbilityButton_Click(object sender, RoutedEventArgs e)
        {
            var button = sender as Button;
            var index  = int.Parse(button.Name.Substring(7));

            // Generate search list
            var searchList = new List <string>();

            foreach (var ability in AutoAbility.AutoAbilities)
            {
                searchList.Add($"{ability.ID.ToString("X4")} {ability.Name}");
            }

            var searchDialog   = new SearchDialog(searchList);
            var searchComplete = searchDialog.ShowDialog();

            if (!searchComplete.HasValue || !searchComplete.Value)
            {
                return;
            }

            if (searchDialog.ResultIndex == -1)
            {
                // Write empty slot
                WriteAbility(_selectedItem, index, 0xFF);
            }
            else
            {
                var ability = AutoAbility.AutoAbilities[searchDialog.ResultIndex];
                WriteAbility(_selectedItem, index, ability.ID);
            }

            RefreshSelectedItem();
        }
Example #13
0
        public void GivenEditPhoneChangeRequest(Table editPhoneTable)
        {
            {
                try
                {
                    string requestreason = "Reason for edit phone and email requests.";
                    //click on the link to edit a change request;
                    Dialog.WaitClick("//button[contains(@class,'linkbutton')]/div[text()='Add a Constituent Change Request']", 10);
                    //fill in the textarea - request reason
                    Dialog.SetTextField(Dialog.getXTextArea("UNCConstituentChangeRequestConsolidatedAddDataForm", "REQUESTREASON"), requestreason); // enter the reason for the request.


                    SearchDialog.WaitClick("//a[contains(@id,'_SHOWPHONES_action')]", 20);

                    //save the edit phone info in the grid.
                    var columnCaptionToIndex = Dialog.MapColumnCaptionsToIndex(editPhoneTable.Rows[0].Keys,
                                                                               Dialog.getXGridHeaders("UNCConstituentChangeRequestConsolidatedAddDataForm", "EDITPHONEINFO_value"));

                    Dialog.SetGridRows("UNCConstituentChangeRequestConsolidatedAddDataForm", "EDITPHONEINFO_value", editPhoneTable, 1, columnCaptionToIndex, SupportedFields);
                }
                catch (Exception ex)
                {
                    throw new Exception("Error: could not save an edit phone change request. " + ex.Message);
                }
            }
        }
        private void ButtonEquipmentAppearance_OnClick(object sender, RoutedEventArgs e)
        {
            var currentChara = (int)_equipmentBytes[_selectedItem * EquipmentLength + (int)EquipmentOffset.Character];

            if (currentChara > 6)
            {
                currentChara = 0;
            }

            var searchList = new List <string>();

            for (int n = 0; n < EquipAppearance.EquipAppearances.Length; n++)
            {
                searchList.Add($"{EquipAppearance.EquipAppearances[n].ID.ToString("X2")} {EquipAppearance.EquipAppearances[n].Name}");
            }

            var currentAppearance = BitConverter.ToUInt16(_equipmentBytes, _selectedItem * EquipmentLength + (int)EquipmentOffset.Appearance);

            var searchDialog   = new SearchDialog(searchList, currentAppearance.ToString("X4"), false);
            var searchComplete = searchDialog.ShowDialog();

            if (!searchComplete.Value)
            {
                return;
            }
            var searchIndex = searchDialog.ResultIndex;
            var searchItem  = EquipAppearance.EquipAppearances[searchIndex];

            MemoryReader.WriteBytes(Offsets.GetOffset(OffsetType.EquipmentBase) + _selectedItem * EquipmentLength + (int)EquipmentOffset.Appearance, BitConverter.GetBytes((ushort)searchItem.ID));
            Refresh();
        }
        private void EquippedTech_OnClick(object sender, RoutedEventArgs e)
        {
            var techIndex    = int.Parse((sender as Button).Name.Substring(12)) - 1;
            var techNames    = BlitzballValues.Techs.Select(t => t.Name);
            var searchDialog = new SearchDialog(techNames.ToList(), (sender as Button).Content.ToString())
            {
                Owner = this.TryFindParent <Window>()
            };
            var success = searchDialog.ShowDialog();

            if (!success.Value)
            {
                return;
            }

            var player = _players[_playerIndex];

            if (searchDialog.ResultIndex == -1)
            {
                player.Techs[techIndex] = 0;
            }
            else
            {
                // equip tech
                var tech = BlitzballValues.Techs[searchDialog.ResultIndex];
                player.Techs[techIndex] = (byte)tech.Index;
            }

            Data.Blitzball.SetPlayerInfo(_playerIndex, player);
            RefreshCurrentPlayer();
        }
Example #16
0
        private void TrapButton_Click(object sender, RoutedEventArgs e)
        {
            var button = sender as Button;

            if (button == null)
            {
                return;
            }

            var trapId = int.Parse(button.Name.Substring(4));



            var creatureSearchList = new List <string>();

            foreach (var creature in Values.Creatures.CreatureList)
            {
                creatureSearchList.Add($"{creature.ID.ToString("X4")} {creature.Name}");
            }

            var creatureSearch = new SearchDialog(creatureSearchList);

            creatureSearch.ShowDialog();

            if (creatureSearch.DialogResult == false)
            {
                return;
            }

            var selectedCreature = Creatures.CreatureList[creatureSearch.ResultIndex];

            SetTrap(trapId, selectedCreature.ID);
        }
Example #17
0
        public void WhenISearchForTheTransaction(Table table)
        {
            #region data setup
            //setup date field.  StepHelper for date must come before dynamic objects
            StepHelper.SetTodayDateInTableRow("Date", table);
            dynamic objectData      = table.CreateDynamicInstance();
            var     dialogId        = "TransactionSearch";
            string  groupCaption    = "Transactions";
            string  taskCaption     = "Transaction search";
            string  transactionType = objectData.TransactionType;
            objectData.LastName += uniqueStamp;
            //sorts out date format due to datetime adding 00:00:00
            DateTime findDate = objectData.Date;
            //set fields for Transaction search fields on form
            IDictionary <string, CrmField> SupportedFields = new Dictionary <string, CrmField>
            {
                { "Last/Org/Group name", new CrmField("_KEYNAME_value", FieldType.TextInput) },
                { "Transaction type", new CrmField("_TRANSACTIONTYPE_value", FieldType.Dropdown) }
            };
            #endregion
            //search for pledge transaction
            BBCRMHomePage.OpenRevenueFA();
            RevenueFunctionalArea.OpenLink(groupCaption, taskCaption);
            BaseComponent.GetEnabledElement("//div[contains(@id,'searchdialog') and contains(@style,'visible')]//span[text()='Transaction Search']", 30);
            //Set search fields
            Dialog.SetField(dialogId, "Last/Org/Group name", objectData.LastName, SupportedFields);
            Dialog.SetField(dialogId, "Transaction type", transactionType, SupportedFields);
            //Click Search and select first result
            SearchDialog.Search();
            SearchDialog.SelectFirstResult();
            switch (transactionType.ToLower())
            {
            case "payment":
                string paymentName = string.Format("{0} Payment: {1}", findDate.ToShortDateString(), objectData.Amount);
                BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[./text()='{0}']", paymentName), 15);
                break;

            case "pledge":
                string pledgeName = string.Format("{0} Pledge: {1}", findDate.ToShortDateString(), objectData.Amount);
                BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[./text()='{0}']", pledgeName), 15);
                break;

            case "recurring gift":
                string RecurringGiftName = string.Empty;
                if (objectData.SpecificType == "Sponsorship")
                {
                    RecurringGiftName = string.Format("{0} Sponsorship recurring gift: {1}", findDate.ToShortDateString(), objectData.Amount);
                }
                else
                {
                    RecurringGiftName = string.Format("{0} Recurring gift: {1}", findDate.ToShortDateString(), objectData.Amount);
                }
                BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[./text()='{0}']", RecurringGiftName), 15);
                break;

            default:
                FailTest(string.Format("Test failed checking transaction {0}.", transactionType));
                break;
            }
        }
Example #18
0
        private void SearchSheet()
        {
            SearchDialog Dialog = new SearchDialog(FpSheetView);
            Form         Owner  = Cache.CustomCache[SystemString.主窗口] as Form;

            Dialog.Show(Owner);
        }
Example #19
0
        public override void Execute(params object[] args)
        {
            // search for keywords and find page

            copying = false;

            using (var dialog = new SearchDialog())
            {
                if (dialog.ShowDialog(owner) != DialogResult.OK)
                {
                    return;
                }

                copying = dialog.CopySelections;
                pageIds = dialog.SelectedPages;
            }

            // choose where to copy/move the selected pages
            // This needs to be done here, on this thread; I've tried to play threading tricks
            // to do this from the SearchDialog but could find a way to prevent hanging

            var desc = copying
                                ? Resx.SearchQF_DescriptionCopy
                                : Resx.SearchQF_DescriptionMove;

            using (var one = new OneNote())
            {
                one.SelectLocation(Resx.SearchQF_Title, desc, OneNote.Scope.Sections, Callback);
            }
        }
Example #20
0
        public void ThenAppealMailingsTabAppealMailingListShows(string Appeal, Table table)
        {
            //Verify Appeal Mailing data displays correctly on Appeal
            //select M&C
            BBCRMHomePage.OpenMarketingAndCommunicationsFA();
            //Open Appeal Search
            MarketingAndCommFunctionalArea.OpenLink("Appeal", "Appeal search");
            //search for Appeal in Name field
            Dialog.SetTextField("//input[contains(@id,'_NAME_value')]", Appeal + uniqueStamp);
            //click Search button
            Dialog.ClickButton("Search");
            //Select correct result in grid
            SearchDialog.SelectFirstResult();
            //select Mailings tab
            Panel.SelectTab("Mailings");
            //set data to match data list
            TableRow tableRow = table.Rows[0];

            tableRow["Name"]      += uniqueStamp;
            tableRow["Package"]   += uniqueStamp;
            tableRow["Selection"] += uniqueStamp + " (Ad-hoc Query)";
            StepHelper.SetTodayDateInTableRow("Mail date", tableRow);
            if ((Panel.SectionDatalistRowExists(table.Rows[0], "Appeal mailings") == false))
            {
                throw new Exception("ThenAppealMailingsTabAppealMailingListShows grid not correct!");
            }
        }
Example #21
0
        public void GivenEditAddressChangeRequest(Table editaddressTable)
        {
            //text to go in the various text areas
            string requestreason = "This is the requested for an edit address change request.";

            try
            {
                //click on the link to edit a change request
                Dialog.WaitClick("//button[contains(@class,'linkbutton')]/div[text()='Add a Constituent Change Request']", 10);

                //fill in the textarea - request reason
                Dialog.SetTextField(Dialog.getXTextArea("UNCConstituentChangeRequestConsolidatedAddDataForm", "REQUESTREASON"), requestreason); // enter the reason for the request.
                SearchDialog.WaitClick("//a[contains(@id,'_SHOWADDRESSES_action')]", 20);

                //save the new address information in the grid
                var columnCaptionToIndex = Dialog.MapColumnCaptionsToIndex(editaddressTable.Rows[0].Keys,
                                                                           Dialog.getXGridHeaders("UNCConstituentChangeRequestConsolidatedAddDataForm", "EDITADDRESSINFO_value"));

                Dialog.SetGridRows("UNCConstituentChangeRequestConsolidatedAddDataForm", "EDITADDRESSINFO_value", editaddressTable, 1, columnCaptionToIndex, SupportedFields);
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not edit an address change request. " + ex.Message);
            }
        }
Example #22
0
        public void ShowSearchReplaceDialog()
        {
            var dlg = new SearchDialog {
                App = App, ReplaceMode = true
            };

            dlg.Show((IWin32Window)App.GetService <IEnvironmentService>().GetMainWindow());
        }
Example #23
0
        public void WhenISearchFor(Table table)
        {
            var search = table.CreateInstance <ConstituentSearchCriteria>();

            SearchDialog.SetFirstNameToSearch(search.FirstName);
            SearchDialog.SetLastNameToSearch(search.LastName);
            SearchDialog.Search();
        }
Example #24
0
 /// <summary>Does some cleanup to make sure the dialog is like a brand new one.</summary>
 /// <remarks>The old dialog is closed and nullified</remarks>
 public void Clear()
 {
     if (dialog != null)
     {
         dialog.Destroy();
         dialog = null;
     }
 }
Example #25
0
        public SearchDialogController(SearchDialog view)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }

            View = view;
        }
Example #26
0
        public override void Execute(object parameter)
        {
            var dialog = new SearchDialog();

            if (dialog.ShowModalDialog())
            {
                MainViewModel.ActiveDirectoryContainer.ActiveView.LoadDirectory(dialog.FoundObject);
            }
        }
Example #27
0
 private void SearchButtonOnClick(object sender, EventArgs eventArgs)
 {
     SearchDialog.Create(this, (type, term) =>
     {
         _searchType = type;
         _searchTerm = term;
         Presenter.SearchAniList(type, term);
     }, _searchType, _searchTerm);
 }
        public ISearchDialog getSearchDialog(SearchDialog searchDialog)
        {
            ISearchDialog iSearchDialog;

            if (!listSearchDialogs.TryGetValue(searchDialog, out iSearchDialog))
            {
                iSearchDialog = null;
            }
            return(iSearchDialog);
        }
Example #29
0
        private void searchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (bringToFrontIfExists <SearchDialog>())
            {
                return;
            }
            SearchDialog searchDialog = new SearchDialog();

            searchDialog.Show(this);
        }
        public override void Execute(object parameter)
        {
            var repository       = RepositoryManager.GetRepository(RepositoryManager.Folders);
            var folderRepository = repository.Entries.FirstOrDefault();

            if (folderRepository == null)
            {
                return;
            }

            var databaseUri = DatabaseUri.Empty;
            var searchText  = string.Empty;
            var name        = "Folder";

            do
            {
                var dialog = new SearchDialog(searchText, databaseUri, name);
                if (AppHost.Shell.ShowDialog(dialog) != true)
                {
                    return;
                }

                name        = dialog.SearchName;
                databaseUri = dialog.DatabaseUri ?? DatabaseUri.Empty;
                searchText  = dialog.SearchText;

                if (LibraryManager.Libraries.Any(w => string.Compare(w.Name, name, StringComparison.InvariantCultureIgnoreCase) == 0))
                {
                    AppHost.MessageBox(string.Format("A folder with the name '{0}' already exists.\n\nPlease choose another name.", name), "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    break;
                }
            }while (true);

            var fileName = IO.File.GetSafeFileName(name + ".xml");

            fileName = Path.Combine(folderRepository.Path, fileName);

            var folder = new SearchLibrary(fileName, name)
            {
                DatabaseUri = databaseUri,
                SearchText  = searchText
            };

            folder.Save();
            folder.Initialize();

            LibraryManager.Add(folder);

            folder.IsExpanded = true;
            folder.Refresh();
        }
Example #31
0
        private void OpenSearch()
        {
            if (RootSection == null) //don't allow searches before a save is loaded
                return;

            if (activeSearch != null)
                activeSearch.Focus();
            else
            {
                this.activeSearch = new SearchDialog();
                activeSearch.FormClosed += (s, e) => activeSearch = null;
                activeSearch.Editor = this; //lets SearchDialog call FindNext()
                activeSearch.Owner = this.ParentForm; //prevents SearchDialog from getting behind the main form
                activeSearch.Location = this.PointToScreen(Point.Empty); //align the dialog with the top left corner of this control
                activeSearch.Left += this.Width - activeSearch.Width; //move it to the top right
                activeSearch.Show();
            }
        }
Example #32
0
 public ISearchDialog getSearchDialog(SearchDialog searchDialog)
 {
     ISearchDialog iSearchDialog;
     if (!listSearchDialogs.TryGetValue(searchDialog, out iSearchDialog))
     {
         iSearchDialog = null;
     }
     return iSearchDialog;
 }