public AggregatedDispatchable(IContainerProvider container, IOrderDispatcher orderDispatcher, IOrder rootOrder, IEnumerable <IOrder> orders) { this.container = container; this.orderDispatcher = orderDispatcher; this.rootOrder = rootOrder; this.orders = orders.ToArray(); }
public void Setup() { ordereRepositoryMock = MockRepository.GenerateMock <IOrderRepository>(); outgoingQueueMock = MockRepository.GenerateMock <IOutgoingQueue>(); dateServiceMock = MockRepository.GenerateMock <IDateService>(); orderDispatcherMock = MockRepository.GenerateMock <IOrderDispatcher>(); serializer = new ProtobufSerializer(); }
public IncomingMessageProcessor(IOrderRepository ordeRepository, IOutgoingQueue outgoingQueue, IDateService dateService, IOrderDispatcher dispatcher, ISerializer serializer) { this.ordeRepository = ordeRepository; this.outgoingQueue = outgoingQueue; this.dateService = dateService; this.dispatcher = dispatcher; this.serializer = serializer; queueBuffer = new byte[512]; }
public IncomingMessageProcessor(IOrderRepository ordeRepository, IOutgoingQueue outgoingQueue, IDateService dateService, IOrderDispatcher dispatcher, ISerializer serializer) { this.ordeRepository = ordeRepository; this.outgoingQueue = outgoingQueue; this.dateService = dateService; this.dispatcher = dispatcher; this.serializer = serializer; queueBuffer = new byte[512]; }
public OrderDispatchable(IContainerProvider container, IOrderDispatcher orderDispatcher, IOrder order) { this.container = container; this.orderDispatcher = orderDispatcher; this.order = order; }
public OrderBuilder(IContainerProvider container) { this.container = container; this.orderDispatcher = container.Resolve <IOrderDispatcher>(); }
public static Bitmap GetMultiImage(Bitmap image, Size partsDim, Size SizePartImageInOut, Size SizeToCompare, List <ImageUrl> imageUrls, IOrderDispatcher <PartImage> parts) { List <LogicAndImage <ImageToCompare, ImageUrl> > list = new List <LogicAndImage <ImageToCompare, ImageUrl> >(); Func <Bitmap> Geter(LogicAndImage <ImageToCompare, PartImage> arg) { long MinDifrent = long.MaxValue; LogicAndImage <ImageToCompare, ImageUrl> Best = null; foreach (var item in list) { long CurentDistance; if (MinDifrent > (CurentDistance = item.Logic.GetDifrent(arg.Logic))) { Best = item; MinDifrent = CurentDistance; } } return(() => Best.Bitmap.Bitmap(SizePartImageInOut)); } list.AddRange(imageUrls.AsParallel().Select(X => new LogicAndImage <ImageToCompare, ImageUrl>() { Bitmap = X, Logic = new ImageToCompare(X.Bitmap(SizeToCompare), SizeToCompare, true) })); return(GetMultiImage(image, partsDim, SizePartImageInOut, SizeToCompare, Geter, new BasicOrder <PartImage>())); }
public static Bitmap GetMultiImage(Bitmap image, Size partsDim, Size SizePartImageInOut, Size SizeToCompare, Func <LogicAndImage <ImageToCompare, PartImage>, Func <Bitmap> > PartImageFunc, IOrderDispatcher <PartImage> parts) { Size partSizeInImage; PartImage[] partImage = PartImage.GetPartImageDim(image, partsDim, out partSizeInImage); Dictionary <PartImage, Func <Bitmap> > BitmapDictionary = new Dictionary <PartImage, Func <Bitmap> >(); List <(LogicAndImage <ImageToCompare, PartImage> part, Func <Bitmap> bitmapFunc)> x = (parts.GetItemWitchOrder(partsDim, partImage).AsParallel().Select(X =>//[pobieranie fragmentów new LogicAndImage <ImageToCompare, PartImage>() { Bitmap = X, Logic = new ImageToCompare((Bitmap)X, SizeToCompare) } ).ToList().AsParallel(). // Dołączenie do fragmentów danych o wektorach Select(X => (X, PartImageFunc(X))).ToList()); //obliczenie najbarddziej podobnych obrazów x.ForEach(X => BitmapDictionary.Add(X.part.Bitmap, X.bitmapFunc)); Bitmap zw = MargeImage(partsDim, SizePartImageInOut, partSizeInImage, partImage, BitmapDictionary); return(zw); }