Ejemplo n.º 1
0
        private SearchParameters GetSearchParameters()
        {
            SearchParameters sp = new SearchParameters();

            sp.Name         = m_cmbProfiles.Text;
            sp.SearchString = m_tbSearch.Text;

            if (m_rbModeRegular.Checked)
            {
                sp.SearchMode = PwSearchMode.Regular;
            }
            else if (m_rbModeXPath.Checked)
            {
                sp.SearchMode = PwSearchMode.XPath;
            }
            else
            {
                Debug.Assert(m_rbModeSimple.Checked);
                sp.SearchMode = PwSearchMode.Simple;
            }

            sp.SearchInTitles      = m_cbTitle.Checked;
            sp.SearchInUserNames   = m_cbUserName.Checked;
            sp.SearchInPasswords   = m_cbPassword.Checked;
            sp.SearchInUrls        = m_cbUrl.Checked;
            sp.SearchInNotes       = m_cbNotes.Checked;
            sp.SearchInOther       = m_cbStringsOther.Checked;
            sp.SearchInStringNames = m_cbStringName.Checked;
            sp.SearchInTags        = m_cbTags.Checked;
            sp.SearchInUuids       = m_cbUuid.Checked;
            sp.SearchInGroupPaths  = m_cbGroupPath.Checked;
            sp.SearchInGroupNames  = m_cbGroupName.Checked;
            sp.SearchInHistory     = m_cbHistory.Checked;

            sp.ComparisonMode = (m_cbCaseSensitive.Checked ?
                                 StringComparison.InvariantCulture :
                                 StringComparison.InvariantCultureIgnoreCase);

            sp.ExcludeExpired = m_cbExcludeExpired.Checked;
            sp.RespectEntrySearchingDisabled = !m_cbIgnoreGroupSettings.Checked;

            SearchUtil.SetTransformation(sp, (m_cbDerefData.Checked ?
                                              SearchUtil.StrTrfDeref : string.Empty));

            return(sp);
        }
Ejemplo n.º 2
0
        private SearchParameters GetSearchParameters(bool bWithText)
        {
            SearchParameters sp = Program.Config.Defaults.SearchParameters;

            if (bWithText)
            {
                sp.SearchString = m_tbSearch.Text;
            }
            else
            {
                sp.SearchString = string.Empty;
            }

            sp.RegularExpression = m_cbRegEx.Checked;

            sp.SearchInTitles      = m_cbTitle.Checked;
            sp.SearchInUserNames   = m_cbUserName.Checked;
            sp.SearchInPasswords   = m_cbPassword.Checked;
            sp.SearchInUrls        = m_cbURL.Checked;
            sp.SearchInNotes       = m_cbNotes.Checked;
            sp.SearchInOther       = m_cbOtherFields.Checked;
            sp.SearchInStringNames = m_cbStringName.Checked;
            sp.SearchInTags        = m_cbTags.Checked;
            sp.SearchInUuids       = m_cbUuid.Checked;
            sp.SearchInGroupPaths  = m_cbGroupPath.Checked;
            sp.SearchInGroupNames  = m_cbGroupName.Checked;

            sp.ComparisonMode = (m_cbCaseSensitive.Checked ?
                                 StringComparison.InvariantCulture :
                                 StringComparison.InvariantCultureIgnoreCase);

            sp.ExcludeExpired = m_cbExcludeExpired.Checked;
            sp.RespectEntrySearchingDisabled = !m_cbIgnoreGroupSettings.Checked;

            SearchUtil.SetTransformation(sp, (m_cbDerefData.Checked ?
                                              SearchUtil.StrTrfDeref : string.Empty));

            return(sp);
        }