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

📄 queue.cs

📁 老外Logix Mobile mCoreLib短信控件源码 通过串口或者手机数据线进行连接,可对手机进行 读写操作.
💻 CS
📖 第 1 页 / 共 3 页
字号:
                    this.b.r.b("WAP Push message added to queue [Dest: " + A_0 + "; Priority: " + ((QueuePriority) A_6).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:AddWapPush:1] " + exception.Message);
                    ProjectData.ClearProjectError();
                }
                finally
                {
                    Monitor.Exit(this.c);
                }
                return b;
            }
            this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddWapPush:A]", "GENERAL");
            return "";
        }

        private void b()
        {
            string str2 = "";
            string str6 = "";
            string str5 = "";
            string str4 = "";
            string str = "";
            string br = "";
            bool flag6 = false;
            bool flag5 = false;
            bool flag4 = false;
            bool flag2 = false;
            if (!this.g)
            {
                this.b.r.b("Message queue sending started");
                this.g = true;
                while ((((this.c.Count > 0) | (this.d.Count > 0)) | (this.e.Count > 0)) & this.h)
                {
                    int num6;
                    bool flag = false;
                    h h = null;
                    try
                    {
                        if (this.c.Count > 0)
                        {
                            if (Monitor.TryEnter(this.c, this.a.@as))
                            {
                                try
                                {
                                    h = (h) this.c[1];
                                    this.c.Remove(1);
                                    flag = true;
                                }
                                finally
                                {
                                    Monitor.Exit(this.c);
                                }
                            }
                            else
                            {
                                this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:SendQueue:A]", "GENERAL");
                            }
                        }
                        else if (!flag & (this.d.Count > 0))
                        {
                            if (Monitor.TryEnter(this.d, this.a.@as))
                            {
                                try
                                {
                                    h = (h) this.d[1];
                                    this.d.Remove(1);
                                    flag = true;
                                }
                                finally
                                {
                                    Monitor.Exit(this.d);
                                }
                            }
                            else
                            {
                                this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:SendQueue:B]", "GENERAL");
                            }
                        }
                        else if (!flag & (this.e.Count > 0))
                        {
                            if (Monitor.TryEnter(this.e, this.a.@as))
                            {
                                try
                                {
                                    h = (h) this.e[1];
                                    this.e.Remove(1);
                                    flag = true;
                                }
                                finally
                                {
                                    Monitor.Exit(this.e);
                                }
                            }
                            else
                            {
                                this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:SendQueue:C]", "GENERAL");
                            }
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        this.b.r.b("[Queue:SendQueue:1] " + exception.Message);
                        ProjectData.ClearProjectError();
                    }
                    long bs = 0L;
                    br = "";
                    switch (h.a.ToUpper())
                    {
                        case "SMS":
                        {
                            if (Monitor.TryEnter(this.a, this.a.@as))
                            {
                                bool flag3;
                                try
                                {
                                    str2 = "";
                                    flag3 = false;
                                    this.b.r.b("Sending queued SMS to " + h.d + " [Priority: " + ((QueuePriority) h.c).ToString() + "; QueueID: " + h.b + "]");
                                    QueueSMSSendingEventArgs args3 = new QueueSMSSendingEventArgs(h.d, (QueuePriority) h.c, h.b);
                                    mCore.Queue.f n = this.n;
                                    if (n != null)
                                    {
                                        n(args3);
                                    }
                                    str2 = this.a.a(h.d, h.e, h.f, h.g, h.h, h.i, h.j);
                                    if (str2.Length == 0)
                                    {
                                        num6 = -1;
                                        str2 = num6.ToString();
                                        if (this.a.bs == 0L)
                                        {
                                            if (this.a.z == 0L)
                                            {
                                                this.a.bs = 0xfa6L;
                                                this.a.br = "Send message error";
                                            }
                                            else
                                            {
                                                this.a.bs = this.a.z;
                                                this.a.br = this.a.y;
                                            }
                                        }
                                        bs = this.a.bs;
                                        br = this.a.br;
                                        if (bs > 0L)
                                        {
                                            this.b.r.a(bs, br);
                                        }
                                    }
                                    else
                                    {
                                        flag3 = true;
                                        this.b.r.b("Queued SMS sent to " + h.d + " [QueueID: " + h.b + "]");
                                    }
                                }
                                finally
                                {
                                    Monitor.Exit(this.a);
                                }
                                QueueSMSSentEventArgs args4 = new QueueSMSSentEventArgs(h.b, h.d, flag3, str2, bs, br);
                                mCore.Queue.d d = this.i;
                                if (d != null)
                                {
                                    d(args4);
                                }
                            }
                            else
                            {
                                this.b.r.a(0x2333L, "Thread monitor enter attempt timeout [Queue:SendQueue:D]");
                            }
                            continue;
                        }
                        case "SMART":
                        {
                            if (Monitor.TryEnter(this.a, this.a.@as))
                            {
                                try
                                {
                                    str = "";
                                    flag2 = false;
                                    this.b.r.b("Sending queued smart message to " + h.d + " [Priority: " + ((QueuePriority) h.c).ToString() + "; QueueID: " + h.b + "]");
                                    QueueSmartMessageSendingEventArgs args = new QueueSmartMessageSendingEventArgs(h.d, (QueuePriority) h.c, h.b);
                                    mCore.Queue.b r = this.r;
                                    if (r != null)
                                    {
                                        r(args);
                                    }
                                    str = this.a.a(h.e, h.d, h.j, h.i, h.r, h.s);
                                    if (str.Length == 0)
                                    {
                                        num6 = -1;
                                        str = num6.ToString();
                                        if (this.a.b6 == 0L)
                                        {
                                            if (this.a.z == 0L)
                                            {
                                                this.a.b6 = 0xfceL;
                                                this.a.b5 = "Smart message send error";
                                            }
                                            else
                                            {
                                                this.a.b6 = this.a.z;
                                                this.a.b5 = this.a.y;
                                            }
                                        }
                                        bs = this.a.b6;
                                        br = this.a.b5;
                                        if (bs > 0L)
                                        {
                                            this.b.r.a(bs, br);
                                        }
                                    }
                                    else
                                    {
                                        flag2 = true;
                                        this.b.r.b("Queued smart message sent to " + h.d + " [QueueID: " + h.b + "]");
                                    }
                                }
                                finally
                                {
                                    Monitor.Exit(this.a);
                                }
                                QueueSmartMessageSentEventArgs args2 = new QueueSmartMessageSentEventArgs(h.b, h.d, flag2, str, bs, br);
                                mCore.Queue.g m = this.m;
                                if (m != null)
                                {
                                    m(args2);
                                }
                            }
                            else
                            {
                                this.b.r.a(0x2333L, "Thread monitor enter attempt timeout [Queue:SendQueue:D]");
                            }
                            continue;
                        }
                        case "WAPPUSH":
                        {
                            if (Monitor.TryEnter(this.a, this.a.@as))
                            {
                                try
                                {
                                    str6 = "";
                                    flag6 = false;
                                    this.b.r.b("Sending queued wap push to " + h.d + " [Priority: " + ((QueuePriority) h.c).ToString() + "; QueueID: " + h.b + "]");
                                    QueueWapPushSendingEventArgs args9 = new QueueWapPushSendingEventArgs(h.d, (QueuePriority) h.c, h.b);
                                    mCore.Queue.e o = this.o;
                                    if (o != null)
                                    {
                                        o(args9);
                                    }
                                    str6 = this.a.a(h.d, h.k, h.l, h.m, h.n, h.o, h.j, h.i);
                                    if (str6.Length == 0)
                                    {
                                        num6 = -1;
                                        str6 = num6.ToString();
                                        if (this.a.b0 == 0L)
                                        {
                                            if (this.a.z == 0L)
                                            {
                                                this.a.b0 = 0x1b60L;
                                                this.a.bz = "WAP push send error";
                                            }
                                            else
                                            {
                                                this.a.b0 = this.a.z;
                                                this.a.bz = this.a.y;
                                            }
                                        }
                                        bs = this.a.b0;
                                        br = this.a.bz;
                                        if (bs > 0L)
                                        {
                                            this.b.r.a(bs, br);
                                        }
                                    }
                                    else
                                    {
                                        flag6 = true;
                                        this.b.r.b("Queued wap push sent to " + h.d + " [QueueID: " + h.b + "]");
                                    }
                                }
                                finally
                                {
                                    Monitor.Exit(this.a);
                                }
                                QueueWapPushSentEventArgs args10 = new QueueWapPushSentEventArgs(h.b, h.d, flag6, str6, bs, br);
                                mCore.Queue.c c = this.j;
                                if (c != null)
                                {
                                    c(args10);
                                }
                            }
                            else
                            {
                                this.b.r.a(0x2333L, "Thread monitor enter attempt timeout [Queue:SendQueue:E]");
                            }
                            continue;
                        }
                        case "VCARD":
                        {
                            if (Monitor.TryEnter(this.a, this.a.@as))
                            {
                                try
                                {
                                    flag5 = false;
                                    str5 = "";
                                    this.b.r.b("Sending queued vCard to " + h.d + " [Priority: " + ((QueuePriority) h.c).ToString() + "; QueueID: " + h.b + "]");
                                    QueueVCardSendingEventArgs args7 = new QueueVCardSendingEventArgs(h.d, (QueuePriority) h.c, h.b);
                                    mCore.Queue.h p = this.p;
                                    if (p != null)
                                    {
                                        p(args7);
                                    }
                                    str5 = this.a.a(h.p, h.d, h.j, h.i);
                                    if (str5.Trim().Length <= 0)
                                    {
                                        num6 = -1;
                                        str5 = num6.ToString();
                                        if (this.a.b2 == 0L)
                                        {
                                            if (this.a.z == 0L)
                                            {
                                                this.a.b2 = 0x1f5aL;
                                                this.a.b1 = "vCard send error";
                                            }
                                            else
                                            {
                                                this.a.b2 = this.a.z;
                                                this.a.b1 = this.a.y;
                                            }
                                        }

⌨️ 快捷键说明

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