Exemplo n.º 1
0
            internal string DequeueAllAndGetPendingRequestPayload()
            {
                Queue <IrmLicensingManager.LicensingResponseQueue.LicensingResponse> queue;

                lock (this.syncRoot)
                {
                    queue      = this.queue;
                    this.queue = new Queue <IrmLicensingManager.LicensingResponseQueue.LicensingResponse>();
                }
                if (queue.Count <= 0)
                {
                    return(string.Empty);
                }
                StringBuilder stringBuilder = new StringBuilder(128 * queue.Count);

                stringBuilder.Append("processIrmLicenseResponses([");
                bool flag2 = true;

                while (queue.Count > 0)
                {
                    IrmLicensingManager.LicensingResponseQueue.LicensingResponse licensingResponse = queue.Dequeue();
                    if (!flag2)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append(licensingResponse.GetJavascriptEncoded(this.errorIconUrl, this.userCulture));
                    flag2 = false;
                }
                stringBuilder.Append("]);");
                return(stringBuilder.ToString());
            }
Exemplo n.º 2
0
            private bool Enqueue(IrmLicensingManager.LicensingResponseQueue.LicensingResponse response)
            {
                bool result;

                lock (this.syncRoot)
                {
                    if (this.queue.Count >= 10)
                    {
                        this.queue.Dequeue();
                    }
                    this.queue.Enqueue(response);
                    result = (this.queue.Count == 1);
                }
                return(result);
            }