Example #1
0
        public List <string> Dequeue(int n)
        {
            lock (this.SyObject)
            {
                UpdateState();

                List <string> R     = new List <string>(n);
                int           Index = 0;

                while (true)
                {
                    var tmp = dataFile.ReadStringEntry();
                    if (tmp == null)
                    {
                        return(R);
                    }

                    R.Add(tmp.Value);
                    ++Index;
                    realCurrent++;
                    realCursor = (int)dataFile.Position;

                    if (Index == n)
                    {
                        break;
                    }
                }

                return(R);
            }
        }
Example #2
0
        public List <string> ShadowDequeueAll()
        {
            lock (this.SyObject)
            {
                List <string> R = new List <string>();
                using (var tmpFile = new StreamRW(FileName))
                {
                    tmpFile.Seek(12, SeekOrigin.Begin);

                    while (true)
                    {
                        var E = tmpFile.ReadStringEntry();

                        if (E == null)
                        {
                            return(R);
                        }

                        R.Add(E.Value);
                    }
                    return(R);
                }
            }
        }