/// <summary> /// Creates a diffing engine which will perform a comparison of the control and test sources, using the provided strategies. /// </summary> public HtmlDifferenceEngine(IDiffingStrategy diffingStrategy, SourceCollection controlSources, SourceCollection testSources) { _diffingStrategy = diffingStrategy ?? throw new ArgumentNullException(nameof(diffingStrategy)); _controlSources = controlSources ?? throw new ArgumentNullException(nameof(controlSources)); _testSources = testSources ?? throw new ArgumentNullException(nameof(testSources)); Context = new DiffContext(controlSources, testSources); }
/// <summary> /// Creates a <see cref="HtmlDiffer"/> with the provided strategy. /// </summary> /// <param name="diffingStrategy"></param> public HtmlDiffer(IDiffingStrategy diffingStrategy) { _diffingStrategy = diffingStrategy ?? throw new ArgumentNullException(nameof(diffingStrategy)); var config = Configuration.Default.WithCss(); _context = BrowsingContext.New(config); _htmlParser = _context.GetService <IHtmlParser>(); _document = _context.OpenNewAsync().Result; }
/// <summary> /// Creates a <see cref="HtmlDiffer"/> with the provided strategy. /// </summary> /// <param name="diffingStrategy"></param> public HtmlDiffer(IDiffingStrategy diffingStrategy) { _diffingStrategy = diffingStrategy ?? throw new ArgumentNullException(nameof(diffingStrategy)); var config = Configuration.Default.WithCss(); _context = BrowsingContext.New(config); _htmlParser = _context.GetService <IHtmlParser>() ?? throw new InvalidOperationException("No IHtmlParser registered in the default AngleSharp browsing context."); _document = _context.OpenNewAsync().Result; }
public SimpleAdapter(int layoutId, Func <View, BaseRecyclerViewHolder <T> > createViewHolder, IDiffingStrategy <T> diffingStrategy = null) : base(diffingStrategy) { Ensure.Argument.IsNotNull(createViewHolder, nameof(createViewHolder)); this.layoutId = layoutId; this.createViewHolder = createViewHolder; }
public BaseDiffCallBack(IList <T> oldItems, IList <T> newItems, IDiffingStrategy <T> diffingStrategy) { this.oldItems = oldItems; this.newItems = newItems; this.diffingStrategy = diffingStrategy; }