Esempio n. 1
0
        private IAssemblyCookie CreateCookieCore([NotNull] AssemblyReferenceTarget target)
        {
            AssemblyReferenceResolveResult result = ResolveManager.Resolve(target, _resolveProject);

            return(result != null
                                ? _assemblyFactory.AddRef(result, "T4", _t4Environment.PlatformID)
                                : null);
        }
Esempio n. 2
0
        private IAssemblyCookie CreateCookie(string assemblyNameOrFile)
        {
            if (assemblyNameOrFile == null || (assemblyNameOrFile = assemblyNameOrFile.Trim()).Length == 0)
            {
                return(null);
            }

            AssemblyReferenceTarget target = null;

            // assembly path
            FileSystemPath path = FileSystemPath.TryParse(assemblyNameOrFile);

            if (!path.IsEmpty && path.IsAbsolute)
            {
                target = new AssemblyReferenceTarget(AssemblyNameInfo.Empty, path);
            }

            // assembly name
            else
            {
                AssemblyNameInfo nameInfo = AssemblyNameInfo.TryParse(assemblyNameOrFile);
                if (nameInfo != null)
                {
                    target = new AssemblyReferenceTarget(nameInfo, FileSystemPath.Empty);
                }
            }

            if (target == null)
            {
                return(null);
            }

            AssemblyReferenceResolveResult result = ResolveManager.Resolve(target, _resolveProject);

            if (result == null)
            {
                return(null);
            }

            return(_assemblyFactory.AddRef(result, "T4", _t4Environment.PlatformID));
        }