Enqueue() public method

public Enqueue ( object item ) : void
item object
return void
Exemplo n.º 1
0
        static void Logger_Logged(LoggerArgs args)
        {
            if (queue.Count < queueLimit || args.Priority == LogPriority.Debug || args.Priority == LogPriority.Error)
            {
                queue.Enqueue(args.LogString);

                if (queue.Count < queueLimit - 10)
                {
                    queueLimitExceeded = false;
                }
            }
            if (queue.Count == queueLimit && !queueLimitExceeded)
            {
                queueLimitExceeded = true;
                Logger.Debug("Queue is full");
            }

#if (NETMF || OnBoardMonitorEmulator) && DebugOnRealDeviceOverFTDI
            if (System.Diagnostics.Debugger.IsAttached)
            {
                Debug.Print(args.LogString);
                Logger.FreeMemory();
            }
#endif
        }
Exemplo n.º 2
0
 static void Logger_Logged(LoggerArgs args)
 {
     queue.Enqueue(args.LogString);
 }
Exemplo n.º 3
0
        static Comfort()
        {
            commands = new QueueThreadWorker(ProcessCommand);

            InstrumentClusterElectronics.SpeedRPMChanged += (e) =>
            {
                if (needLockDoors && e.Speed > DoorsLockSpeed)
                {
                    if (AutoLockDoors)
                    {
                        BodyModule.LockDoors();
                    }
                    needLockDoors = false;
                    needUnlockDoors = true;
                }
                if (e.Speed == 0)
                {
                    needLockDoors = true;
                }
            };
            InstrumentClusterElectronics.IgnitionStateChanged += (e) =>
            {
                if (!needComfortClose
                    && e.CurrentIgnitionState != IgnitionState.Off
                    && e.PreviousIgnitionState == IgnitionState.Off)
                {
                    needComfortClose = true;
                }
                if (needUnlockDoors && e.CurrentIgnitionState == IgnitionState.Off)
                {
                    if (AutoUnlockDoors)
                    {
                        BodyModule.UnlockDoors();
                    }
                    needUnlockDoors = false;
                    needLockDoors = true;
                }
            };
            BodyModule.RemoteKeyButtonPressed += (e) =>
            {
                if (e.Button == RemoteKeyButton.Lock && needComfortClose)
                {
                    needComfortClose = false;
                    if (AutoCloseWindows)
                    {
                        commands.Enqueue(Command.FullCloseWindows);
                    }
                    if (AutoCloseSunroof)
                    {
                        BodyModule.CloseSunroof();
                    }
                    if (AutoFoldMirrors)
                    {
                        BodyModule.FoldMirrors();
                    }
                }
                if (e.Button == RemoteKeyButton.Unlock)
                {
                    if (AutoUnfoldMirrors)
                    {
                        BodyModule.UnfoldMirrors();
                    }
                }
            };
        }