Ejemplo n.º 1
0
        public SbqOppResult Opp(QueueMethod method, byte[] item)
        {
            //
            SbqOppResult ru = new SbqOppResult();

            if (QueueMethod.Add == method)
            {
                _byteList.Enqueue(item);

                ru.oppSucess = true;
            }
            else if (QueueMethod.Shift == method && _byteList.Count > 0)
            {
                ru.oppSucess = true;
                ru.item      = _byteList.Dequeue();
            }
            else if (QueueMethod.Peek == method && _byteList.Count > 0)
            {
                ru.oppSucess = true;
                ru.item      = _byteList.Peek();
            }
            else if (QueueMethod.Count == method)
            {
                ru.oppSucess = true;
                ru.count     = _byteList.Count;
            }

            return(ru);
        }
Ejemplo n.º 2
0
        public SbqOppResult Opp(QueueMethod method, byte[] item)
        {
            //
            SbqOppResult ru = new SbqOppResult();

            if (QueueMethod.Add == method)
            {

                _byteList.Enqueue(item);

                ru.oppSucess = true;

            }
            else if (QueueMethod.Shift == method && _byteList.Count > 0)
            {
                ru.oppSucess = true;
                ru.item = _byteList.Dequeue();

            }
            else if (QueueMethod.Peek == method && _byteList.Count > 0)
            {
                ru.oppSucess = true;
                ru.item = _byteList.Peek();

            }
            else if (QueueMethod.Count == method)
            {
                ru.oppSucess = true;
                ru.count = _byteList.Count;
            }

            return ru;

        }