/// <summary>
        /// Gets the image for the specified entity.
        /// Returns null when no image is available for the entity type.
        /// </summary>
        public static ImageSource GetImage(IUnresolvedEntity entity)
        {
            CompletionImage image = GetCompletionImage(entity);

            if (image != null)
            {
                return(image.GetImage(entity.Accessibility, entity.IsStatic));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        private static StackPanel GetNodeHeaderWithIcon(string text, CompletionImage image)
        {
            StackPanel header = new StackPanel();
            header.Orientation = Orientation.Horizontal;

            Image img = new Image();
            img.Source = image.BaseImage;
            img.RenderSize = new Size(16d, 16d);
            img.Width = 16d;
            img.Height = 16d;
            img.Margin = new Thickness(1d);
            header.Children.Add(img);

            TextBlock tb = new TextBlock();
            tb.Text = text;
            tb.Margin = new Thickness(1d);
            header.Children.Add(tb);

            return header;
        }