UpdateDomainListLabels() public static méthode

Clear the ListView and add createObjectLabels to it. 'displayUsage' determines if the items are checked/unchecked.
public static UpdateDomainListLabels ( IEnumerable createObjectLabels, IVwStylesheet stylesheet, ListView domainList, bool displayUsage ) : void
createObjectLabels IEnumerable
stylesheet IVwStylesheet
domainList System.Windows.Forms.ListView
displayUsage bool
Résultat void
Exemple #1
0
        private void SearchSemanticDomains()
        {
            IEnumerable <ObjectLabel> labels = new List <ObjectLabel>();

            // The FindDomainsThatMatch method returns IEnumerable<ICmSemanticDomain>
            // based on the search string we give it.
            var searchString = TrimmedSearchBoxText;

            if (!string.IsNullOrEmpty(searchString))
            {
                btnCancelSearch.SearchIsActive = true;
                domainList.ItemChecked        -= OnDomainListChecked;
                var semDomainsToShow = m_semdomRepo.FindDomainsThatMatch(searchString);
                SemanticDomainSelectionUtility.UpdateDomainListLabels(
                    ObjectLabel.CreateObjectLabels(Cache, semDomainsToShow, string.Empty, DisplayWs),
                    m_stylesheet, domainList, displayUsageCheckBox.Checked);
                domainTree.Visible      = false;
                domainList.Visible      = true;
                domainList.ItemChecked += OnDomainListChecked;
            }
            else
            {
                domainTree.Visible             = true;
                domainList.Visible             = false;
                btnCancelSearch.SearchIsActive = false;
            }
            SearchInProgress = false;
        }
Exemple #2
0
        private void SearchSemanticDomains()
        {
            IEnumerable <ObjectLabel> labels = new List <ObjectLabel>();

            // The FindDomainsThatMatch method returns IEnumerable<ICmSemanticDomain>
            // based on the search string we give it.
            var searchString = TrimmedSearchBoxText;

            if (!string.IsNullOrEmpty(searchString))
            {
                if (m_searchIconSet)
                {
                    // When disabled, we use a Background image rather than a regular image so that it
                    // does not gray out. When showing the search icon, the button is never enabled,
                    // so it is a shame to have it grey-out our pretty magnifying glass. The X however
                    // can work as a normal button image (which avoids needing to make it larger
                    // than the button etc. in order to avoid repeating it as wallpaper, which is how
                    // BackgroundImage works.)
                    btnCancelSearch.Image           = FieldWorks.Resources.Images.X;
                    btnCancelSearch.BackgroundImage = null;
                    m_searchIconSet         = false;
                    btnCancelSearch.Enabled = true;
                }
                domainList.ItemChecked -= OnDomainListChecked;
                var semDomainsToShow = m_semdomRepo.FindDomainsThatMatch(searchString);
                SemanticDomainSelectionUtility.UpdateDomainListLabels(ObjectLabel.CreateObjectLabels(Cache, semDomainsToShow, string.Empty, DisplayWs), domainList, displayUsageCheckBox.Checked);
                domainTree.Visible      = false;
                domainList.Visible      = true;
                domainList.ItemChecked += OnDomainListChecked;
            }
            else
            {
                domainTree.Visible = true;
                domainList.Visible = false;
                if (!m_searchIconSet)
                {
                    btnCancelSearch.BackgroundImage = FieldWorks.Resources.Images.Search;
                    btnCancelSearch.Image           = null;
                    m_searchIconSet         = true;
                    btnCancelSearch.Enabled = false;
                }
            }
        }