/// <summary>
        /// Initializes a new instance of the <see cref="VB6UnresolvedEntityBase"/> class.
        /// </summary>
        /// <param name="file">The file that is the source of this entity.</param>
        /// <param name="typeDefinition">The <see cref="IUnresolvedTypeDefinition"/> that this entity is a child of. May be null.</param>
        protected VB6UnresolvedEntityBase(IUnresolvedFile file, IUnresolvedTypeDefinition typeDefinition)
            : this()
        {
            this.UnresolvedFile = file;

            VB6UnresolvedFile vb6File = (VB6UnresolvedFile)file;

            this.VbpProject = vb6File.Project;


            this.DeclaringTypeDefinition = typeDefinition;
        }
Exemple #2
0
        public override IEnumerable <NewFolding> GetFoldings(IDocument document, out int firstErrorOffset)
        {
            firstErrorOffset = 0;

            VB6UnresolvedFile file = (VB6UnresolvedFile)this.UnresolvedFile;

            List <NewFolding> foldings = new List <NewFolding>();

            /* Definitely fold the headers, since they annoy the most.
             */
            foldings.Add(new NewFolding(0, file.PartitionedFile.Preamble.Length - 2)
            {
                DefaultClosed = true, IsDefinition = true, Name = "Header"
            });

            /* Not sure if this is needed. We keep it in, but may be removed in future.
             */
            foldings.AddRange(base.GetFoldings(document, out firstErrorOffset));

            return(foldings);
        }