/// <summary>
 /// the event handler for AuthorChanged Annotation event
 /// internally it calls the store AnnotationModified delegate
 /// </summary>
 /// <param name="sender">annotation that changed</param>
 /// <param name="args">args describing the change</param>
 private void OnAuthorChanged(object sender, AnnotationAuthorChangedEventArgs args)
 {
     _currentAnnotations[args.Annotation.Id].Dirty = true;
     _authorChanged(sender, args);
 }
Example #2
0
        /// <summary>
        ///     Used as AuthorChanged event handler for all annotations
        ///     handed out by the map. 
        /// </summary>
        /// <param name="sender">annotation that sent the event</param> 
        /// <param name="e">args for the event</param> 
        private void HandleAuthorChanged(object sender, AnnotationAuthorChangedEventArgs e)
        { 
            lock (SyncRoot)
            {
                _dirty = true;
            } 

            OnAuthorChanged(e); 
        } 
        /// <summary>
        ///     Should be called when any annotation's author changes.
        ///     This will fire the AuthorChanged event and cause a flush
        ///     if AutoFlush is true.
        /// </summary>
        /// <param name="args">the args for the event</param>
        protected virtual void OnAuthorChanged(AnnotationAuthorChangedEventArgs args)
        {
            AnnotationAuthorChangedEventHandler authorChanged = null;

            // Ignore null authors added to an annotation
            if (args.Author == null)
                return;

            lock (SyncRoot)
            {
                authorChanged = AuthorChanged;
            }

            if (AutoFlush)
            {
                Flush();
            }

            if (authorChanged != null)
            {
                authorChanged(this, args);
            }
        }
Example #4
0
        //-------------------------------------------------------------------------------
        //
        // Private Methods
        //
        //-------------------------------------------------------------------------------

        #region Private Methods

        // A registered handler for a bubble listening to the annotation author update event.
        //     obj  -   The sender of the event
        //     args -   event arguement
        private void OnAuthorUpdated(object obj, AnnotationAuthorChangedEventArgs args)
        {
            Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation);

            if (!InternalLocker.IsLocked(LockHelper.LockFlag.AnnotationChanged))
            {
                UpdateSNCWithAnnotation(XmlToken.Author);
                IsDirty = true;
            }
        }