internal DebugManager(Activity root, string moduleNamePrefix, string typeNamePrefix, string auxiliaryThreadName, bool breakOnStartup, 
            WorkflowInstance host, bool debugStartedAtRoot, bool resetDynamicModule)
        {
            if (resetDynamicModule)
            {
                dynamicModuleManager = null;
            }

            if (dynamicModuleManager == null)
            {
                dynamicModuleManager = new StateManager.DynamicModuleManager(moduleNamePrefix);
            }

            this.stateManager = new StateManager(
                new StateManager.Properties
                    {
                        ModuleNamePrefix = moduleNamePrefix,
                        TypeNamePrefix = typeNamePrefix,
                        AuxiliaryThreadName = auxiliaryThreadName,
                        BreakOnStartup = breakOnStartup
                    },
                    debugStartedAtRoot, dynamicModuleManager);
            
            this.states = new Dictionary<object, State>();
            this.runningThreads = new Dictionary<int, Stack<Activity>>();
            this.instrumentationTracker = new InstrumentationTracker(root);
            this.host = host;
        }
 public DebugManager(Activity root, string moduleNamePrefix, string typeNamePrefix, string auxiliaryThreadName, bool breakOnStartup, WorkflowInstance host, bool debugStartedAtRoot)
 {
     StateManager.Properties properties = new StateManager.Properties {
         ModuleNamePrefix = moduleNamePrefix,
         TypeNamePrefix = typeNamePrefix,
         AuxiliaryThreadName = auxiliaryThreadName,
         BreakOnStartup = breakOnStartup
     };
     this.stateManager = new StateManager(properties, debugStartedAtRoot);
     this.states = new Dictionary<object, System.Activities.Debugger.State>();
     this.runningThreads = new Dictionary<int, Stack<Activity>>();
     this.instrumentationTracker = new InstrumentationTracker(root);
     this.host = host;
 }
 public LogicalThread(int threadId, string threadName, StateManager stateManager)
 {
     this.threadId = threadId;
     this.callStack = new Stack<VirtualStackFrame>();
     this.controller = new ThreadWorkerController();
     this.controller.Initialize(threadName + "." + threadId.ToString(CultureInfo.InvariantCulture), stateManager);
 }
 // Exiting the DebugManager.
 // Delete all temporary files 
 public void Exit()
 {
     if (this.temporaryFiles != null)
     {
         foreach (string temporaryFile in this.temporaryFiles)
         {
             // Clean up published source.
             try
             {
                 File.Delete(temporaryFile);
             }
             catch (IOException)
             {
                 // ---- IOException silently.
             }
             this.temporaryFiles = null;
         }
     }
     this.stateManager.ExitThreads(); // State manager is still keep for the session in SessionStateManager
     this.stateManager = null;
 }
 internal void Initialize(string threadName, StateManager manager)
 {
     this.stateManager = manager;
     this.breakOnStartup = this.stateManager.ManagerProperties.BreakOnStartup;
     CreateWorkerThread(threadName);
 }
 public void Exit()
 {
     if (this.temporaryFiles != null)
     {
         foreach (string str in this.temporaryFiles)
         {
             try
             {
                 File.Delete(str);
             }
             catch (IOException)
             {
             }
             this.temporaryFiles = null;
         }
     }
     this.stateManager.Dispose();
     this.stateManager = null;
 }