コード例 #1
0
        bool IsCorlibReference(ReferenceEntry re)
        {
            TargetRuntime   tr;
            TargetFramework fx;
            string          file;

            if (ProjectDomService.ParseAssemblyUri(re.Uri, out tr, out fx, out file))
            {
                return(Path.GetFileNameWithoutExtension(file) == "mscorlib");
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        public void ParseAssemblyUriTests()
        {
            TargetRuntime   runtime;
            TargetFramework fx;
            string          file;

            ProjectDomService.ParseAssemblyUri("Assembly:Mono 2.4.2.3:/usr/lib/mono/2.0/mscorlib.dll", out runtime, out fx, out file);
            Assert.AreEqual("/usr/lib/mono/2.0/mscorlib.dll", file);

            ProjectDomService.ParseAssemblyUri("Assembly:MS.NET:C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\mscorlib.dll", out runtime, out fx, out file);
            Assert.AreEqual("C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\mscorlib.dll", file);

            ProjectDomService.ParseAssemblyUri("Assembly:Mono r142024 Wed Sep 16 11:39:25 BST 2009:/usr/local/lib/mono/2.0/mscorlib.dll", out runtime, out fx, out file);
            Assert.AreEqual("/usr/local/lib/mono/2.0/mscorlib.dll", file);
        }