Beispiel #1
0
        /// <summary>
        /// Creates a new <see cref="Mock{VBE}"/> with the <see cref="VBE.Windows"/> and <see cref="VBE.VBProjects"/> properties setup.
        /// </summary>
        /// <param name="windows">
        /// A <see cref="MockWindowsCollection"/> is expected. 
        /// Other objects implementing the<see cref="Windows"/> interface could cause issues.
        /// </param>
        /// <param name="projects"><see cref="VBProjects"/> collecction.</param>
        /// <returns></returns>
        internal static Mock<VBE> CreateVbeMock(Windows windows, VBProjects projects)
        {
            var vbe = CreateVbeMock(windows);
            vbe.SetupGet(v => v.VBProjects).Returns(projects);

            return vbe;
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new <see cref="Mock{VBE}"/> with the <see cref="VBE.Windows"/> and <see cref="VBE.VBProjects"/> properties setup.
        /// </summary>
        /// <param name="windows">
        /// A <see cref="MockWindowsCollection"/> is expected.
        /// Other objects implementing the<see cref="Windows"/> interface could cause issues.
        /// </param>
        /// <param name="projects"><see cref="VBProjects"/> collecction.</param>
        /// <returns></returns>
        internal static Mock <VBE> CreateVbeMock(Windows windows, VBProjects projects)
        {
            var vbe = CreateVbeMock(windows);

            vbe.SetupGet(v => v.VBProjects).Returns(projects);

            return(vbe);
        }
Beispiel #3
0
 public VbeProjectCollectionModel(VBProjects projects)
 {
     AddRange(projects.Cast <VBProject>().Select(p => new VbeProjectModel(p)));
 }
 public static IEnumerable <VBProject> UnprotectedProjects(this VBProjects projects)
 {
     return(projects.Cast <VBProject>().Where(project => project.Protection == vbext_ProjectProtection.vbext_pp_none));
 }