示例#1
0
 void Set(TDayEvent de)
 {
     nType = de.nType;
     nData = de.nData;
     Time.Set(de.Time);
     nDst = de.nDst;
 }
示例#2
0
        public bool AddEvent(GregorianDateTime time, int inType, int inData, int inDst)
        {
            TDayEvent de = new TDayEvent();

            de.Time = new GregorianDateTime(time);

            switch (inDst)
            {
            case 0:
                de.nDst = 0;
                break;

            case 1:
                if (de.Time.shour >= 2 / 24.0)
                {
                    de.Time.shour += 1 / 24.0;
                    de.Time.NormalizeValues();
                    de.nDst = 1;
                }
                else
                {
                    de.nDst = 0;
                }
                break;

            case 2:
                de.Time.shour += 1 / 24.0;
                de.Time.NormalizeValues();
                de.nDst = 1;
                break;

            case 3:
                if (de.Time.shour <= 2 / 24.0)
                {
                    de.Time.shour += 1 / 24.0;
                    de.Time.NormalizeValues();
                    de.nDst = 1;
                }
                else
                {
                    de.nDst = 0;
                }
                break;

            default:
                de.nDst = 0;
                break;
            }

            de.nData = inData;
            de.nType = inType;

            p_events.Add(de);

            return(true);
        }
示例#3
0
        public bool AddEvent(GregorianDateTime inTime, int inType, int inData, DstTypeChange inDst)
        {
            TDayEvent de = new TDayEvent();

            de.Time = new GregorianDateTime();
            de.Time.Set(inTime);

            switch (inDst)
            {
            case DstTypeChange.DstOff:
                de.nDst = 0;
                break;

            case DstTypeChange.DstStart:
                if (de.Time.shour >= 2 / 24.0)
                {
                    de.Time.shour += 1 / 24.0;
                    de.Time.NormalizeValues();
                    de.nDst = 1;
                }
                else
                {
                    de.nDst = 0;
                }
                break;

            case DstTypeChange.DstOn:
                de.Time.shour += 1 / 24.0;
                de.Time.NormalizeValues();
                de.nDst = 1;
                break;

            case DstTypeChange.DstEnd:
                if (de.Time.shour <= 2 / 24.0)
                {
                    de.Time.shour += 1 / 24.0;
                    de.Time.NormalizeValues();
                    de.nDst = 1;
                }
                else
                {
                    de.nDst = 0;
                }
                break;

            default:
                de.nDst = 0;
                break;
            }
            de.nData = inData;
            de.nType = inType;

            p_events.Add(de);

            return(true);
        }