Ejemplo n.º 1
0
        public static DateTime GetDateTime(MiMFa_Time time)
        {
            DateTime dt = new DateTime();

            dt = new DateTime(dt.Year, dt.Month, dt.Day, time.Hour, time.Minute, time.Second);
            return(dt);
        }
Ejemplo n.º 2
0
        public static MiMFa_Time operator -(MiMFa_Time op1, MiMFa_Time op2)
        {
            var op = new MiMFa_Time(op1);

            op.DecreaseWith(op2);
            return(op);
        }
Ejemplo n.º 3
0
        public static MiMFa_Time operator /(MiMFa_Time op1, MiMFa_Time op2)
        {
            var op = new MiMFa_Time(op1);

            op.Hour   /= op1.Hour;
            op.Minute /= op1.Minute;
            op.Second /= op1.Second;
            return(op);
        }
Ejemplo n.º 4
0
 public static void Decrease(MiMFa_Time thisTime, params MiMFa_Time[] withThisTimes)
 {
     foreach (var item in withThisTimes)
     {
         thisTime.ULHour   -= item._Hour;
         thisTime.ULMinute -= item._Minute;
         thisTime.ULSecond -= item._Second;
     }
 }
Ejemplo n.º 5
0
 public static bool Compare(MiMFa_Time thisTime, MiMFa_Time rhitThisTime)
 {
     if (rhitThisTime._Hour == thisTime._Hour &&
         rhitThisTime._Minute == thisTime._Minute &&
         rhitThisTime._Second == thisTime._Second)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 6
0
 public static bool IsBetween(MiMFa_Time thisTime, MiMFa_Time fromthisTime, MiMFa_Time tothisTime)
 {
     if (IsSame(thisTime, fromthisTime) ||
         IsSame(thisTime, tothisTime) ||
         (IsNext(thisTime, fromthisTime) &&
          IsBack(thisTime, tothisTime)))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 7
0
        public static MiMFa_Time GetLengthTime(MiMFa_Time ofThisTime, MiMFa_Time toThisTime)
        {
            float      Len  = GetLengthSecond(ofThisTime, toThisTime);
            int        h    = (int)Len / 3600;
            int        m    = (int)(Len % 3600) / 60;
            int        s    = (int)(Len % 3600) % 60;
            MiMFa_Time time = new MiMFa_Time();

            time._Hour   = h;
            time._Minute = m;
            time._Second = s;
            return(time);
        }
Ejemplo n.º 8
0
        public static float GetLengthSecond(MiMFa_Time ofThisTime, MiMFa_Time toThisTime)
        {
            int sec = 0;

            if (ofThisTime.Hour >= toThisTime.Hour && ofThisTime.Minute >= toThisTime.Minute && ofThisTime.Second >= toThisTime.Second)
            {
                sec += (24 - (ofThisTime.Hour - toThisTime.Hour)) * 3600;
            }
            else
            {
                sec += ((toThisTime.Hour - ofThisTime.Hour) * 3600);
            }
            sec += ((toThisTime.Minute - ofThisTime.Minute) * 60);
            sec += toThisTime.Second - ofThisTime.Second;

            return(sec);
        }
Ejemplo n.º 9
0
 public static bool IsNext(MiMFa_Time thisTime, MiMFa_Time fromthisTime)
 {
     if (ReferenceEquals(thisTime, null) || ReferenceEquals(fromthisTime, null))
     {
         return(false);
     }
     if (thisTime.Hour > fromthisTime.Hour)
     {
         return(true);
     }
     if (thisTime.Hour == fromthisTime.Hour && thisTime.Minute > fromthisTime.Minute)
     {
         return(true);
     }
     if (thisTime.Hour == fromthisTime.Hour && thisTime.Minute == fromthisTime.Minute && thisTime.Second > fromthisTime.Second)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 10
0
 public static float GetLengthMinute(MiMFa_Time ofThisTime, MiMFa_Time toThisTime)
 {
     return(GetLengthSecond(ofThisTime, toThisTime) / 60);
 }
Ejemplo n.º 11
0
 public float GetLengthMinute(MiMFa_Time toThisTime)
 {
     return(GetLengthMinute(this, toThisTime));
 }
Ejemplo n.º 12
0
 public static float GetLengthHour(MiMFa_Time ofThisTime, MiMFa_Time toThisTime)
 {
     return(GetLengthSecond(ofThisTime, toThisTime) / 3600);
 }
Ejemplo n.º 13
0
 public float GetLengthHour(MiMFa_Time toThisTime)
 {
     return(GetLengthHour(this, toThisTime));
 }
Ejemplo n.º 14
0
 public void SetTime(MiMFa_Time time)
 {
     SetTime(time.Hour, time.Minute, time.Second);
 }
Ejemplo n.º 15
0
 public MiMFa_Time GetLengthTime(MiMFa_Time toThisTime)
 {
     return(GetLengthTime(this, toThisTime));
 }
Ejemplo n.º 16
0
 public static void CopyTo(MiMFa_Time ofThisTime, MiMFa_Time toThisTime)
 {
     toThisTime._Hour   = ofThisTime._Hour;
     toThisTime._Minute = ofThisTime._Minute;
     toThisTime._Second = ofThisTime._Second;
 }
Ejemplo n.º 17
0
 public bool IsNext(MiMFa_Time fromthisTime)
 {
     return(IsNext(this, fromthisTime));
 }
Ejemplo n.º 18
0
 public bool IsBack(MiMFa_Time fromthisTime)
 {
     return(IsBack(this, fromthisTime));
 }
Ejemplo n.º 19
0
 public static string GetTime(MiMFa_Time time)
 {
     return(string.Format("{0:d2}:{1:d2}:{2:d2}", time.Hour, time.Minute, time.Second));
 }
Ejemplo n.º 20
0
 public void CopyTo(MiMFa_Time thisTime)
 {
     CopyTo(this, thisTime);
 }
Ejemplo n.º 21
0
 public static bool IsSame(MiMFa_Time thisTime, MiMFa_Time rhitthisTime)
 {
     return(rhitthisTime._Hour == thisTime._Hour &&
            rhitthisTime._Minute == thisTime._Minute &&
            rhitthisTime._Second == thisTime._Second);
 }
Ejemplo n.º 22
0
 public bool IsSame(MiMFa_Time thisTime)
 {
     return(IsSame(this, thisTime));
 }
Ejemplo n.º 23
0
 public float GetLengthSecond(MiMFa_Time toThisTime)
 {
     return(GetLengthSecond(this, toThisTime));
 }
Ejemplo n.º 24
0
 public bool IsBetween(MiMFa_Time fromthisTime, MiMFa_Time tothisTime)
 {
     return(IsBetween(this, fromthisTime, tothisTime));
 }
Ejemplo n.º 25
0
 public bool Compare(MiMFa_Time thisTime)
 {
     return(Compare(this, thisTime));
 }