Using 1.2005.1 Adapter model with WinForms.
I would like to change tracing levels at runtime without having to modify the app.config or restart the app.
I can see that it is a static variable and assigned in the file DynamicQueryEngine.cs, but as far as I can tell, it is not visible to the end user code similar to the way that TraceHelper makes the LLBL traceswitches visible.
Based on my concept code below, I can change the three LLBL switches at runtime, but it does not appear that the SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.Switch.Level variable is exposed via the SQL Server driver.
Imports SD.LLBLGen.Pro.ORMSupportClasses.TraceHelper
Trace.WriteLine(GeneralSwitch.DisplayName & " " & GeneralSwitch.Level.ToString)
Trace.WriteLine(PersistenceExecutionSwitch.DisplayName & " " & PersistenceExecutionSwitch.Level.ToString)
Trace.WriteLine(StateManagementSwitch.DisplayName & " " & StateManagementSwitch.Level.ToString)
'Trace.WriteLine(SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.Switch.Level)
GeneralSwitch.Level = TraceLevel.Verbose
PersistenceExecutionSwitch.Level = TraceLevel.Verbose
StateManagementSwitch.Level = TraceLevel.Verbose
Trace.WriteLine(GeneralSwitch.DisplayName & " " & GeneralSwitch.Level.ToString)
Trace.WriteLine(PersistenceExecutionSwitch.DisplayName & " " & PersistenceExecutionSwitch.Level.ToString)
Trace.WriteLine(StateManagementSwitch.DisplayName & " " & StateManagementSwitch.Level.ToString)
' Sample Startup Switch Values to be sure I was referring to the correct entries.
<add name="SqlServerDQE" value="4" />
<add name="ORMGeneral" value="3" />
<add name="ORMStateManagement" value="2" />
<add name="ORMPersistenceExecution" value="1" />
'Trace output
ORMGeneral Info
ORMPersistenceExecution Error
ORMStateManagement Warning
ORMGeneral Verbose
ORMPersistenceExecution Verbose
ORMStateManagement Verbose