コード例 #1
0
        public void Refresh(ILookup <string, string> definitionNames)
        {
            ThrowIfNotOnUIThread();

            try
            {
                IsUpdating = true;

                var colorItems = FontsAndColorsHelper.GetColorItems();

                foreach (var classificationItem in GridItems)
                {
                    if (definitionNames.Contains(classificationItem.DefinitionName))
                    {
                        foreach (var colorItem in colorItems)
                        {
                            if (colorItem.AllColorableItemInfo.bstrName == classificationItem.DefinitionName)
                            {
                                FontsAndColorsHelper.RefreshGridItemFromColorItem(classificationItem, colorItem);
                            }
                        }
                    }
                }
            }
            finally
            {
                IsUpdating = false;
            }
        }
コード例 #2
0
        public ClassificationProvider()
        {
            ThrowIfNotOnUIThread();
            var builder = ImmutableArray.CreateBuilder <GridItem>();
            var items   = FontsAndColorsHelper.GetColorItems();

            foreach (var item in items)
            {
                var ci = FontsAndColorsHelper.TryGetGridItemForColorItem(item);
                builder.Add(ci);
            }
            GridItems = builder.ToImmutable();
        }