Ejemplo n.º 1
0
        private static string TryCopyResourceAssembly(Assembly cachedAssembly, string originalAssemblyDirectory, string resourceCulture)
        {
            string str  = Path.Combine(originalAssemblyDirectory, resourceCulture);
            string str1 = Path.Combine(Microsoft.Expression.Framework.Documents.PathHelper.GetDirectoryNameOrRoot(cachedAssembly.Location), resourceCulture);
            string str2 = string.Concat(ProjectAssemblyHelper.GetAssemblyName(cachedAssembly).Name, ".resources.dll");
            string str3 = Path.Combine(str, str2);
            string str4 = Path.Combine(str1, str2);

            if (!File.Exists(str3))
            {
                return(null);
            }
            if (Microsoft.Expression.Framework.Documents.PathHelper.ArePathsEquivalent(str3, str4))
            {
                return(str4);
            }
            if (File.Exists(str4))
            {
                return(null);
            }
            if (!Microsoft.Expression.Framework.Documents.PathHelper.DirectoryExists(str1))
            {
                Directory.CreateDirectory(str1);
            }
            File.Copy(str3, str4);
            return(str4);
        }
Ejemplo n.º 2
0
        public Assembly ResolveReferenceAssembly(Assembly runtimeAssembly)
        {
            Assembly assembly = null;

            if (!this.referenceAssemblyTable.TryGetValue(runtimeAssembly, out assembly))
            {
                assembly = this.ResolveReferenceAssembly(ProjectAssemblyHelper.GetAssemblyName(runtimeAssembly));
                this.referenceAssemblyTable[runtimeAssembly] = assembly;
            }
            return(assembly);
        }
Ejemplo n.º 3
0
        internal ProjectAssembly(IProjectItem projectItem, Assembly runtimeAssembly, string path, bool isImplicitlyResolvedAssembly)
        {
            this.Path            = path;
            this.RuntimeAssembly = runtimeAssembly;
            AssemblyName assemblyName = ProjectAssemblyHelper.GetAssemblyName(this.RuntimeAssembly);

            this.Name                 = assemblyName.Name;
            this.FullName             = ProjectAssemblyHelper.CachedGetAssemblyFullName(assemblyName);
            this.IsImplicitlyResolved = isImplicitlyResolvedAssembly;
            this.ProjectItem          = projectItem;
        }
Ejemplo n.º 4
0
        public BlendAssemblyResolver()
        {
            UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(this.InitializeBlendLoadedAssemblies));
            Assembly assembly = typeof(BlendAssemblyResolver).Assembly;
            string   codeBase = assembly.CodeBase;

            codeBase = codeBase.Substring(0, codeBase.LastIndexOf('/') + 1);
            string localPath = (new Uri(codeBase)).LocalPath;
            string str       = ProjectAssemblyHelper.GetAssemblyName(assembly).Version.ToString();
            Dictionary <string, string> strs = new Dictionary <string, string>(8)
            {
                { string.Concat("Microsoft.Expression.Platform.WPF, Version=", str, ", Culture=neutral, PublicKeyToken=31bf3856ad364e35"), PathHelper.ResolveCombinedPath(localPath, "Microsoft.Expression.Platform.WPF.dll") },
                { string.Concat("Microsoft.Expression.Platform.Silverlight, Version=", str, ", Culture=neutral, PublicKeyToken=31bf3856ad364e35"), PathHelper.ResolveCombinedPath(localPath, "Microsoft.Expression.Platform.Silverlight.dll") },
                { "ActiproSoftware.Shared.Net20, Version=1.0.102.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", null },
                { "ActiproSoftware.SyntaxEditor.Addons.DotNet.Net20, Version=4.0.283.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", null },
                { "ActiproSoftware.SyntaxEditor.Net20, Version=4.0.283.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", null },
                { "ActiproSoftware.WinUICore.Net20, Version=1.0.102.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", null },
                { "Microsoft.Windows.Design.Interaction, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", PathHelper.ResolveCombinedPath(localPath, "Microsoft.Windows.Design.Interaction.dll") },
                { "Microsoft.Windows.Design.Extensibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", PathHelper.ResolveCombinedPath(localPath, "Microsoft.Windows.Design.Extensibility.dll") }
            };

            this.delayLoadedAssemblies = strs;
        }