public static void LoadModules(IRouting routing) { new ClientController(null, null, null, null, null, null); new ZNxtUserRDBService(null, null, null, null, null, null); routing.PushAssemblyRoute(typeof(ClientController).Assembly); Console.WriteLine("Loading modules .... "); }
public static IFilePath AsFilePath(this string pathString) { IRouting routing = Path.IsPathRooted(pathString) ? new AbsoluteRoute() : new RelativeRoute(); return(AsFilePath(pathString, routing)); }
public static void Verify(this IRouting routing, IModel model) { if (_declaredExchanges.Contains(routing.ExchangeName)) { return; } model.ExchangeDeclarePassive(routing.ExchangeName); _declaredExchanges.Add(routing.ExchangeName); }
protected override Size MeasureOverride(Size constraint) { base.MeasureOverride(constraint); Size availableSize = new Size(double.PositiveInfinity, double.PositiveInfinity); double maxHeight = 0; double maxWidth = 0; double left; double top; foreach (UIElement element in base.InternalChildren) { if (element != null) { element.Measure(availableSize); if (element is IRouting) { IRouting b = (IRouting)element; left = b.Position.X; top = b.Position.Y; left += element.DesiredSize.Width; top += element.DesiredSize.Height; maxWidth = maxWidth < left ? left : maxWidth; maxHeight = maxHeight < top ? top : maxHeight; if (element is TextVisual || element is ImageVisual) { Canvas.SetZIndex(element, -2); } } else { left = element.DesiredSize.Width; top = element.DesiredSize.Height; maxWidth = maxWidth < left ? left : maxWidth; maxHeight = maxHeight < top ? top : maxHeight; } //element.InvalidateArrange(); } } //Possible performance improvement var list = zPaneOrderCollection.ToList(); foreach (var order in list) { int i = order.ZIndex = list.IndexOf(order); Panel.SetZIndex((UIElement)order, i); } return(new Size { Height = maxHeight, Width = maxWidth }); }
public static IDirectoryPath AsDirectoryPath(this string pathString) { IRouting routing = Path.IsPathRooted(pathString) ? new AbsoluteRoute() : new RelativeRoute(); // パス末尾にスラッシュが無ければ、それを付与したものをディレクトリパスとして扱う if (!Path.EndsInDirectorySeparator(pathString)) { pathString += Path.DirectorySeparatorChar; } return(routing.GetDirectoryPath(pathString)); }
public ModuleInstaller(IDBService dbService, IHttpFileUploader httpFileUploader, IKeyValueStorage keyValueStorage, IServiceResolver serviceResolver, IResponseBuilder responseBuilder, IHttpContextProxy httpContextProxy, IDBServiceConfig dbConfig, ILogger logger, IRouting routing, IApiGatewayService apiGateway) { _responseBuilder = responseBuilder; _dbService = dbService; _httpContextProxy = httpContextProxy; _dbConfig = dbConfig; _serviceResolver = serviceResolver; _keyValueStorage = keyValueStorage; _httpFileUploader = httpFileUploader; _logger = logger; _routing = routing; _apiGateway = apiGateway; _moduleInstallationKey = CommonUtility.GetAppConfigValue(CommonConst.CommonValue.APP_SECRET_CONFIG_KEY).Sha256Hash(); }
public SubscriberMessage(IModel channel, ISubscriberSerializer serializer, ulong deliveryTag, IRouting routing, IBasicProperties properties, ReadOnlyMemory <byte> body) { Routing = routing; _channel = channel; lock (ChannelSyncState.Sync) { _channel.ConfirmSelect(); } _serializer = serializer; _deliveryTag = deliveryTag; _body = body; _properties = properties; }
public ApiHandler(RequestDelegate next, ILogger logger, IDBService dbService, IRouting routing, IHttpContextProxy httpContextProxy, IAssemblyLoader assemblyLoader, IServiceResolver serviceResolver, IResponseBuilder responseBuilder, IApiGatewayService apiGatewayService, IInMemoryCacheService inMemoryCacheService, IOAuthClientService oAuthClientService) { _next = next; _routing = routing; _dbService = dbService; _httpContextProxy = httpContextProxy; _assemblyLoader = assemblyLoader; _serviceResolver = serviceResolver; _logger = logger; _responseBuilder = responseBuilder; _apiGatewayService = apiGatewayService; _inMemoryCacheService = inMemoryCacheService; _oAuthClientService = oAuthClientService; }
public void Load() { Router router = SelectObject.SelectedObject.GetComponent <Router>(); IRouting <Connection> routingStrategy = router.RoutingStrategy; if (routingStrategy is RandomRouting) { RoutingDropdown.value = 0; RoutingDropdown.captionText.text = "Random"; } else if (routingStrategy is RoundRobinRouting <Connection> ) { RoutingDropdown.value = 1; RoutingDropdown.captionText.text = "Round Robin"; } }
public static IFilePath AsFilePath(this string pathString, IRouting routing) { // パス末尾のスラッシュなどがあれば、それを外したものをファイルパスとして扱う if (Path.EndsInDirectorySeparator(pathString)) { pathString.TrimEnd(Path.DirectorySeparatorChar); } if (!Path.HasExtension(pathString)) { return(routing.GetFilePath(pathString)); } var baseName = Path.GetFileNameWithoutExtension(pathString); var ext = new FileExtension(Path.GetExtension(pathString)); return(routing.GetFilePathWithExtension(baseName, ext)); }
public PublisherMessage( IPublisher publisher, object message, IPublisherSerializer serializer, IRouting routing, string correlationId = default, CancellationToken cancellationToken = default) { CreatedAt = DateTime.UtcNow; Routing = routing ?? throw new ArgumentNullException(nameof(routing)); CancellationToken = cancellationToken; Publisher = publisher ?? throw new ArgumentNullException(nameof(publisher)); _serializer = serializer ?? throw new ArgumentNullException(nameof(serializer)); CorrelationId = correlationId ?? Guid.NewGuid().ToString(); _message = message; _headers = new Dictionary <string, object> { { nameof(Routing.ExchangeName), Routing.ExchangeName }, { nameof(Routing.RoutingKey), Routing.RoutingKey }, { "SerializerType", serializer.GetType().FullName }, { "CreatedAt", CreatedAt.ToString("s") } }; }
public CronServiceBase(ParamContainer paramContainer) : base(paramContainer) { Routings = (IRouting)paramContainer.GetKey(CommonConst.CommonValue.PARAM_ROUTING_OBJECT); }
public InstallRemoteData(IDBService dbService, IHttpFileUploader httpFileUploader, IKeyValueStorage keyValueStorage, IServiceResolver serviceResolver, IResponseBuilder responseBuilder, IHttpContextProxy httpContextProxy, IDBServiceConfig dbConfig, ILogger logger, IRouting routing, IApiGatewayService apiGateway) { _responseBuilder = responseBuilder; _dbService = dbService; _httpContextProxy = httpContextProxy; _dbConfig = dbConfig; _serviceResolver = serviceResolver; _keyValueStorage = keyValueStorage; _httpFileUploader = httpFileUploader; _logger = logger; }
public RouteGenerator(IRouting routing, IControllerFinder controllerFinder, IActionFinder actionFinder) { _routing = routing; _actionFinder = actionFinder; _controllerFinder = controllerFinder; }
public Reliability(List <AlgorithmParameters> parameters, IRouting algorithm_router, IRouting brute_router) { _parameters = parameters; _algorithm_router = algorithm_router; _brute_router = brute_router; }
private void makeOrthogonalPoints() { bool failed = false; if (!IsEditingPoint) { if (!isSubstituteLine && !IsDragged && !HasComputed && !loaded) { List <Node> nodeList = new List <Node>(); FrameworkElement parent = Model.WorkspaceModel.MyEditor.Presentation; // add start and end. Index will be 0 and 1 Node startNode = new Node() { Point = LineUtil.Cheat42(StartPoint, StartPointSource, 1) }, endNode = new Node() { Point = LineUtil.Cheat42(EndPoint, EndPointSource, -1) }; nodeList.Add(startNode); nodeList.Add(endNode); QuadTreeLib.QuadTree <FakeNode> quadTreePlugins = helper.PluginTree; for (int routPoint = 0; routPoint < 4; ++routPoint) { foreach (var element in Visuals) { if (element is ComponentVisual) { IRouting p1 = element as IRouting; nodeList.Add(new Node() { Point = p1.GetRoutingPoint(routPoint) }); } } } // connect points int loopCount = nodeList.Count; const int performanceTradeoffAt = 2; LinkedList <Node> path = null; for (int i = 0; i < loopCount; ++i) { StackFrameDijkstra.Dijkstra <Node> dijkstra = new StackFrameDijkstra.Dijkstra <Node>(); path = dijkstra.findPath(nodeList, startNode, endNode); if (path != null) { break; } var p1 = nodeList[i]; // TODO: inner loop restriction! n²-n! // is k=i instead of k=0 correct? for (int k = i; k < loopCount; ++k) { var p2 = nodeList[k]; if (p1 == p2) { continue; } if (p1.Vertices.Contains(p2)) { continue; } // no helping point required? if (p1.Point.X == p2.Point.X || p1.Point.Y == p2.Point.Y) { LineUtil.PerformOrthogonalPointConnection(p1, p2, quadTreePlugins); } else { Point help = new Point(p1.Point.X, p2.Point.Y); if (!LineUtil.PerformOrthogonalPointConnection(p1, help, p2, nodeList, quadTreePlugins)) { help = new Point(p2.Point.X, p1.Point.Y); if (!LineUtil.PerformOrthogonalPointConnection(p1, help, p2, nodeList, quadTreePlugins)) { // optional todo: double edge helping routes } } } } } if (path == null) { StackFrameDijkstra.Dijkstra <Node> dijkstra = new StackFrameDijkstra.Dijkstra <Node>(); path = dijkstra.findPath(nodeList, startNode, endNode); } if (path != null) { var list = path.ToList(); PointList.Clear(); Point startPoint = StartPoint, curPoint, prevPoint = startPoint; bool isStart = true; for (int c = 0; c < list.Count; ++c) { var i = list[c]; curPoint = i.Point; //this.PointList.Add(new FromTo(prevPoint, curPoint)); if ((startPoint.X != curPoint.X && startPoint.Y != curPoint.Y)) { if (isStart) { this.PointList.Add(new FromTo(startPoint, prevPoint, FromToMeta.HasStartPoint)); isStart = false; } else { this.PointList.Add(new FromTo(startPoint, prevPoint)); } startPoint = prevPoint; } if (c == list.Count - 1) { if ((startPoint.X != EndPoint.X && startPoint.Y != EndPoint.Y)) { this.PointList.Add(new FromTo(startPoint, curPoint)); startPoint = curPoint; } } prevPoint = curPoint; } this.PointList.Add(new FromTo(startPoint, EndPoint, FromToMeta.HasEndpoint)); HasComputed = true; raiseComputationDone(true); return; } failed = true; } //Failsafe if (IsDragged || failed || isSubstituteLine) { if (StartPoint.X < EndPoint.X) { PointList.Clear(); PointList.Add(new FromTo(StartPoint, new Point((EndPoint.X + StartPoint.X) / 2, StartPoint.Y))); PointList.Add(new FromTo(new Point((EndPoint.X + StartPoint.X) / 2, StartPoint.Y), new Point((EndPoint.X + StartPoint.X) / 2, EndPoint.Y))); PointList.Add(new FromTo(new Point((EndPoint.X + StartPoint.X) / 2, EndPoint.Y), EndPoint)); } else { if (StartPoint.X > EndPoint.X) { PointList.Clear(); PointList.Add(new FromTo(StartPoint, new Point((StartPoint.X + EndPoint.X) / 2, StartPoint.Y))); PointList.Add(new FromTo(new Point((StartPoint.X + EndPoint.X) / 2, StartPoint.Y), new Point((StartPoint.X + EndPoint.X) / 2, EndPoint.Y))); PointList.Add(new FromTo(new Point((StartPoint.X + EndPoint.X) / 2, EndPoint.Y), EndPoint)); } } } raiseComputationDone(false); } raiseComputationDone(true); }
/// <summary> /// 可通过构造函数注入自定义路由规则 /// </summary> /// <param name="iRouting"></param> public RedisTaskMessageContainer(IRouting iRouting) { this._iRouting = iRouting; }
public RedisTaskMessageContainer() { _iRouting = new HashRouting(); }
public void TurnRight() { _heading = _heading.TurnRight(); }
public Rover(Area area, Location location, IRouting heading) { _area = area; _location = location; _heading = heading; }
public IPublisherMessageBuilder <IPublisherMessage> WithRouting(string exchangeName, string routingKey) { _routing = new Routing(exchangeName, routingKey); return(this); }
public void TurnLeft() { _heading = _heading.TurnLeft(); }
public LocalRoutesController(IResponseBuilder responseBuilder, IRouting routing) { _responseBuilder = responseBuilder; _routing = routing; }