public override void VisitMethodDefinitionCollection(MethodDefinitionCollection methods)
 {
     foreach (MethodDefinition methodDefinition in methods)
     {
         VisitMethodDefinition(methodDefinition);
     }
 }
Ejemplo n.º 2
0
		private void DoCheck(MethodDefinitionCollection methods, MethodAttributes access)
		{			
			List<string> unsorted = new List<string>();
			int numMethods = 0;
			
			string previous = null;
			foreach (MethodDefinition method in methods)
			{
				if (DoIsValidMethod(method))
				{
					if ((method.Attributes & MethodAttributes.MemberAccessMask) == access)
					{
						string name = DoGetName(method);
						if (previous != null && string.Compare(previous, name) > 0)
						{
							Log.DebugLine(this, "{0} isn't sorted ({1})", method.Name, method);
							unsorted.Add(name);
						}
						else
						{
							Log.DebugLine(this, "{0} is sorted", method.Name);
							++numMethods;
							previous = name;
						}
					}
				}
			}
			
			if (numMethods > 0)
			{
				float percent = (float) (numMethods - unsorted.Count)/numMethods;
				Log.DebugLine(this, "{0}% of the {1} methods are sorted", percent, access);
				if (percent >= 0.8 && unsorted.Count > 0)
				{
					m_details += string.Join(" ", unsorted.ToArray()) + " ";
				}
			}
		}
Ejemplo n.º 3
0
 public virtual void VisitMethodDefinitionCollection(MethodDefinitionCollection methods)
 {
 }
		public override void VisitMethodDefinitionCollection (MethodDefinitionCollection methods)
		{
			VisitCollection (methods);
		}
        public virtual void VisitMethodDefinitionCollection(MethodDefinitionCollection methods)
        {

        }
 public virtual void VisitMethodDefinitionCollection(MethodDefinitionCollection methods)
 {
     foreach (MethodDefinition method in methods)
     {
         VisitMethodDefinition(method);
     }
 }
Ejemplo n.º 7
0
 private void AddUsedTypesFromMethods(MethodDefinitionCollection Methods, List<UsedClass> usedT)
 {
     foreach (MethodDefinition method in Methods)
     {
         AddUsedTypesFromParameters(method.Parameters, usedT);
         AddTypeToList(method.ReturnType.ReturnType, ClassUse.Returns, usedT);
         AddUsedTypesFromAttributes(method.CustomAttributes, usedT);
         AddTypesFromMethodBody(method.Body as IMethodBody, usedT);
     }
 }
Ejemplo n.º 8
0
		public override void VisitMethodDefinitionCollection (MethodDefinitionCollection methods)
		{
			foreach (MethodDefinition meth in methods) {
				VisitMethodDefinition (meth);
				m_writer.WriteLine ();
			}
		}
Ejemplo n.º 9
0
 public override void VisitMethodDefinitionCollection(MethodDefinitionCollection methods)
 {
     for (int i = 0; i < methods.Count; i++)
         VisitMethodDefinition(methods[i]);
 }
Ejemplo n.º 10
0
 public void VisitMethodDefinitionCollection(MethodDefinitionCollection methods)
 {
     foreach (MethodDefinition method in methods)
     {
         if (!method.IsSpecialName || method.IsConstructor)
         {
             AppendNode(method.DeclaringType, method, false);
         }
     }
 }
Ejemplo n.º 11
0
 public void VisitMethodDefinitionCollection(MethodDefinitionCollection methods)
 {
     if (this.Type == null) return;
     for (int i = 0; i < methods.Count; i++)
         VisitMethodDefinition(methods[i]);
 }
        /// <summary>
        /// Extracts methods and add them to method list for type
        /// </summary>
        /// <param name="type"></param>
        /// <param name="methods"></param>
        private void ReadMethods(Type type, MethodDefinitionCollection methods)
        {
            foreach (MethodDefinition methodDefinition in methods)
            {
                var method = new Method
                {
                    Name = FormatMethodName(methodDefinition),
                    Type = type
                };

                type.Methods.Add(method);
            }

            foreach (MethodDefinition methodDefinition in methods)
            {
                var method = (from m in type.Methods
                              where m.Name == FormatMethodName(methodDefinition)
                              select m).SingleOrDefault();

                if (methodDefinition.Body != null)
                {
                    ReadInstructions(method, methodDefinition, methodDefinition.Body.Instructions);
                }
            }
        }
Ejemplo n.º 13
0
 private void Visit(MethodDefinitionCollection methodDefinitionCollection)
 {
   foreach (MethodDefinition method in methodDefinitionCollection)
   {
     Visit(method);
   }
 }