⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queue.cs

📁 老外Logix Mobile mCoreLib短信控件源码 通过串口或者手机数据线进行连接,可对手机进行 读写操作.
💻 CS
📖 第 1 页 / 共 3 页
字号:
namespace mCore
{
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Diagnostics;
    using System.Runtime.CompilerServices;
    using System.Threading;

    public class Queue : IQueue
    {
        private f a;
        private SMS b;
        private Collection c = new Collection();
        private Collection d = new Collection();
        private Collection e = new Collection();
        private int f = 0;
        private bool g = false;
        private bool h = false;

        internal event mCore.Queue.b QSmartMessageSending;

        internal event mCore.Queue.g QSmartMessageSent;

        internal event mCore.Queue.f QSMSSending;

        internal event mCore.Queue.d QSMSSent;

        internal event mCore.Queue.a QVCalendarSending;

        internal event mCore.Queue.j QVCalendarSent;

        internal event mCore.Queue.h QVCardSending;

        internal event mCore.Queue.i QVCardSent;

        internal event mCore.Queue.e QWapPushSending;

        internal event mCore.Queue.c QWapPushSent;

        internal Queue(ref SMS A_0)
        {
            this.b = A_0;
            this.a = this.b.gm;
        }

        private string a()
        {
            if (this.f >= 0x7fffffff)
            {
                this.f = 0;
            }
            this.f++;
            return this.f.ToString();
        }

        internal string a(string A_0, string A_1, int A_2, int A_3, bool A_4)
        {
            if (Monitor.TryEnter(this.c, this.a.@as))
            {
                h item = new h("VCARD", A_2, A_0, "", false, this.a.bl, this.a.bm, A_4, A_3, "", "", DateTime.MinValue, "", "", A_1, "", this.a(), 0, 0);
                string b = item.b;
                try
                {
                    switch (A_2)
                    {
                        case 1:
                            this.c.Add(item, b, null, null);
                            goto Label_0149;

                        case 2:
                            if (!Monitor.TryEnter(this.d, this.a.@as))
                            {
                                break;
                            }
                            try
                            {
                                this.d.Add(item, b, null, null);
                            }
                            finally
                            {
                                Monitor.Exit(this.d);
                            }
                            goto Label_0149;

                        case 3:
                            if (!Monitor.TryEnter(this.e, this.a.@as))
                            {
                                goto Label_012E;
                            }
                            try
                            {
                                this.e.Add(item, b, null, null);
                            }
                            finally
                            {
                                Monitor.Exit(this.e);
                            }
                            goto Label_0149;

                        default:
                            goto Label_0149;
                    }
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddVCard:B]", "GENERAL");
                    goto Label_0149;
                Label_012E:
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddVCard:C]", "GENERAL");
                Label_0149:
                    item = null;
                    this.b.r.b("vCard message added to queue [Dest: " + A_0 + "; Priority: " + ((QueuePriority) A_2).ToString() + "; QueueID: " + b + "]");
                    if (((((this.c.Count > 0) | (this.d.Count > 0)) | (this.c.Count > 0)) & this.h) & !this.g)
                    {
                        Thread thread = new Thread(new ThreadStart(this.b));
                        thread.Name = "SendQueueThread";
                        thread.Start();
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    this.b.r.b("[Queue:AddVCard:1] " + exception.Message);
                    ProjectData.ClearProjectError();
                }
                finally
                {
                    Monitor.Exit(this.c);
                }
                return b;
            }
            this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddVCard:A]", "GENERAL");
            return "";
        }

        internal string a(string A_0, string A_1, int A_2, bool A_3, int A_4, int A_5, int A_6)
        {
            if (Monitor.TryEnter(this.c, this.a.@as))
            {
                h item = new h("SMART", A_2, A_0, A_1, false, 7, 3, A_3, A_4, "", "", DateTime.MinValue, "", "", "", "", this.a(), A_6, A_5);
                string b = item.b;
                try
                {
                    switch (A_2)
                    {
                        case 1:
                            this.c.Add(item, b, null, null);
                            goto Label_0137;

                        case 2:
                            if (!Monitor.TryEnter(this.d, this.a.@as))
                            {
                                break;
                            }
                            try
                            {
                                this.d.Add(item, b, null, null);
                            }
                            finally
                            {
                                Monitor.Exit(this.d);
                            }
                            goto Label_0137;

                        case 3:
                            if (!Monitor.TryEnter(this.e, this.a.@as))
                            {
                                goto Label_011C;
                            }
                            try
                            {
                                this.e.Add(item, b, null, null);
                            }
                            finally
                            {
                                Monitor.Exit(this.e);
                            }
                            goto Label_0137;

                        default:
                            goto Label_0137;
                    }
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddSMS:B]", "GENERAL");
                    goto Label_0137;
                Label_011C:
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddSMS:C]", "GENERAL");
                Label_0137:
                    item = null;
                    this.b.r.b("Smart message added to queue [Dest: " + A_0 + "; Priority: " + ((QueuePriority) A_2).ToString() + "; QueueID: " + b + "]");
                    if (((((this.c.Count > 0) | (this.d.Count > 0)) | (this.c.Count > 0)) & this.h) & !this.g)
                    {
                        Thread thread = new Thread(new ThreadStart(this.b));
                        thread.Name = "SendQueueThread";
                        thread.Start();
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    this.b.r.b("[Queue:AddSmartMessage:1] " + exception.Message);
                    ProjectData.ClearProjectError();
                }
                finally
                {
                    Monitor.Exit(this.c);
                }
                return b;
            }
            this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddSmartMessage:A]", "GENERAL");
            return "";
        }

        internal string a(string A_0, string A_1, int A_2, bool A_3, int A_4, int A_5, bool A_6, int A_7)
        {
            if (Monitor.TryEnter(this.c, this.a.@as))
            {
                h item = new h("SMS", A_2, A_0, A_1, A_3, A_4, A_5, A_6, A_7, "", "", DateTime.MinValue, "", "", "", "", this.a(), 0, 0);
                string b = item.b;
                try
                {
                    switch (A_2)
                    {
                        case 1:
                            this.c.Add(item, b, null, null);
                            goto Label_0138;

                        case 2:
                            if (!Monitor.TryEnter(this.d, this.a.@as))
                            {
                                break;
                            }
                            try
                            {
                                this.d.Add(item, b, null, null);
                            }
                            finally
                            {
                                Monitor.Exit(this.d);
                            }
                            goto Label_0138;

                        case 3:
                            if (!Monitor.TryEnter(this.e, this.a.@as))
                            {
                                goto Label_011D;
                            }
                            try
                            {
                                this.e.Add(item, b, null, null);
                            }
                            finally
                            {
                                Monitor.Exit(this.e);
                            }
                            goto Label_0138;

                        default:
                            goto Label_0138;
                    }
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddSMS:B]", "GENERAL");
                    goto Label_0138;
                Label_011D:
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddSMS:C]", "GENERAL");
                Label_0138:
                    item = null;
                    this.b.r.b("SMS message added to queue [Dest: " + A_0 + "; Priority: " + ((QueuePriority) A_2).ToString() + "; QueueID: " + b + "]");
                    if (((((this.c.Count > 0) | (this.d.Count > 0)) | (this.c.Count > 0)) & this.h) & !this.g)
                    {
                        Thread thread = new Thread(new ThreadStart(this.b));
                        thread.Name = "SendQueueThread";
                        thread.Start();
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    this.b.r.b("[Queue:AddSMS:1] " + exception.Message);
                    ProjectData.ClearProjectError();
                }
                finally
                {
                    Monitor.Exit(this.c);
                }
                return b;
            }
            this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddSMS:A]", "GENERAL");
            return "";
        }

        internal string a(string A_0, string A_1, string A_2, DateTime A_3, string A_4, string A_5, int A_6, int A_7, bool A_8)
        {
            if (Monitor.TryEnter(this.c, this.a.@as))
            {
                h item = new h("WAPPUSH", A_6, A_0, "", false, this.a.bl, this.a.bm, A_8, A_7, A_1, A_2, A_3, A_4, A_5, "", "", this.a(), 0, 0);
                string b = item.b;
                try
                {
                    switch (A_6)
                    {
                        case 1:
                            this.c.Add(item, b, null, null);
                            goto Label_013E;

                        case 2:
                            if (!Monitor.TryEnter(this.d, this.a.@as))
                            {
                                break;
                            }
                            try
                            {
                                this.d.Add(item, b, null, null);
                            }
                            finally
                            {
                                Monitor.Exit(this.d);
                            }
                            goto Label_013E;

                        case 3:
                            if (!Monitor.TryEnter(this.e, this.a.@as))
                            {
                                goto Label_0123;
                            }
                            try
                            {
                                this.e.Add(item, b, null, null);
                            }
                            finally
                            {
                                Monitor.Exit(this.e);
                            }
                            goto Label_013E;

                        default:
                            goto Label_013E;
                    }
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddWapPush:B]", "GENERAL");
                    goto Label_013E;
                Label_0123:
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddWapPush:C]", "GENERAL");
                Label_013E:
                    item = null;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -