예제 #1
0
        /// --------------------------------------------------------------------------------
        /// <summary>
        /// Compares times to nearest second.
        /// </summary>
        /// --------------------------------------------------------------------------------
        private bool ApproximatelyEqualTimes(ScrNoteKey key)
        {
            if (m_dateCreated.Ticks == 0 || key.m_dateCreated.Ticks == 0)
            {
                return(true);
            }

            return(m_dateCreated.Ticks / TICKS_TO_SECONDS ==
                   key.m_dateCreated.Ticks / TICKS_TO_SECONDS);
        }
예제 #2
0
        /// --------------------------------------------------------------------------------
        /// <summary>
        /// Indicates whether this instance and a specified object are equal.
        /// </summary>
        /// <param name="obj">Another object to compare to.</param>
        /// <returns>
        /// true if <paramref name="obj"/> and this instance are the same type and represent
        /// the same value; otherwise, false.
        /// </returns>
        /// --------------------------------------------------------------------------------
        public override bool Equals(object obj)
        {
            if (obj == null || !(obj is ScrNoteKey))
            {
                return(false);
            }

            ScrNoteKey key = (ScrNoteKey)obj;

            return(m_guidAnnotationType == key.m_guidAnnotationType &&
                   m_sDiscussionPara1 == key.m_sDiscussionPara1 &&
                   m_sQuotePara1 == key.m_sQuotePara1 &&
                   m_sRecommendationPara1 == key.m_sRecommendationPara1 &&
                   m_startReference == key.m_startReference &&
                   m_endReference == key.m_endReference &&
                   ApproximatelyEqualTimes(key));
        }
예제 #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes the note.
		/// </summary>
		/// <param name="info">The note key with basic info about the annotation.</param>
		/// <param name="beginObj">beginning object note refers to</param>
		/// <param name="endObj">ending object note refers to</param>
		/// ------------------------------------------------------------------------------------
		public void InitializeNote(ScrNoteKey info, ICmObject beginObj, ICmObject endObj)
		{
			InitializeNote(info.GuidAnnotationType, info.StartReference, info.EndReference,
				beginObj, endObj, -1, 0, 0, null, null, null, null);
		}
예제 #4
0
			/// --------------------------------------------------------------------------------
			/// <summary>
			/// Compares times to nearest second.
			/// </summary>
			/// --------------------------------------------------------------------------------
			private bool ApproximatelyEqualTimes(ScrNoteKey key)
			{
				if (m_dateCreated.Ticks == 0 || key.m_dateCreated.Ticks == 0)
					return true;

				return m_dateCreated.Ticks / TICKS_TO_SECONDS ==
					key.m_dateCreated.Ticks / TICKS_TO_SECONDS;
			}