コード例 #1
0
 /// <summary>
 /// Takes care of firing the <see cref="IndexChanged" /> event.
 /// </summary>
 /// <param name="document">The affected document.</param>
 /// <param name="change">The change performed.</param>
 /// <param name="changeData">The dumped change data.</param>
 /// <param name="state">A state object that is passed to the IndexStorer SaveDate/DeleteData function.</param>
 /// <returns>The storage result or <c>null</c>.</returns>
 protected IndexStorerResult OnIndexChange(IDocument document, IndexChangeType change, DumpedChange changeData, object state)
 {
     if (IndexChanged != null)
     {
         IndexChangedEventArgs args = new IndexChangedEventArgs(document, change, changeData, state);
         IndexChanged(this, args);
         return(args.Result);
     }
     return(null);
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IndexChangedEventArgs" /> class.
        /// </summary>
        /// <param name="document">The affected document.</param>
        /// <param name="change">The change performed.</param>
        /// <param name="changeData">The dumped change data.</param>
        /// <param name="state">A state object that is passed to the IndexStorer SaveDate/DeleteData function.</param>
        /// <exception cref="ArgumentNullException">If <paramref name="change"/> is not <see cref="IndexChangeType.IndexCleared"/> and <paramref name="document"/> or <paramref name="changeData"/> are <c>null</c>.</exception>
        public IndexChangedEventArgs(IDocument document, IndexChangeType change, DumpedChange changeData, object state)
        {
            if(change != IndexChangeType.IndexCleared) {
                if(document == null) throw new ArgumentNullException("document");
                if(changeData == null) throw new ArgumentNullException("changeData");
            }

            this.document = document;
            this.change = change;
            this.changeData = changeData;
            this.state = state;
        }
コード例 #3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="IndexChangedEventArgs" /> class.
        /// </summary>
        /// <param name="document">The affected document.</param>
        /// <param name="change">The change performed.</param>
        /// <param name="changeData">The dumped change data.</param>
        /// <param name="state">A state object that is passed to the IndexStorer SaveDate/DeleteData function.</param>
        /// <exception cref="ArgumentNullException">
        ///     If <paramref name="change" /> is not
        ///     <see cref="IndexChangeType.IndexCleared" /> and <paramref name="document" /> or <paramref name="changeData" /> are
        ///     <c>null</c>.
        /// </exception>
        public IndexChangedEventArgs(IDocument document, IndexChangeType change, DumpedChange changeData, object state)
        {
            if (change != IndexChangeType.IndexCleared)
            {
                if (document == null)
                {
                    throw new ArgumentNullException("document");
                }
                if (changeData == null)
                {
                    throw new ArgumentNullException("changeData");
                }
            }

            Document   = document;
            Change     = change;
            ChangeData = changeData;
            State      = state;
        }
コード例 #4
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="IndexChangedEventArgs" /> class.
 /// </summary>
 /// <param name="document">The affected document.</param>
 /// <param name="change">The change performed.</param>
 /// <param name="changeData">The dumped change data.</param>
 /// <param name="state">A state object that is passed to the IndexStorer SaveDate/DeleteData function.</param>
 /// <param name="result">The storer result, if any.</param>
 /// <exception cref="ArgumentNullException">
 ///     If <paramref name="change" /> is not
 ///     <see cref="IndexChangeType.IndexCleared" /> and <paramref name="document" /> or <paramref name="changeData" /> are
 ///     <c>null</c>.
 /// </exception>
 public IndexChangedEventArgs(IDocument document, IndexChangeType change, DumpedChange changeData, object state,
                              IndexStorerResult result)
     : this(document, change, changeData, state)
 {
     Result = result;
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IndexChangedEventArgs" /> class.
 /// </summary>
 /// <param name="document">The affected document.</param>
 /// <param name="change">The change performed.</param>
 /// <param name="changeData">The dumped change data.</param>
 /// <param name="state">A state object that is passed to the IndexStorer SaveDate/DeleteData function.</param>
 /// <param name="result">The storer result, if any.</param>
 /// <exception cref="ArgumentNullException">If <paramref name="change"/> is not <see cref="IndexChangeType.IndexCleared"/> and <paramref name="document"/> or <paramref name="changeData"/> are <c>null</c>.</exception>
 public IndexChangedEventArgs(IDocument document, IndexChangeType change, DumpedChange changeData, object state, IndexStorerResult result)
     : this(document, change, changeData, state)
 {
     this.result = result;
 }
コード例 #6
0
 /// <summary>
 /// Takes care of firing the <see cref="IndexChanged" /> event.
 /// </summary>
 /// <param name="document">The affected document.</param>
 /// <param name="change">The change performed.</param>
 /// <param name="changeData">The dumped change data.</param>
 /// <param name="state">A state object that is passed to the IndexStorer SaveDate/DeleteData function.</param>
 /// <returns>The storage result or <c>null</c>.</returns>
 protected IndexStorerResult OnIndexChange(IDocument document, IndexChangeType change, DumpedChange changeData, object state)
 {
     if(IndexChanged != null) {
         IndexChangedEventArgs args = new IndexChangedEventArgs(document, change, changeData, state);
         IndexChanged(this, args);
         return args.Result;
     }
     else return null;
 }
コード例 #7
0
 public IndexChangeArgs(IndexChangeType actionType, IEnumerable <DbAlbum> albums)
 {
     ActionType  = actionType;
     ContentType = IndexContentType.Album;
     Albums      = albums;
 }
コード例 #8
0
 public IndexChangeArgs(IndexChangeType actionType, IEnumerable <DbArtist> artists)
 {
     ActionType  = actionType;
     ContentType = IndexContentType.Artist;
     Artists     = artists;
 }
コード例 #9
0
 public IndexChangeArgs(IndexChangeType actionType, IEnumerable <DbMediaFile> files)
 {
     ActionType  = actionType;
     ContentType = IndexContentType.File;
     MediaFiles  = files;
 }