/// <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); }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
public IndexChangeArgs(IndexChangeType actionType, IEnumerable <DbAlbum> albums) { ActionType = actionType; ContentType = IndexContentType.Album; Albums = albums; }
public IndexChangeArgs(IndexChangeType actionType, IEnumerable <DbArtist> artists) { ActionType = actionType; ContentType = IndexContentType.Artist; Artists = artists; }
public IndexChangeArgs(IndexChangeType actionType, IEnumerable <DbMediaFile> files) { ActionType = actionType; ContentType = IndexContentType.File; MediaFiles = files; }