2 using System
.Diagnostics
;
3 using System
.Reflection
;
6 public class StaticFlag
{
7 private static bool _flag
= false;
8 public static bool Flag
{
19 public class CallingAssemblyDependant
{
20 private string _calledFrom
;
21 public string CalledFrom
{
27 public CallingAssemblyDependant () {
28 _calledFrom
= Assembly
.GetCallingAssembly ().GetName ().Name
;
31 public static string CalledFromLibrary () {
32 return new CallingAssemblyDependant ().CalledFrom
;
36 public class ResourceRelaxedFieldInit
{
37 private static ResourceRelaxedFieldInit _singleResource
= new ResourceRelaxedFieldInit ();
38 public static ResourceRelaxedFieldInit Single
{
40 return _singleResource
;
51 public ResourceRelaxedFieldInit () {
52 _flag
= StaticFlag
.Flag
;
56 public class ResourceStrictFieldInit
{
57 private static ResourceStrictFieldInit _singleResource
= new ResourceStrictFieldInit ();
58 public static ResourceStrictFieldInit Single
{
60 return _singleResource
;
71 public ResourceStrictFieldInit () {
72 _flag
= StaticFlag
.Flag
;
75 static ResourceStrictFieldInit () {
79 public class InlinedMethods
{
80 public static MethodBase
GetCurrentMethod () {
81 return MethodBase
.GetCurrentMethod ();
83 public static Assembly
GetExecutingAssembly () {
84 return Assembly
.GetExecutingAssembly ();
86 public static Assembly
GetCallingAssembly () {
87 return Assembly
.GetCallingAssembly ();
89 public static Assembly
CallCallingAssembly () {
90 return GetCallingAssembly ();
92 public static StackFrame
GetStackFrame () {
93 return new StackFrame ();
95 public static ResourceRelaxedFieldInit
GetResourceRelaxedFieldInit () {
96 return ResourceRelaxedFieldInit
.Single
;
98 public static ResourceStrictFieldInit
GetResourceStrictFieldInit () {
99 return ResourceStrictFieldInit
.Single
;