private CssSchemaCompletionEntry CreateCompletionEntry(CssCompletionContext context, CssSchemaCompletionEntry entry)
        {
            CustomCompletionListEntry interim = new CustomCompletionListEntry(entry.DisplayText, GetArguments(entry.DisplayText));
            interim.Description = entry.Description;

            object[] parameters = new object[]
            {
                interim,
                entry.CompletionProvider,
                CssTextSource.Document,
                context.Snapshot.CreateTrackingSpan(context.SpanStart, context.SpanLength, SpanTrackingMode.EdgeExclusive),
                _glyphService
            };

            BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance;
            return (CssSchemaCompletionEntry)Activator.CreateInstance(typeof(CssSchemaCompletionEntry), flags, null, parameters, null);
        }
        public void FilterCompletionList(IList <CssCompletionEntry> completions, CssCompletionContext context)
        {
            if (context.ContextType != CssCompletionContextType.PropertyValue)
            {
                return;
            }

            for (int i = 0; i < completions.Count; i++)
            {
                CssSchemaCompletionEntry entry = completions[i] as CssSchemaCompletionEntry;

                if (entry != null && entry.DisplayText.Contains("gradient("))
                {
                    var cce = CreateCompletionEntry(context, entry);
                    cce.FilterType = entry.FilterType;
                    cce.IsBuilder  = entry.IsBuilder;

                    completions[i] = cce;
                }
            }
        }
        private CssSchemaCompletionEntry CreateCompletionEntry(CssCompletionContext context, CssSchemaCompletionEntry entry)
        {
            CustomCompletionListEntry interim = new CustomCompletionListEntry(entry.DisplayText, GetArguments(entry.DisplayText));

            interim.Description = entry.Description;

            object[] parameters = new object[]
            {
                interim,
                entry.CompletionProvider,
                CssTextSource.Document,
                context.Snapshot.CreateTrackingSpan(context.SpanStart, context.SpanLength, SpanTrackingMode.EdgeExclusive),
                _glyphService
            };

            BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance;

            return((CssSchemaCompletionEntry)Activator.CreateInstance(typeof(CssSchemaCompletionEntry), flags, null, parameters, null));
        }