예제 #1
0
 public int CompareTo(object obj)
 {
     if (obj is HPTime)
     {
         HPTime other  = (HPTime)obj;
         int    result = this.Hours.CompareTo(other.Hours);
         if (result == 0)
         {
             result = this.Minutes.CompareTo(other.Minutes);
             if (result == 0)
             {
                 result = this.Seconds.CompareTo(other.Seconds);
                 if (result == 0)
                 {
                     result = this.MilliSeconds.CompareTo(other.MilliSeconds);
                     if (result == 0)
                     {
                         return(this.MicroSeconds.CompareTo(other.MicroSeconds));
                     }
                     return(result);
                 }
                 return(result);
             }
             return(result);
         }
         return(result);
     }
     throw new ArgumentException("Object is not HPTime");
 }
예제 #2
0
 public int CompareTo(object obj)
 {
     if (obj is HPTime)
     {
         HPTime other  = (HPTime)obj;
         int    result = this.Hours.CompareTo(other.Hours);
         if (result == 0)
         {
             result = this.Minutes.CompareTo(other.Minutes);
             if (result == 0)
             {
                 result = this.Seconds.CompareTo(other.Seconds);
                 if (result == 0)
                 {
                     result = this.MilliSeconds.CompareTo(other.MilliSeconds);
                     if (result == 0)
                     {
                         return(this.MicroSeconds.CompareTo(other.MicroSeconds));
                     }
                     return(result);
                 }
                 return(result);
             }
             return(result);
         }
         return(result);
     }
     return(1);
 }
예제 #3
0
파일: HPTime.cs 프로젝트: nonomal/NCache
        public HPTime DeepClone(PoolManager poolManager)
        {
            var clonedHPTime = new HPTime();

            clonedHPTime._baseRem  = _baseRem;
            clonedHPTime._baseTime = _baseTime;
            clonedHPTime._hr       = _hr;
            clonedHPTime._micSec   = _micSec;
            clonedHPTime._min      = _min;
            clonedHPTime._mlSec    = _mlSec;
            clonedHPTime._sec      = _sec;

            return(clonedHPTime);
        }
예제 #4
0
 public void Deserialize(CompactReader reader)
 {
     _trace = reader.ReadObject() as string;
     _timeStamp = reader.ReadObject() as HPTime;
 }
예제 #5
0
 public MessageTrace(string trace)
 {
     _trace = trace;
     _timeStamp = HPTime.Now;
 }