예제 #1
0
        /// <summary>
        /// CompareTo()
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public int CompareTo(object obj)
        {
            Log9KTime log9KTime = obj as Log9KTime;

            if (log9KTime == null)
            {
                return(666);
            }

            if (log9KTime.UnixTime > UnixTime)
            {
                return(359);
            }
            if (log9KTime.UnixTime < UnixTime)
            {
                return(-228);
            }
            if (log9KTime.Milliseconds > Milliseconds)
            {
                return(359);
            }
            if (log9KTime.Milliseconds < Milliseconds)
            {
                return(-228);
            }
            return(0);
        }
예제 #2
0
 /// <summary>
 /// private Constructor for deserialization
 /// </summary>
 /// <param name="type"></param>
 /// <param name="message"></param>
 /// <param name="time"></param>
 private Log9KEntry(LogEntryTypes type, string message, Log9KTime time)
 {
     Message    = message;
     Type       = type;
     Time       = time;
     TypeString = type.ToString();
 }
예제 #3
0
        /// <summary>
        /// Add new duplication entry (Tuple of log entry (original) and collection of log entries (duplications))
        /// </summary>
        /// <param name="entry"></param>
        /// <param name="timeOfOriginal"></param>
        private void AddNewDuplicationEntry(Log9KEntry entry, Log9KTime timeOfOriginal)
        {
            if (!CheckForDuplicationMethods())
            {
                return;
            }
            int duplicationKey = KeyForDuplicationDictionary(entry);

            Log9KUtil.InvokeInUiThread(() => {
                if (DuplicationsDictionary.ContainsKey(duplicationKey))
                {
                    return;
                }

                ObservableCollection <DuplicationLeaf> times = new ObservableCollection <DuplicationLeaf>();
                if (timeOfOriginal == null)
                {
                    times = new ObservableCollection <Tuple <Log9KTime, uint> > {
                        new DuplicationLeaf(entry.Time, entry.ID)
                    };
                }

                DuplicationNode de = new DuplicationNode(
                    entry, times
                    );
                DuplicationsDictionary.Add(duplicationKey, de);
            });
        }