Esempio n. 1
0
        /// <summary>
        /// Find an annottaion that has a specific id in the map
        /// returns null if not found
        /// </summary>
        /// <param name="id">id of the annotation to find</param>
        public Annotation FindAnnotation(Guid id)
        {
            CachedAnnotation cachedAnnotation = null;

            if (_currentAnnotations.TryGetValue(id, out cachedAnnotation))
            {
                return(cachedAnnotation.Annotation);
            }

            return(null);
        }
Esempio n. 2
0
        /// <summary>
        /// remove an annotation from the map if it exists
        /// otherwise return
        /// </summary>
        /// <param name="id">id of the annotation to remove</param>
        public void RemoveAnnotation(Guid id)
        {
            CachedAnnotation existingCachedAnnot = null;

            if (_currentAnnotations.TryGetValue(id, out existingCachedAnnot))
            {
                existingCachedAnnot.Annotation.AuthorChanged -= OnAuthorChanged;
                existingCachedAnnot.Annotation.AnchorChanged -= OnAnchorChanged;
                existingCachedAnnot.Annotation.CargoChanged  -= OnCargoChanged;
                _currentAnnotations.Remove(id);
            }
        }