Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FrameInformation.cs
1using System;
2using System.Diagnostics;
3using System.Reflection;
4
6{
10 public class FrameInformation
11 {
12 private readonly bool valid;
13 private readonly bool last;
14 private readonly MethodBase method;
15 private readonly Type type;
16 private readonly string typeName;
17 private readonly Assembly assembly;
18 private readonly string assemblyName;
19 private readonly StackFrame frame;
20
25 public FrameInformation(StackFrame Frame)
26 {
27 this.frame = Frame;
28 this.method = Frame.GetMethod();
29 if (this.method is null)
30 this.last = true;
31 else
32 {
33 this.last = false;
34
35 this.type = this.method.DeclaringType;
36 if (this.type is null)
37 this.valid = false;
38 else
39 {
40 this.valid = true;
41
42 this.typeName = this.type.FullName;
43 this.assembly = this.type.Assembly;
44 this.assemblyName = this.assembly.GetName().Name;
45 }
46 }
47 }
48
52 public StackFrame Frame => this.frame;
53
57 public bool Valid => this.valid;
58
62 public bool Last => this.last;
63
67 public MethodBase Method => this.method;
68
72 public Type Type => this.type;
73
77 public string TypeName => this.typeName;
78
82 public Assembly Assembly => this.assembly;
83
87 public string AssemblyName => this.assemblyName;
88
90 public override string ToString()
91 {
92 return this.frame.ToString();
93 }
94 }
95}
Contains information about a specific frame in a call stack.
bool Last
If this is the last frame in the stack (no method information available).
FrameInformation(StackFrame Frame)
Contains information about a specific frame in a call stack.
MethodBase Method
Method represented by the frame.
StackFrame Frame
Stack frame represented.
Type Type
Call made from this type.
Assembly Assembly
Assembly represented by the frame.