コード例 #1
0
 public EntityItem(IMember member, IAmbience ambience)
 {
     this.IsInSamePart        = true;
     this.entity              = member.UnresolvedMember;
     ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList | ConversionFlags.ShowParameterList | ConversionFlags.ShowParameterNames;
     text  = ambience.ConvertSymbol(member);
     image = CompletionImage.GetImage(member);
 }
コード例 #2
0
        public static ContextActionViewModel MakeViewModel(IEntity entity, ObservableCollection <ContextActionViewModel> childActions)
        {
            var ambience = AmbienceService.GetCurrentAmbience();

            ambience.ConversionFlags = ConversionFlags.ShowDeclaringType | ConversionFlags.ShowTypeParameterList;
            return(new ContextActionViewModel {
                Action = new GoToEntityAction(entity, ambience.ConvertSymbol(entity)),
                Image = CompletionImage.GetImage(entity),
                Comment = string.Format("(in {0})", entity.Namespace),
                ChildActions = childActions
            });
        }
コード例 #3
0
        public EntityCompletionData(IEntity entity)
            : base()
        {
            if (entity == null)
            {
                throw new ArgumentException("entity");
            }

            Entity = entity;
            Ambience.ConversionFlags = entity is ITypeDefinition ? ConversionFlags.ShowTypeParameterList : ConversionFlags.None;
            CompletionText           = DisplayText = entity.Name;
            Image = CompletionImage.GetImage(entity);
        }
コード例 #4
0
            public EntityItem(IUnresolvedTypeDefinition typeDef, ICompilation compilation)
            {
                this.IsInSamePart = true;
                this.entity       = typeDef;
                var resolvedDefinition = typeDef.Resolve(new SimpleTypeResolveContext(compilation.MainAssembly)).GetDefinition();

                if (resolvedDefinition != null)
                {
                    var ambience = compilation.GetAmbience();
                    ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList | ConversionFlags.ShowDeclaringType;
                    this.text = ambience.ConvertSymbol(resolvedDefinition);
                }
                else
                {
                    this.text = typeDef.Name;
                }
                this.image = CompletionImage.GetImage(typeDef);
            }
コード例 #5
0
        public EntityCompletionData(IEntity entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            this.entity = entity;
            IAmbience ambience = new CSharpAmbience();

            ambience.ConversionFlags = entity is ITypeDefinition ? ConversionFlags.ShowTypeParameterList : ConversionFlags.None;
            DisplayText              = entity.Name;
            this.CompletionText      = ambience.ConvertEntity(entity);
            ambience.ConversionFlags = ConversionFlags.StandardConversionFlags;
            if (entity is ITypeDefinition)
            {
                // Show fully qualified Type name
                ambience.ConversionFlags |= ConversionFlags.UseFullyQualifiedTypeNames;
            }
            this.Image = CompletionImage.GetImage(entity);
        }
コード例 #6
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);
        }
コード例 #7
0
 public static IImage GetIcon(IUnresolvedEntity entity)
 {
     return(GetIImage(CompletionImage.GetImage(entity)));
 }
コード例 #8
0
 public static IImage GetIcon(ITypeDefinition t)
 {
     return(GetIImage(CompletionImage.GetImage(t)));
 }