Esempio n. 1
0
 /// <summary>
 /// Called when a nodeInfo that points to a Method that needs to be analysed.
 /// </summary>
 /// <param name="method">The method.</param>
 public void CompleteMethodContainer(MethodContainer methodContainer, CancellationToken cancelToken)
 {
     if ((methodContainer != null) && !methodContainer.Complete)
     {
         Method method = methodContainer as Method;
         if (method != null)
         {
             this.ExceptionFinder.ReadMethod(method.MethodBase, cancelToken);
             return;
         }
         else
         {
             Class cls = methodContainer as Class;
             if (cls != null)
             {
                 this.ExceptionFinder.ReadClass(cls, cancelToken, true);
                 return;
             }
             else
             {
                 Property prop = methodContainer as Property;
                 if (prop != null)
                 {
                     prop.ReadProperty(this.ExceptionFinder, cancelToken);
                 }
             }
         }
     }
 }
Esempio n. 2
0
        /// <summary>Sets the exceptions.</summary>
        /// <param name="exceptions">The exceptions.</param>
        public void SetExceptions(MethodContainer methodContainer, IEnumerable<ThrownException> exceptions)
        {
            this.MethodContainer = methodContainer;
            this.Exceptions = exceptions;

            if (this.ObjectChanged != null)
            {
                this.ObjectChanged(this, new MethodContainerEventArgs(this.MethodContainer));
            }

            this.UpdateList();
        }
Esempio n. 3
0
        /// <summary>Sets the object.</summary>
        /// <param name="methodContainer">The method container.</param>
        /// <param name="rootNode">The root node.</param>
        public void SetObject(MethodContainer methodContainer, TreeNode rootNode)
        {
            this.InvokeIfRequired(() =>
            {
                if (this.ObjectChanged != null)
                {
                    this.ObjectChanged(this, new MethodContainerEventArgs(methodContainer));
                }

                if (rootNode == null)
                {
                    try
                    {
                        this.BeginUpdate();
                        this.Nodes.Clear();
                    }
                    finally
                    {
                        this.EndUpdate();
                    }
                }
            });

            this.MethodContainer = methodContainer;

            this.Method = this.MethodContainer as Method;
            if (this.Method != null)
            {
                this.LoadMethod(rootNode);
                return;
            }

            this.Class = this.MethodContainer as Class;
            if (this.Class != null)
            {
                this.LoadClass(rootNode);
                return;
            }

            this.LoadMethod(rootNode);
        }
Esempio n. 4
0
 public MethodContainerEventArgs(MethodContainer methodContainer)
     : base()
 {
     this.MethodContainer = methodContainer;
 }
Esempio n. 5
0
        void ShowMethodSource(MethodContainer methodContainer)
        {
            Job.SourceView.NewJob(this.SourceViewer, (cancelToken) =>
            {
                List<Method> methods = new List<Method>();

                List<KeyValuePair<MethodBase, IEnumerable<SourceViewer.HighlightItem>>> sources = new List<KeyValuePair<MethodBase, IEnumerable<SourceViewer.HighlightItem>>>();

                if (methodContainer is Method)
                {
                    methods.Add((Method)methodContainer);
                    this.SourceViewer.SetSource(((Method)methodContainer).MethodBase, new SourceViewer.HighlightItem[] { }, cancelToken);
                }
                else
                {
                    Property prop = methodContainer as Property;
                    if (prop != null)
                    {
                        this.SourceViewer.SetSource(prop.PropertyInfo, new SourceViewer.HighlightItem[] { }, cancelToken);
                    }
                }
            }).Execute();
        }
Esempio n. 6
0
        private bool ShouldAnalyse(MethodContainer memberContainer, Type referencedBy)
        {
            if (this.Controller.Settings.SeparateBaseClassItem.Value)
            {
                if ((memberContainer.MemberInfo.DeclaringType != null) && (memberContainer.MemberInfo.DeclaringType != referencedBy))
                {
                    return false;
                }
            }

            return memberContainer.ShouldAnalyse(referencedBy);
        }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MethodAnalysis"/> class.
 /// </summary>
 /// <param name="method">The method.</param>
 public MethodAnalysis(MethodContainer method)
 {
     this.Method = method;
 }