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

📄 queue.cs

📁 老外Logix Mobile mCoreLib短信控件源码 通过串口或者手机数据线进行连接,可对手机进行 读写操作.
💻 CS
📖 第 1 页 / 共 3 页
字号:
                                        bs = this.a.b2;
                                        br = this.a.b1;
                                        if (bs > 0L)
                                        {
                                            this.b.r.a(bs, br);
                                        }
                                    }
                                    else
                                    {
                                        flag5 = true;
                                        this.b.r.b("Queued vCard sent to " + h.d + " [QueueID: " + h.b + "]");
                                    }
                                }
                                finally
                                {
                                    Monitor.Exit(this.a);
                                }
                                QueueVCardSentEventArgs args8 = new QueueVCardSentEventArgs(h.b, h.d, flag5, str5, bs, br);
                                mCore.Queue.i k = this.k;
                                if (k != null)
                                {
                                    k(args8);
                                }
                            }
                            else
                            {
                                this.b.r.a(0x2333L, "Thread monitor enter attempt timeout [Queue:SendQueue:F]");
                            }
                            continue;
                        }
                        case "VCALENDAR":
                            if (Monitor.TryEnter(this.a, this.a.@as))
                            {
                                try
                                {
                                    str4 = "";
                                    flag4 = false;
                                    this.b.r.b("Sending queued vCalendar to " + h.d + " [Priority: " + ((QueuePriority) h.c).ToString() + "; QueueID: " + h.b + "]");
                                    QueueVCalendarSendingEventArgs args5 = new QueueVCalendarSendingEventArgs(h.d, (QueuePriority) h.c, h.b);
                                    mCore.Queue.a q = this.q;
                                    if (q != null)
                                    {
                                        q(args5);
                                    }
                                    str4 = this.a.b(h.q, h.d, h.j, h.i);
                                    if (str4.Trim().Length <= 0)
                                    {
                                        str4 = -1.ToString();
                                        if (this.a.b4 == 0L)
                                        {
                                            if (this.a.z == 0L)
                                            {
                                                this.a.b4 = 0x1f65L;
                                                this.a.b3 = "vCalendar send error";
                                            }
                                            else
                                            {
                                                this.a.b4 = this.a.z;
                                                this.a.b3 = this.a.y;
                                            }
                                        }
                                        bs = this.a.b4;
                                        br = this.a.b3;
                                        if (bs > 0L)
                                        {
                                            this.b.r.a(bs, br);
                                        }
                                    }
                                    else
                                    {
                                        flag4 = true;
                                        this.b.r.b("Queued vCalendar sent to " + h.d + " [QueueID: " + h.b + "]");
                                    }
                                }
                                finally
                                {
                                    Monitor.Exit(this.a);
                                }
                                QueueVCalendarSentEventArgs args6 = new QueueVCalendarSentEventArgs(h.b, h.d, flag4, str4, bs, br);
                                mCore.Queue.j l = this.l;
                                if (l != null)
                                {
                                    l(args6);
                                }
                                continue;
                            }
                            this.b.r.a(0x2333L, "Thread monitor enter attempt timeout [Queue:SendQueue:G]");
                            break;
                    }
                }
                this.g = false;
            }
        }

        internal string b(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("VCALENDAR", 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:AddVCalendar:B]", "GENERAL");
                    goto Label_0149;
                Label_012E:
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddVCalendar:C]", "GENERAL");
                Label_0149:
                    item = null;
                    this.b.r.b("vCalendar 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:AddVCalendar:1] " + exception.Message);
                    ProjectData.ClearProjectError();
                }
                finally
                {
                    Monitor.Exit(this.c);
                }
                return b;
            }
            this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:AddVCalendar:A]", "GENERAL");
            return "";
        }

        public bool Clear()
        {
            bool flag;
            try
            {
                if (Monitor.TryEnter(this.c, this.a.@as))
                {
                    try
                    {
                        this.c.Clear();
                    }
                    finally
                    {
                        Monitor.Exit(this.c);
                    }
                }
                else
                {
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:Clear:A]", "GENERAL");
                }
                if (Monitor.TryEnter(this.d, this.a.@as))
                {
                    try
                    {
                        this.d.Clear();
                    }
                    finally
                    {
                        Monitor.Exit(this.d);
                    }
                }
                else
                {
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:Clear:B]", "GENERAL");
                }
                if (Monitor.TryEnter(this.e, this.a.@as))
                {
                    try
                    {
                        this.e.Clear();
                    }
                    finally
                    {
                        Monitor.Exit(this.e);
                    }
                }
                else
                {
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [Queue:Clear:C]", "GENERAL");
                }
                this.b.r.b("Unsent messages cleared from message queue");
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                this.b.r.b("Error encountered clearing message queue");
                flag = false;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public int Count
        {
            get
            {
                int num2 = 0;
                num2 = (this.c.Count + this.d.Count) + this.e.Count;
                if (num2 > 0)
                {
                    this.b.r.b(num2.ToString() + " unsent messages in queue");
                    return num2;
                }
                this.b.r.b("Message queue is empty");
                return num2;
            }
        }

        public bool Enabled
        {
            get
            {
                return this.h;
            }
            set
            {
                this.h = value;
                if (this.h)
                {
                    this.b.r.b("Message queue enabled");
                }
                else
                {
                    this.b.r.b("Message queue disabled");
                }
                if (((((this.c.Count > 0) | (this.d.Count > 0)) | (this.e.Count > 0)) & this.h) & !this.g)
                {
                    Thread thread = new Thread(new ThreadStart(this.b));
                    thread.Name = "SendQueueThread";
                    thread.Start();
                }
            }
        }

        public int mCore.IQueue.Count
        {
            get
            {
                int num2 = 0;
                num2 = (this.c.Count + this.d.Count) + this.e.Count;
                if (num2 > 0)
                {
                    this.b.r.b(num2.ToString() + " unsent messages in queue");
                    return num2;
                }
                this.b.r.b("Message queue is empty");
                return num2;
            }
        }

        public bool mCore.IQueue.Enabled
        {
            get
            {
                return this.h;
            }
            set
            {
                this.h = value;
                if (this.h)
                {
                    this.b.r.b("Message queue enabled");
                }
                else
                {
                    this.b.r.b("Message queue disabled");
                }
                if (((((this.c.Count > 0) | (this.d.Count > 0)) | (this.e.Count > 0)) & this.h) & !this.g)
                {
                    Thread thread = new Thread(new ThreadStart(this.b));
                    thread.Name = "SendQueueThread";
                    thread.Start();
                }
            }
        }

        internal delegate void a(QueueVCalendarSendingEventArgs A_0);

        internal delegate void b(QueueSmartMessageSendingEventArgs A_0);

        internal delegate void c(QueueWapPushSentEventArgs A_0);

        internal delegate void d(QueueSMSSentEventArgs A_0);

        internal delegate void e(QueueWapPushSendingEventArgs A_0);

        internal delegate void f(QueueSMSSendingEventArgs A_0);

        internal delegate void g(QueueSmartMessageSentEventArgs A_0);

        internal delegate void h(QueueVCardSendingEventArgs A_0);

        internal delegate void i(QueueVCardSentEventArgs A_0);

        internal delegate void j(QueueVCalendarSentEventArgs A_0);
    }
}

⌨️ 快捷键说明

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