当前位置: 首页>>代码示例>>C#>>正文


C# LibraryRange.GetReferenceAssemblyName方法代码示例

本文整理汇总了C#中LibraryRange.GetReferenceAssemblyName方法的典型用法代码示例。如果您正苦于以下问题:C# LibraryRange.GetReferenceAssemblyName方法的具体用法?C# LibraryRange.GetReferenceAssemblyName怎么用?C# LibraryRange.GetReferenceAssemblyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LibraryRange的用法示例。


在下文中一共展示了LibraryRange.GetReferenceAssemblyName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetDescription

        public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
        {
            if (!libraryRange.IsGacOrFrameworkReference)
            {
                return null;
            }

            if (!RuntimeEnvironmentHelper.IsWindows)
            {
                return null;
            }

            if (!VersionUtility.IsDesktop(targetFramework))
            {
                return null;
            }

            var name = libraryRange.Name;
            var version = libraryRange.VersionRange?.MinVersion;

            string path;
            if (!TryResolvePartialName(libraryRange.GetReferenceAssemblyName(), version, targetFramework, out path))
            {
                return null;
            }

            return new LibraryDescription(
                libraryRange,
                new LibraryIdentity(name, version, isGacOrFrameworkReference: true),
                path,
                LibraryTypes.GlobalAssemblyCache,
                Enumerable.Empty<LibraryDependency>(),
                new[] { libraryRange.GetReferenceAssemblyName() },
                framework: targetFramework);
        }
开发者ID:leloulight,项目名称:dnx,代码行数:35,代码来源:GacDependencyResolver.cs

示例2: GetDescription

        public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
        {
            if (!libraryRange.IsGacOrFrameworkReference)
            {
                return null;
            }

            var name = libraryRange.GetReferenceAssemblyName();
            var version = libraryRange.VersionRange?.MinVersion;

            string path;
            Version assemblyVersion;

            if (!FrameworkResolver.TryGetAssembly(name, targetFramework, out path, out assemblyVersion))
            {
                return null;
            }

            if (version == null || version.Version == assemblyVersion)
            {
                return new LibraryDescription(
                    libraryRange,
                    new LibraryIdentity(libraryRange.Name, new SemanticVersion(assemblyVersion), isGacOrFrameworkReference: true),
                    path,
                    LibraryTypes.ReferenceAssembly,
                    Enumerable.Empty<LibraryDependency>(),
                    new[] { name },
                    framework: targetFramework);
            }

            return null;
        }
开发者ID:rajeevkb,项目名称:dnx,代码行数:32,代码来源:ReferenceAssemblyDependencyResolver.cs

示例3: GetDescription

        public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
        {
            if (!libraryRange.IsGacOrFrameworkReference)
            {
                return null;
            }

            if (!RuntimeEnvironmentHelper.IsWindows)
            {
                return null;
            }

            if (!VersionUtility.IsDesktop(targetFramework))
            {
                return null;
            }

            var name = libraryRange.Name;
            var version = libraryRange.VersionRange?.MinVersion;

            string path;
            if (!TryResolvePartialName(libraryRange.GetReferenceAssemblyName(), version, out path))
            {
                return null;
            }

            _resolvedPaths[name] = path;

            return new LibraryDescription
            {
                LibraryRange = libraryRange,
                Identity = new Library
                {
                    Name = name,
                    Version = version,
                    IsGacOrFrameworkReference = true
                },
                LoadableAssemblies = new[] { libraryRange.GetReferenceAssemblyName() },
                Dependencies = Enumerable.Empty<LibraryDependency>()
            };
        }
开发者ID:noahfalk,项目名称:dnx,代码行数:41,代码来源:GacDependencyResolver.cs

示例4: GetDescription

        public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
        {
            if (!libraryRange.IsGacOrFrameworkReference)
            {
                return null;
            }

            var name = libraryRange.GetReferenceAssemblyName();
            var version = libraryRange.VersionRange?.MinVersion;

            string path;
            Version assemblyVersion;

            if (!FrameworkResolver.TryGetAssembly(name, targetFramework, out path, out assemblyVersion))
            {
                return null;
            }

            if (version == null || version.Version == assemblyVersion)
            {
                _resolvedPaths[libraryRange.Name] = path;

                return new LibraryDescription
                {
                    LibraryRange = libraryRange,
                    Identity = new Library
                    {
                        Name = libraryRange.Name,
                        Version = new SemanticVersion(assemblyVersion),
                        IsGacOrFrameworkReference = true
                    },
                    LoadableAssemblies = new[] { name },
                    Dependencies = Enumerable.Empty<LibraryDependency>()
                };
            }

            return null;
        }
开发者ID:noahfalk,项目名称:dnx,代码行数:38,代码来源:ReferenceAssemblyDependencyResolver.cs


注:本文中的LibraryRange.GetReferenceAssemblyName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。