예제 #1
0
 public void AddMissingMember(MissingMemberInfo mmi, AssemblyInfo sourceAssembly)
 {
     var x = MissingMembers.FirstOrDefault(m => m.MemberName == mmi.MemberName);
     if (x != null)
     {
         x.IncrementUsage(sourceAssembly);
     }
     else
     {
         MissingMembers.Add(mmi);
     }
 }
        public void AddMissingMember(MissingMemberInfo mmi, AssemblyInfo sourceAssembly)
        {
            var x = MissingMembers.FirstOrDefault(m => m.MemberName == mmi.MemberName);

            if (x != null)
            {
                x.IncrementUsage(sourceAssembly);
            }
            else
            {
                MissingMembers.Add(mmi);
            }
        }
예제 #3
0
        public void AddMissingDependency(AssemblyInfo sourceAssembly, MemberInfo missingDependency, string recommendedChanges)
        {
            MissingTypeInfo typeInfo;

            try
            {
                var type = _types[Tuple.Create(missingDependency.DefinedInAssemblyIdentity, missingDependency.TypeDocId ?? missingDependency.MemberDocId)];
                typeInfo = new MissingTypeInfo(sourceAssembly, type.MemberDocId, type.TargetStatus, type.RecommendedChanges);
            }
            catch (KeyNotFoundException)
            {
                typeInfo = new MissingTypeInfo(sourceAssembly, missingDependency.TypeDocId ?? missingDependency.MemberDocId, missingDependency.TargetStatus, recommendedChanges);
            }

            // If we already have an entry for this type, get it.
            if (_missingTypes.Any(mt => mt.TypeName == typeInfo.TypeName))
            {
                typeInfo = _missingTypes.First(mt => mt.TypeName == typeInfo.TypeName);
                typeInfo.IncrementUsage(sourceAssembly);
            }
            else
            {
                _missingTypes.Add(typeInfo);
            }

            // If we did not receive a member entry, it means the entire type is missing -- flag it accordingly
            if (missingDependency.MemberDocId.StartsWith("M:", StringComparison.OrdinalIgnoreCase) ||
                missingDependency.MemberDocId.StartsWith("F:", StringComparison.OrdinalIgnoreCase) ||
                missingDependency.MemberDocId.StartsWith("P:", StringComparison.OrdinalIgnoreCase))
            {
                var memberInfo = new MissingMemberInfo(sourceAssembly, missingDependency.MemberDocId, missingDependency.TargetStatus, recommendedChanges);
                typeInfo.AddMissingMember(memberInfo, sourceAssembly);
            }
            else
            {
                typeInfo.MarkAsMissing();
            }
        }
예제 #4
0
        public void AddMissingDependency(AssemblyInfo SourceAssembly, MemberInfo missingDependency, string recommendedChanges)
        {
            MissingTypeInfo typeInfo;
            try
            {
                var type = _types[Tuple.Create(missingDependency.DefinedInAssemblyIdentity, (missingDependency.TypeDocId ?? missingDependency.MemberDocId))];
                typeInfo = new MissingTypeInfo(SourceAssembly, type.MemberDocId, type.TargetStatus, type.RecommendedChanges);
            }
            catch (KeyNotFoundException)
            {
                typeInfo = new MissingTypeInfo(SourceAssembly, missingDependency.TypeDocId ?? missingDependency.MemberDocId, missingDependency.TargetStatus, recommendedChanges);
            }

            // If we already have an entry for this type, get it.
            if (_missingTypes.Any(mt => mt.TypeName == typeInfo.TypeName))
            {
                typeInfo = _missingTypes.First(mt => mt.TypeName == typeInfo.TypeName);
                typeInfo.IncrementUsage(SourceAssembly);
            }
            else
            {
                _missingTypes.Add(typeInfo);
            }

            // If we did not receive a member entry, it means the entire type is missing -- flag it accordingly
            if (missingDependency.MemberDocId.StartsWith("M:", System.StringComparison.OrdinalIgnoreCase) ||
                missingDependency.MemberDocId.StartsWith("F:", System.StringComparison.OrdinalIgnoreCase) ||
                missingDependency.MemberDocId.StartsWith("P:", System.StringComparison.OrdinalIgnoreCase))
            {
                MissingMemberInfo memberInfo = new MissingMemberInfo(SourceAssembly, missingDependency.MemberDocId, missingDependency.TargetStatus, recommendedChanges);
                typeInfo.AddMissingMember(memberInfo, SourceAssembly);
            }
            else
            {
                typeInfo.MarkAsMissing();
            }
        }