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

📄 vcalendar.cs

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

    public class vCalendar : IvCalendar
    {
        private DateTime a = new DateTime();
        private DateTime b = new DateTime();
        private string c = "0";
        private string d = "";
        private string e = "";
        private string f = "";
        private string g = "";
        private bool h = true;
        private f i;
        private SMS j;
        private const int k = 1;

        internal vCalendar(ref SMS A_0)
        {
            this.j = A_0;
            this.i = this.j.gm;
        }

        private void a()
        {
            if (this.i.ac.Length > 0)
            {
                switch (this.i.ac.ToUpper())
                {
                    case "GENERAL":
                        throw new GeneralException("ERROR " + this.i.z.ToString() + ": " + this.i.y);

                    case "SMSSEND":
                        throw new SMSSendException("ERROR " + this.i.z.ToString() + ": " + this.i.y);

                    case "SMSREAD":
                        throw new SMSReadException("ERROR " + this.i.z.ToString() + ": " + this.i.y);

                    case "SMSDELETE":
                        throw new SMSDeleteException("ERROR " + this.i.z.ToString() + ": " + this.i.y);

                    case "WAPPUSH":
                        throw new WapPushException("ERROR " + this.i.z.ToString() + ": " + this.i.y);

                    case "VCARD":
                        throw new vCardException("ERROR " + this.i.z.ToString() + ": " + this.i.y);

                    case "VCALENDAR":
                        throw new vCalendarException("ERROR " + this.i.z.ToString() + ": " + this.i.y);
                }
            }
        }

        private void b()
        {
            DateInterval minute;
            string str = "";
            long num = 0L;
            string str2 = "";
            long num2 = 0L;
            if (this.c.Trim().Length >= 2)
            {
                str = this.c.Trim().Substring(this.c.Trim().Length - 1, 1);
                if ((Versioned.IsNumeric(this.c.Trim().Substring(0, this.c.Trim().Length - 1)) & !this.c.Contains(",")) & !this.c.Contains("."))
                {
                    num = Conversions.ToLong(this.c.Trim().Substring(0, this.c.Trim().Length - 1));
                    switch (str.ToUpper())
                    {
                        case "M":
                            minute = DateInterval.Minute;
                            break;

                        case "H":
                            minute = DateInterval.Hour;
                            break;

                        case "D":
                            minute = DateInterval.Day;
                            break;
                    }
                }
                else
                {
                    this.c = "0";
                }
            }
            if (DateTime.Compare(this.a, DateTime.MinValue) != 0)
            {
                if (this.h)
                {
                    if (this.c == "0")
                    {
                        this.b = new DateTime();
                    }
                    else
                    {
                        this.b = DateAndTime.DateAdd(minute, (double) num, this.a);
                    }
                }
                else if (DateTime.Compare(this.b, DateTime.MinValue) == 0)
                {
                    this.c = "0";
                }
                else
                {
                    num2 = DateAndTime.DateDiff(DateInterval.Minute, this.a, this.b, FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1);
                    str2 = "M";
                    if ((num2 % 60L) == 0L)
                    {
                        num2 = (long) Math.Round((double) (((double) num2) / 60.0));
                        str2 = "H";
                        if ((num2 % 0x18L) == 0L)
                        {
                            num2 = (long) Math.Round((double) (((double) num2) / 24.0));
                            str2 = "D";
                        }
                    }
                    this.c = num2.ToString() + str2;
                }
            }
            else if (this.h)
            {
                this.b = new DateTime();
            }
            else
            {
                this.c = "0";
            }
        }

        public string Send()
        {
            mCore.vCalendar.b b = new mCore.vCalendar.b(ref this.j, this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.i.bh, this.i.bi);
            Thread thread = new Thread(new ThreadStart(b.b));
            thread.Name = "VCL_SendMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string p = b.p;
            if (b != null)
            {
                b = null;
            }
            string str = p;
            this.a();
            return str;
        }

        public string SendFile(string vCalendarFile)
        {
            mCore.vCalendar.a a = new mCore.vCalendar.a(ref this.j, vCalendarFile, this.f, this.i.bh, this.i.bi);
            Thread thread = new Thread(new ThreadStart(a.a));
            thread.Name = "VCS_SendFileMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string j = a.j;
            if (a != null)
            {
                a = null;
            }
            string str = j;
            this.a();
            return str;
        }

        public string SendFileToQueue(string vCalendarFile)
        {
            mCore.vCalendar.a a = new mCore.vCalendar.a(ref this.j, vCalendarFile, this.f, this.i.bh, this.i.bi);
            a.h = 2;
            Thread thread = new Thread(new ThreadStart(a.b));
            thread.Name = "VCS_SendFileToQueueMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string i = a.i;
            if (a != null)
            {
                a = null;
            }
            string str = i;
            this.a();
            return str;
        }

        public string SendFileToQueue(string vCalendarFile, QueuePriority Priority)
        {
            mCore.vCalendar.a a = new mCore.vCalendar.a(ref this.j, vCalendarFile, this.f, this.i.bh, this.i.bi);
            a.h = (int) Priority;
            Thread thread = new Thread(new ThreadStart(a.b));
            thread.Name = "VCS_SendFileToQueueMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string i = a.i;
            if (a != null)
            {
                a = null;
            }
            string str = i;
            this.a();
            return str;
        }

        public string SendToQueue()
        {
            mCore.vCalendar.b b = new mCore.vCalendar.b(ref this.j, this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.i.bh, this.i.bi);
            b.m = 2;
            Thread thread = new Thread(new ThreadStart(b.c));
            thread.Name = "VCL_SendToQueueMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string n = b.n;
            if (b != null)
            {
                b = null;
            }
            string str = n;
            this.a();
            return str;
        }

        public string SendToQueue(QueuePriority Priority)
        {
            mCore.vCalendar.b b = new mCore.vCalendar.b(ref this.j, this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.i.bh, this.i.bi);
            b.m = (int) Priority;
            Thread thread = new Thread(new ThreadStart(b.c));
            thread.Name = "VCL_SendToQueueMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string n = b.n;
            if (b != null)
            {
                b = null;
            }
            string str = n;
            this.a();
            return str;
        }

        public string Description
        {
            get
            {
                this.i.av();
                return this.d;
            }
            set
            {
                if (value == null)
                {
                    value = "";
                }
                this.d = value.Trim();
                if ((value.Trim().Length > 0) & !this.i.h(value))
                {
                    this.d = "";
                    this.i.a(0x1f61L, "Invalid characters in event description", "VCALENDAR");
                }
                this.a();
            }
        }

        public string Destination
        {
            get
            {
                this.i.av();
                return this.f;
            }
            set
            {
                this.i.av();
                if (value == null)
                {
                    value = "";

⌨️ 快捷键说明

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