SIL.FieldWorks.Common.Framework.DetailControls.SemanticDomainSelectionUtility.UpdateDomainListLabels C# (CSharp) Méthode

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
		public static void UpdateDomainListLabels(IEnumerable<ObjectLabel> createObjectLabels, IVwStylesheet stylesheet, ListView domainList, bool displayUsage)
		{
			domainList.BeginUpdate();	// Mono is extremely bad about redundant redrawing.  See FWNX-973 and FWNX-1043.
			domainList.Items.Clear();
			if (createObjectLabels.Any())
				domainList.Font = GetFontForFormFromObjectLabels(createObjectLabels, stylesheet);

			foreach (var selectedItem in createObjectLabels)
			{
				domainList.Items.Add(CreateLabelListItem(selectedItem.Object, stylesheet, false, displayUsage));
			}
			domainList.EndUpdate();
		}

Usage Example

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;
        }
All Usage Examples Of SIL.FieldWorks.Common.Framework.DetailControls.SemanticDomainSelectionUtility::UpdateDomainListLabels