Ejemplo n.º 1
0
        /// <summary>
        /// Describes whether this reference is primary or not
        /// </summary>
        /// <param name="reference">The reference.</param>
        /// <param name="fusionName">The fusion name for this reference.</param>
        /// <param name="importance">The importance of the message.</param>
        private void LogPrimaryOrDependency(Reference reference, string fusionName, MessageImportance importance)
        {
            if (reference.IsPrimary)
            {
                if (reference.IsUnified)
                {
                    Log.LogMessageFromResources(importance, "ResolveAssemblyReference.UnifiedPrimaryReference", fusionName);
                }
                else
                {
                    Log.LogMessageFromResources(importance, "ResolveAssemblyReference.PrimaryReference", fusionName);
                }
            }
            else
            {
                if (reference.IsUnified)
                {
                    Log.LogMessageFromResources(importance, "ResolveAssemblyReference.UnifiedDependency", fusionName);
                }
                else
                {
                    Log.LogMessageFromResources(importance, "ResolveAssemblyReference.Dependency", fusionName);
                }
            }

            foreach (UnificationVersion unificationVersion in reference.GetPreUnificationVersions())
            {
                switch (unificationVersion.reason)
                {
                    case UnificationReason.BecauseOfBindingRedirect:
                        if (AutoUnify)
                        {
                            Log.LogMessageFromResources(importance, "ResolveAssemblyReference.FourSpaceIndent", Log.FormatResourceString("ResolveAssemblyReference.UnificationByAutoUnify", unificationVersion.version, unificationVersion.referenceFullPath));
                        }
                        else
                        {
                            Log.LogMessageFromResources(importance, "ResolveAssemblyReference.FourSpaceIndent", Log.FormatResourceString("ResolveAssemblyReference.UnificationByAppConfig", unificationVersion.version, _appConfigFile, unificationVersion.referenceFullPath));
                        }
                        break;

                    case UnificationReason.FrameworkRetarget:
                        Log.LogMessageFromResources(importance, "ResolveAssemblyReference.FourSpaceIndent", Log.FormatResourceString("ResolveAssemblyReference.UnificationByFrameworkRetarget", unificationVersion.version, unificationVersion.referenceFullPath));
                        break;

                    case UnificationReason.DidntUnify:
                        break;

                    default:
                        Debug.Assert(false, "Should have handled this case.");
                        break;
                }
            }

            foreach (AssemblyRemapping remapping in reference.RemappedAssemblyNames())
            {
                Log.LogMessageFromResources(importance, "ResolveAssemblyReference.FourSpaceIndent", Log.FormatResourceString("ResolveAssemblyReference.RemappedReference", remapping.From.FullName, remapping.To.FullName));
            }
        }
 private void LogPrimaryOrDependency(Reference reference, string fusionName, MessageImportance importance)
 {
     if (reference.IsPrimary)
     {
         if (reference.IsUnified)
         {
             base.Log.LogMessageFromResources(importance, "ResolveAssemblyReference.UnifiedPrimaryReference", new object[] { fusionName });
         }
         else
         {
             base.Log.LogMessageFromResources(importance, "ResolveAssemblyReference.PrimaryReference", new object[] { fusionName });
         }
     }
     else if (reference.IsUnified)
     {
         base.Log.LogMessageFromResources(importance, "ResolveAssemblyReference.UnifiedDependency", new object[] { fusionName });
     }
     else
     {
         base.Log.LogMessageFromResources(importance, "ResolveAssemblyReference.Dependency", new object[] { fusionName });
     }
     foreach (UnificationVersion version in reference.GetPreUnificationVersions())
     {
         switch (version.reason)
         {
             case UnificationReason.DidntUnify:
             {
                 continue;
             }
             case UnificationReason.FrameworkRetarget:
             {
                 base.Log.LogMessageFromResources(importance, "ResolveAssemblyReference.FourSpaceIndent", new object[] { base.Log.FormatResourceString("ResolveAssemblyReference.UnificationByFrameworkRetarget", new object[] { version.version, version.referenceFullPath }) });
                 continue;
             }
             case UnificationReason.BecauseOfBindingRedirect:
             {
                 if (!this.AutoUnify)
                 {
                     break;
                 }
                 base.Log.LogMessageFromResources(importance, "ResolveAssemblyReference.FourSpaceIndent", new object[] { base.Log.FormatResourceString("ResolveAssemblyReference.UnificationByAutoUnify", new object[] { version.version, version.referenceFullPath }) });
                 continue;
             }
             default:
             {
                 continue;
             }
         }
         base.Log.LogMessageFromResources(importance, "ResolveAssemblyReference.FourSpaceIndent", new object[] { base.Log.FormatResourceString("ResolveAssemblyReference.UnificationByAppConfig", new object[] { version.version, this.appConfigFile, version.referenceFullPath }) });
     }
 }