At.FF.Krems.FullscreenBrowser.QueueManager.QueueManager C# (CSharp) Method

QueueManager() public method

Initializes a new instance of the QueueManager class.
public QueueManager ( ) : System
return System
        public QueueManager()
        {
            Logger.DebugFormat("Initialize {0}()", MethodBase.GetCurrentMethod().Name);
            this.actionWorkerThread = new Thread(
                () =>
                {
                    foreach (var action in this.actionQueue.GetConsumingEnumerable())
                    {
                        try
                        {
                            Logger.DebugFormat("Executing action \"{0}\" on \"{1}\"", action.Method, action.Target);
                            action();
                        }
                        catch (Exception exception)
                        {
                            Logger.Error("Exception occured in action\"" + action.Method + "\" on \"" + action.Target + "\"", exception);
                        }
                    }
                }) { Name = "Action Worker Thread", IsBackground = true };
            this.actionWorkerThread.SetApartmentState(ApartmentState.STA);

            Logger.Debug("Start actionWorkerThread");
            this.actionWorkerThread.Start();
        }