using Rubberduck.Unmanaged.Abstract.SafeComWrappers.VB;
using Rubberduck.Unmanaged.Abstract.SafeComWrappers.VB.Enums;
using System;
using System.Collections.Generic;

namespace Rubberduck.Unmanaged.NonDisposingDecorators
{
    public class VBProjectNonDisposingDecorator<T> : NonDisposingDecoratorBase<T>, IVBProject
        where T : IVBProject
    {
        public VBProjectNonDisposingDecorator(T project)
            : base(project)
        { }

        public bool Equals(IVBProject other)
        {
            return WrappedItem.Equals(other);
        }

        public IApplication Application => WrappedItem.Application;

        public IApplication Parent => WrappedItem.Parent;

        public IVBE VBE => WrappedItem.VBE;

        public IVBProjects Collection => WrappedItem.Collection;

        public IReferences References => WrappedItem.References;

        public IVBComponents VBComponents => WrappedItem.VBComponents;

        public Uri Uri => WrappedItem.Uri;

        public string Name
        {
            get => WrappedItem.Name;
            set => WrappedItem.Name = value;
        }

        public string Description
        {
            get => WrappedItem.Description;
            set => WrappedItem.Description = value;
        }

        public string HelpFile
        {
            get => WrappedItem.HelpFile;
            set => WrappedItem.HelpFile = value;
        }

        public string FileName => WrappedItem.FileName;

        public string BuildFileName => WrappedItem.BuildFileName;

        public bool IsSaved => WrappedItem.IsSaved;

        public ProjectType Type => WrappedItem.Type;

        public EnvironmentMode Mode => WrappedItem.Mode;

        public ProjectProtection Protection => WrappedItem.Protection;

        public void SaveAs(string fileName)
        {
            WrappedItem.SaveAs(fileName);
        }

        public void MakeCompiledFile()
        {
            WrappedItem.MakeCompiledFile();
        }

        public void ExportSourceFiles(string folder)
        {
            WrappedItem.ExportSourceFiles(folder);
        }

        public string ProjectDisplayName => WrappedItem.ProjectDisplayName;

        public IReadOnlyList<string> ComponentNames()
        {
            return WrappedItem.ComponentNames();
        }
    }
}