示例#1
0
        public override void EvaluateNode(OTreeNode node)
        {
            MethodInfo m = (MethodInfo)node.Definition;
            if (m.GetMethodBody() != null)
            {
                foreach (LocalVariableInfo i in m.GetMethodBody().LocalVariables)
                {
                    if (!i.LocalType.IsGenericParameter && !i.LocalType.IsGenericType)
                    {
                        if (i.LocalType.IsArray)
                        {
                            if (i.LocalType.GetElementType().IsGenericParameter || i.LocalType.GetElementType().IsGenericType)
                            {
                                continue;
                            }
                        }
                        if (i.LocalType.IsInterface)
                        {
#if DebugWarnings
                            Log.WriteLine("Warning: " + NameBuilder.BuildMethodName(m) + " Uses an interface");
#endif
                            if (node.SelectedImageIndex != Constants.ErrorIcon)
                            {
                                node.SelectedImageIndex = Constants.WarningIcon;
                                node.ImageIndex = Constants.WarningIcon;
                            }
                            node.Warnings.Add(this);
                            return;
                        }
                    }
                }
            }
        }
示例#2
0
        public override void EvaluateNode(OTreeNode node)
        {
            MethodInfo m = (MethodInfo)node.Definition;
            if ((m.Attributes & MethodAttributes.PinvokeImpl) != 0)
            {
#if DebugErrors
                Log.WriteLine(NameBuilder.BuildMethodName(m) + " ~ PInvoke Impl");
#endif
                node.SelectedImageIndex = Constants.ErrorIcon;
                node.ImageIndex = Constants.ErrorIcon;
                node.Errors.Add(this);
            }
        }
        public override void EvaluateNode(OTreeNode node)
        {
            MethodInfo m = (MethodInfo)node.Definition;
            MethodImplAttributes xImplFlags = m.GetMethodImplementationFlags();
            if ((xImplFlags & MethodImplAttributes.Native) != 0)
            {
#if DebugErrors
                Log.WriteLine(NameBuilder.BuildMethodName(m) + " ~ Method Implementation: Native");
#endif
                node.SelectedImageIndex = Constants.ErrorIcon;
                node.ImageIndex = Constants.ErrorIcon;
                node.Errors.Add(this);
            }
        }
示例#4
0
 /// <summary>
 /// Evaluate the given node.
 /// </summary>
 /// <param name="node">The node to evaluate.</param>
 public abstract void EvaluateNode(OTreeNode node);