// Token: 0x0600627B RID: 25211 RVA: 0x001BA454 File Offset: 0x001B8654
 private void FireAuthorEvent(object author, AnnotationAction action)
 {
     Invariant.Assert(action >= AnnotationAction.Added && action <= AnnotationAction.Modified, "Unknown AnnotationAction");
     this._modified = DateTime.Now;
     if (this.AuthorChanged != null)
     {
         this.AuthorChanged(this, new AnnotationAuthorChangedEventArgs(this, action, author));
     }
 }
 // Token: 0x0600627C RID: 25212 RVA: 0x001BA4A0 File Offset: 0x001B86A0
 private void FireResourceEvent(AnnotationResource resource, AnnotationAction action, AnnotationResourceChangedEventHandler handlers)
 {
     Invariant.Assert(action >= AnnotationAction.Added && action <= AnnotationAction.Modified, "Unknown AnnotationAction");
     this._modified = DateTime.Now;
     if (handlers != null)
     {
         handlers(this, new AnnotationResourceChangedEventArgs(this, action, resource));
     }
 }
        /// <summary>
        ///     Fires an AuthorChanged event for the given author and action.
        /// </summary>
        /// <param name="author">the author to notify about</param>
        /// <param name="action">the action that took place for that author</param>
        private void FireAuthorEvent(Object author, AnnotationAction action)
        {
            // 'author' can be null because null authors are allowed in the collection
            Invariant.Assert(action >= AnnotationAction.Added && action <= AnnotationAction.Modified, "Unknown AnnotationAction");

            // Always update the modification time before firing change events
            _modified = DateTime.Now;

            if (AuthorChanged != null)
            {
                AuthorChanged(this, new AnnotationAuthorChangedEventArgs(this, action, author));
            }
        }
        /// <summary>
        ///     Fires a ResourceChanged event for the given resource and action.
        /// </summary>
        /// <param name="resource">the resource to notify about</param>
        /// <param name="action">the action that took place for that resource</param>
        /// <param name="handlers">the handlers to notify</param>
        private void FireResourceEvent(AnnotationResource resource, AnnotationAction action, AnnotationResourceChangedEventHandler handlers)
        {
            // resource can be null - we allow that because it could be added or removed from the annotation.
            Invariant.Assert(action >= AnnotationAction.Added && action <= AnnotationAction.Modified, "Unknown AnnotationAction");

            // Always update the modification time before firing change events
            _modified = DateTime.Now;

            if (handlers != null)
            {
                handlers(this, new AnnotationResourceChangedEventArgs(this, action, resource));
            }
        }
 /// <summary> Initializes a new instance of the <see cref="T:System.Windows.Annotations.AnnotationAuthorChangedEventArgs" /> class. </summary>
 /// <param name="annotation">The annotation raising the event.</param>
 /// <param name="action">The author operation performed: <see cref="F:System.Windows.Annotations.AnnotationAction.Added" />, <see cref="F:System.Windows.Annotations.AnnotationAction.Removed" />, or <see cref="F:System.Windows.Annotations.AnnotationAction.Modified" />.</param>
 /// <param name="author">The author object being changed by the event.</param>
 /// <exception cref="T:System.ArgumentNullException">
 ///         <paramref name="annotation" /> or <paramref name="action" /> is a null reference (Nothing in Visual Basic).</exception>
 /// <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
 ///         <paramref name="action" /> is an invalid <see cref="T:System.Windows.Annotations.AnnotationAction" />.</exception>
 // Token: 0x06006283 RID: 25219 RVA: 0x001BA58C File Offset: 0x001B878C
 public AnnotationAuthorChangedEventArgs(Annotation annotation, AnnotationAction action, object author)
 {
     if (annotation == null)
     {
         throw new ArgumentNullException("annotation");
     }
     if (action < AnnotationAction.Added || action > AnnotationAction.Modified)
     {
         throw new InvalidEnumArgumentException("action", (int)action, typeof(AnnotationAction));
     }
     this._annotation = annotation;
     this._author     = author;
     this._action     = action;
 }
Пример #6
0
 /// <summary>Initializes a new instance of the <see cref="M:System.Windows.Annotations.AnnotationResourceChangedEventArgs.#ctor(System.Windows.Annotations.Annotation,System.Windows.Annotations.AnnotationAction,System.Windows.Annotations.AnnotationResource)" /> class.</summary>
 /// <param name="annotation">The annotation that raised the event.</param>
 /// <param name="action">The action of the event.</param>
 /// <param name="resource">The <see cref="P:System.Windows.Annotations.Annotation.Anchors" /> or <see cref="P:System.Windows.Annotations.Annotation.Cargos" /> resource of the event.</param>
 /// <exception cref="T:System.ArgumentNullException">
 ///         <paramref name="annotation" /> or <paramref name="action" /> is <see langword="null" />.</exception>
 /// <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
 ///         <paramref name="action" /> is not a valid <see cref="T:System.Windows.Annotations.AnnotationAction" /> value.</exception>
 // Token: 0x060062B7 RID: 25271 RVA: 0x001BB128 File Offset: 0x001B9328
 public AnnotationResourceChangedEventArgs(Annotation annotation, AnnotationAction action, AnnotationResource resource)
 {
     if (annotation == null)
     {
         throw new ArgumentNullException("annotation");
     }
     if (action < AnnotationAction.Added || action > AnnotationAction.Modified)
     {
         throw new InvalidEnumArgumentException("action", (int)action, typeof(AnnotationAction));
     }
     this._annotation = annotation;
     this._resource   = resource;
     this._action     = action;
 }
        private void OnAuthorsChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            AnnotationAction action       = AnnotationAction.Added;
            IList            changedItems = null;

            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                action       = AnnotationAction.Added;
                changedItems = e.NewItems;
                break;

            case NotifyCollectionChangedAction.Remove:
                action       = AnnotationAction.Removed;
                changedItems = e.OldItems;
                break;

            case NotifyCollectionChangedAction.Replace:
                // For Replace we need to fire removes and adds.  As in other
                // event firing code - if a listener for one event throws the
                // rest of the events won't be fired.
                foreach (string author in e.OldItems)
                {
                    FireAuthorEvent(author, AnnotationAction.Removed);
                }
                changedItems = e.NewItems;
                break;

            case NotifyCollectionChangedAction.Move:
                // ignore - this only happens on sort
                break;

            case NotifyCollectionChangedAction.Reset:
                // ignore - this only happens on sort
                break;

            default:
                throw new NotSupportedException(SR.Get(SRID.UnexpectedCollectionChangeAction, e.Action));
            }

            if (changedItems != null)
            {
                foreach (Object author in changedItems)
                {
                    FireAuthorEvent(author, action);
                }
            }
        }
        // Token: 0x06006279 RID: 25209 RVA: 0x001BA218 File Offset: 0x001B8418
        private void OnAnchorsChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            AnnotationAction action = AnnotationAction.Added;
            IList            list   = null;

            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                action = AnnotationAction.Added;
                list   = e.NewItems;
                break;

            case NotifyCollectionChangedAction.Remove:
                action = AnnotationAction.Removed;
                list   = e.OldItems;
                break;

            case NotifyCollectionChangedAction.Replace:
                foreach (object obj in e.OldItems)
                {
                    AnnotationResource resource = (AnnotationResource)obj;
                    this.FireResourceEvent(resource, AnnotationAction.Removed, this.AnchorChanged);
                }
                list = e.NewItems;
                break;

            case NotifyCollectionChangedAction.Move:
            case NotifyCollectionChangedAction.Reset:
                break;

            default:
                throw new NotSupportedException(SR.Get("UnexpectedCollectionChangeAction", new object[]
                {
                    e.Action
                }));
            }
            if (list != null)
            {
                foreach (object obj2 in list)
                {
                    AnnotationResource resource2 = (AnnotationResource)obj2;
                    this.FireResourceEvent(resource2, action, this.AnchorChanged);
                }
            }
        }
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        #region Constructors

        /// <summary>
        ///     Creates an instance of AuthorChangedEventArgs.
        /// </summary>
        /// <param name="annotation">the Annotation firing the event</param>
        /// <param name="action">the action taken on the Author</param>
        /// <param name="author">the Author that was changed</param>
        /// <exception cref="ArgumentNullException">annotation is null</exception>
        /// <exception cref="InvalidEnumArgumentException">action is not a valid value from AnnotationAction</exception>
        public AnnotationAuthorChangedEventArgs(Annotation annotation, AnnotationAction action, Object author)
        {
            // The author parameter can be null here - it is possible to add a null to
            // the list of authors and we must fire an event signalling a change in the collection.

            if (annotation == null)
            {
                throw new ArgumentNullException("annotation");
            }
            if (action < AnnotationAction.Added || action > AnnotationAction.Modified)
            {
                throw new InvalidEnumArgumentException("action", (int)action, typeof(AnnotationAction));
            }

            _annotation = annotation;
            _author     = author;
            _action     = action;
        }
        // Token: 0x0600627A RID: 25210 RVA: 0x001BA340 File Offset: 0x001B8540
        private void OnAuthorsChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            AnnotationAction action = AnnotationAction.Added;
            IList            list   = null;

            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                action = AnnotationAction.Added;
                list   = e.NewItems;
                break;

            case NotifyCollectionChangedAction.Remove:
                action = AnnotationAction.Removed;
                list   = e.OldItems;
                break;

            case NotifyCollectionChangedAction.Replace:
                foreach (object obj in e.OldItems)
                {
                    string author = (string)obj;
                    this.FireAuthorEvent(author, AnnotationAction.Removed);
                }
                list = e.NewItems;
                break;

            case NotifyCollectionChangedAction.Move:
            case NotifyCollectionChangedAction.Reset:
                break;

            default:
                throw new NotSupportedException(SR.Get("UnexpectedCollectionChangeAction", new object[]
                {
                    e.Action
                }));
            }
            if (list != null)
            {
                foreach (object author2 in list)
                {
                    this.FireAuthorEvent(author2, action);
                }
            }
        }
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        #region Constructors

        /// <summary>
        ///     Creates an instance of AuthorChangedEventArgs.
        /// </summary>
        /// <param name="annotation">the Annotation firing the event</param>
        /// <param name="action">the action taken on the Author</param>
        /// <param name="author">the Author that was changed</param>
        /// <exception cref="ArgumentNullException">annotation is null</exception>
        /// <exception cref="InvalidEnumArgumentException">action is not a valid value from AnnotationAction</exception>
        public AnnotationAuthorChangedEventArgs(Annotation annotation, AnnotationAction action, Object author)
        {
            
            // The author parameter can be null here - it is possible to add a null to
            // the list of authors and we must fire an event signalling a change in the collection.

            if (annotation == null)
            {
                throw new ArgumentNullException("annotation");
            }
            if (action < AnnotationAction.Added || action > AnnotationAction.Modified)
            {
                throw new InvalidEnumArgumentException("action", (int)action, typeof(AnnotationAction));
            }

            _annotation = annotation;
            _author = author;
            _action = action;
        }
 public AnnotationAuthorChangedEventArgs(Annotation annotation, AnnotationAction action, Object author)
 {
 }
Пример #13
0
        /// <summary>
        ///     Fires a ResourceChanged event for the given resource and action.
        /// </summary>
        /// <param name="resource">the resource to notify about</param>
        /// <param name="action">the action that took place for that resource</param>
        /// <param name="handlers">the handlers to notify</param>
        private void FireResourceEvent(AnnotationResource resource, AnnotationAction action, AnnotationResourceChangedEventHandler handlers)
        {
            // resource can be null - we allow that because it could be added or removed from the annotation.
            Invariant.Assert(action >= AnnotationAction.Added && action <= AnnotationAction.Modified, "Unknown AnnotationAction");

            // Always update the modification time before firing change events
            _modified = DateTime.Now;

            if (handlers != null)
            {
                handlers(this, new AnnotationResourceChangedEventArgs(this, action, resource));
            }
        }
Пример #14
0
        /// <summary>
        ///     Fires an AuthorChanged event for the given author and action.
        /// </summary>
        /// <param name="author">the author to notify about</param>
        /// <param name="action">the action that took place for that author</param>
        private void FireAuthorEvent(Object author, AnnotationAction action)
        {
            // 'author' can be null because null authors are allowed in the collection
            Invariant.Assert(action >= AnnotationAction.Added && action <= AnnotationAction.Modified, "Unknown AnnotationAction");

            // Always update the modification time before firing change events
            _modified = DateTime.Now;

            if (AuthorChanged != null)
            {
                AuthorChanged(this, new AnnotationAuthorChangedEventArgs(this, action, author));
            }
        }
 public AnnotationAuthorChangedEventArgs(Annotation annotation, AnnotationAction action, Object author)
 {
 }
 public AnnotationResourceChangedEventArgs(Annotation annotation, AnnotationAction action, AnnotationResource resource)
 {
 }
 public AnnotationResourceChangedEventArgs(Annotation annotation, AnnotationAction action, AnnotationResource resource)
 {
 }