Ejemplo n.º 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);
            }
Ejemplo n.º 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));
            }
Ejemplo n.º 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, 0, 0, null, null, null, null);
 }
Ejemplo n.º 4
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, 0, 0, null, null, null, null);
		}