public void DoStuff(int p) { using (var eventListener = new DummyEventListener()) { // when the MDT.EventSource assembly is not fully trusted EnableEvents raises a SecurityException if (IsEventSourceAssmFullyTrusted) { eventListener.EnableEvents(LttADEventSource.Log, EventLevel.LogAlways); } LttADEventSource.Log.MyEvent("test", p); } }
public void DoStuff(int p) { using (var eventListener = new DummyEventListener()) { // when the MDT.EventSource assembly is not fully trusted EnableEvents raises a SecurityException if (IsEventSourceAssmFullyTrusted) { eventListener.EnableEvents(LttADEventSource.Log, EventLevel.LogAlways); } LttADEventSource.Log.MyEvent("test", p); } }