Example #1
0
        /// <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);
            }
        }
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        #region Constructors

        /// <summary>
        /// Constructor for StoreAnnotationsMap 
        /// It takes instances of the AnnotationAuthorChangedEventHandler, AnnotationResourceChangedEventHandler, AnnotationResourceChangedEventHandler delegates
        /// </summary>
        /// <param name="authorChanged">delegate used to register for AuthorChanged events on all annotations</param>
        /// <param name="anchorChanged">delegate used to register for AnchorChanged events on all annotations</param>
        /// <param name="cargoChanged">delegate used to register for CargoChanged events on all annotations</param>
        internal StoreAnnotationsMap(AnnotationAuthorChangedEventHandler authorChanged, AnnotationResourceChangedEventHandler anchorChanged, AnnotationResourceChangedEventHandler cargoChanged)
        {
            Debug.Assert(authorChanged != null && anchorChanged != null && cargoChanged != null,
                         "Author and Anchor and Cargo must not be null");

            _authorChanged = authorChanged;
            _anchorChanged = anchorChanged;
            _cargoChanged = cargoChanged;
        }
Example #3
0
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        #region Constructors

        /// <summary>
        /// Constructor for StoreAnnotationsMap
        /// It takes instances of the AnnotationAuthorChangedEventHandler, AnnotationResourceChangedEventHandler, AnnotationResourceChangedEventHandler delegates
        /// </summary>
        /// <param name="authorChanged">delegate used to register for AuthorChanged events on all annotations</param>
        /// <param name="anchorChanged">delegate used to register for AnchorChanged events on all annotations</param>
        /// <param name="cargoChanged">delegate used to register for CargoChanged events on all annotations</param>
        internal StoreAnnotationsMap(AnnotationAuthorChangedEventHandler authorChanged, AnnotationResourceChangedEventHandler anchorChanged, AnnotationResourceChangedEventHandler cargoChanged)
        {
            Debug.Assert(authorChanged != null && anchorChanged != null && cargoChanged != null,
                         "Author and Anchor and Cargo must not be null");

            _authorChanged = authorChanged;
            _anchorChanged = anchorChanged;
            _cargoChanged  = cargoChanged;
        }
        /// <summary>Raises the <see cref="E:System.Windows.Annotations.Storage.AnnotationStore.AuthorChanged" /> event.</summary>
        /// <param name="args">The event data.</param>
        // Token: 0x0600635D RID: 25437 RVA: 0x001BF150 File Offset: 0x001BD350
        protected virtual void OnAuthorChanged(AnnotationAuthorChangedEventArgs args)
        {
            AnnotationAuthorChangedEventHandler annotationAuthorChangedEventHandler = null;

            if (args.Author == null)
            {
                return;
            }
            object syncRoot = this.SyncRoot;

            lock (syncRoot)
            {
                annotationAuthorChangedEventHandler = this.AuthorChanged;
            }
            if (this.AutoFlush)
            {
                this.Flush();
            }
            if (annotationAuthorChangedEventHandler != null)
            {
                annotationAuthorChangedEventHandler(this, args);
            }
        }
Example #5
0
 // Token: 0x06007BBA RID: 31674 RVA: 0x0022C0E2 File Offset: 0x0022A2E2
 internal StoreAnnotationsMap(AnnotationAuthorChangedEventHandler authorChanged, AnnotationResourceChangedEventHandler anchorChanged, AnnotationResourceChangedEventHandler cargoChanged)
 {
     this._authorChanged = authorChanged;
     this._anchorChanged = anchorChanged;
     this._cargoChanged  = cargoChanged;
 }