Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ApproveString.cs
1using System;
2using System.Reflection;
3
5{
10 {
11 private readonly string s;
12
16 public ApproveString(string String)
17 {
18 this.s = String;
19 }
20
30 public override bool? Check(FrameInformation Frame)
31 {
32 if (Frame.TypeName + "." + Frame.Method.Name == this.s ||
33 Frame.TypeName == this.s ||
34 Frame.AssemblyName == this.s)
35 {
36 return true;
37 }
38
39 Type T = Frame.Type;
40 while (!(T is null) && T.Attributes.HasFlag(TypeAttributes.NestedPrivate))
41 {
42 T = T.DeclaringType;
43
44 if (T.FullName + "." + Frame.Method.Name == this.s ||
45 T.FullName == this.s)
46 {
47 return true;
48 }
49 }
50
51 return null;
52 }
53 }
54}
Checks for approved sources in the call stack using a string.
override? bool Check(FrameInformation Frame)
Performs a check of a stack frame.
ApproveString(string String)
Checks for approved sources in the call stack using a string.
Abstract base class for call stack checks.
Contains information about a specific frame in a call stack.
MethodBase Method
Method represented by the frame.
Type Type
Call made from this type.