Exemple #1
0
            public DrawingGroup GetCompletionKindImage(CodeCompletionKind icon)
            {
                if (!_cache.TryGetValue(icon, out var image))
                {
                    if (Application.Current.Styles.TryGetResource(icon.ToString(), out object resource))
                    {
                        image = resource as DrawingGroup;
                        _cache.Add(icon, image);
                    }
                    else
                    {
                        System.Console.WriteLine($"No intellisense icon provided for {icon}");
                    }
                }

                return(image);
            }
Exemple #2
0
            public DrawingGroup GetCompletionKindImage(CodeCompletionKind icon)
            {
                if (!_cache.TryGetValue(icon, out var image))
                {
                    var resource = Application.Current.FindStyleResource(icon.ToString());

                    if (resource == AvaloniaProperty.UnsetValue)
                    {
                        System.Console.WriteLine($"No intellisense icon provided for {icon}");
                    }
                    else
                    {
                        image = resource as DrawingGroup;
                        _cache.Add(icon, image);
                    }
                }

                return(image);
            }