private void OpenResponse(Amqp.IConnection conn, Open openResp) { Tracer.InfoFormat("Connection {0}, Open {0}", conn.ToString(), openResp.ToString()); Tracer.DebugFormat("Open Response : \n Hostname = {0},\n ContainerId = {1},\n MaxChannel = {2},\n MaxFrame = {3}\n", openResp.HostName, openResp.ContainerId, openResp.ChannelMax, openResp.MaxFrameSize); Tracer.DebugFormat("Open Response Descriptor : \n Descriptor Name = {0},\n Descriptor Code = {1}\n", openResp.Descriptor.Name, openResp.Descriptor.Code); ProcessCapabilities(openResp); ProcessRemoteConnectionProperties(openResp); if (SymbolUtil.CheckAndCompareFields(openResp.Properties, SymbolUtil.CONNECTION_ESTABLISH_FAILED, SymbolUtil.BOOLEAN_TRUE)) { Tracer.InfoFormat("Open response contains {0} property the connection {1} will soon be closed.", SymbolUtil.CONNECTION_ESTABLISH_FAILED, this.ClientId); } else { object value = SymbolUtil.GetFromFields(openResp.Properties, SymbolUtil.CONNECTION_PROPERTY_TOPIC_PREFIX); if (value != null && value is string) { this.connInfo.TopicPrefix = value as string; } value = SymbolUtil.GetFromFields(openResp.Properties, SymbolUtil.CONNECTION_PROPERTY_QUEUE_PREFIX); if (value != null && value is string) { this.connInfo.QueuePrefix = value as string; } this.latch?.countDown(); } }
internal void OnRemoteOpened(Open open) { if (SymbolUtil.CheckAndCompareFields(open.Properties, SymbolUtil.CONNECTION_ESTABLISH_FAILED, SymbolUtil.BOOLEAN_TRUE)) { Tracer.InfoFormat("Open response contains {0} property the connection {1} will soon be closed.", SymbolUtil.CONNECTION_ESTABLISH_FAILED, Info.Id); } else { object value = SymbolUtil.GetFromFields(open.Properties, SymbolUtil.CONNECTION_PROPERTY_TOPIC_PREFIX); if (value is string topicPrefix) { Info.TopicPrefix = topicPrefix; } value = SymbolUtil.GetFromFields(open.Properties, SymbolUtil.CONNECTION_PROPERTY_QUEUE_PREFIX); if (value is string queuePrefix) { Info.QueuePrefix = queuePrefix; } this.tsc.SetResult(true); Provider.FireConnectionEstablished(); } }
public void ClearRouteAnalyst(AxMapControl mapControl) { //清除所有图标 SymbolUtil.ClearElement(mapControl); stopPoints.Clear(); barryPoints.Clear(); barryElements.Clear(); stopElements.Clear(); //清除网络分析图层 for (int i = 0; i < mapControl.LayerCount; i++) { ILayer layer = mapControl.get_Layer(i); INetworkLayer networkLayer = layer as INetworkLayer; INALayer naLayer = layer as INALayer; if (networkLayer != null || naLayer != null) { mapControl.DeleteLayer(i); } } //清除网络数据集 ILayer datalayer = LayerUtil.QueryLayerInMap(mapControl, "网络数据集"); if (datalayer != null) { mapControl.Map.DeleteLayer(datalayer); } IActiveView pActiveView = mapControl.ActiveView; pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); mapControl.Refresh(); }
private void SetPolylineMarkerSymbol(ISymbol symbol) { SimpleLineSymbolClass simpleLineSymbol = symbol as SimpleLineSymbolClass; simpleLineSymbol.Width = 2; simpleLineSymbol.Color = SymbolUtil.GetColor(255, 0, 99); }
public void SymbolWOBody_IdentifierRange_Out() { int line = 2; int character = 222; bool actual = SymbolUtil.PositionIsWithinSymbolIdentifier(symbolWithoutBody, defaultUri, line, character); Assert.IsFalse(actual); }
public SimpleCalculusService(IArticleConfigProfile configProfile) : base(configProfile) { ModuleAssembly = typeof(CalculusService).Assembly; ContractCode = SymbolUtil.GetContractCode(); PositionCode = SymbolUtil.GetPositionCode(); }
public void UpdateSymbol(AxMapControl mapControl) { SymbolUtil.ClearElement(mapControl); this.barryElements.Clear(); this.stopElements.Clear(); this.stopPoints.ForEach(point => stopElements.Add(SymbolUtil.DrawSymbolWithPicture(point, mapControl, Common.StopImagePath))); this.barryPoints.ForEach(point => barryElements.Add(SymbolUtil.DrawSymbolWithPicture(point, mapControl, Common.RouteBeakImggePath))); }
private void SetPointMarkerSymbol(ISymbol symbol) { SimpleMarkerSymbolClass simplePointSymbol = symbol as SimpleMarkerSymbolClass; simplePointSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle; simplePointSymbol.Size = 5; simplePointSymbol.Color = SymbolUtil.GetColor(255, 0, 0); }
public void Body_Outside1() { int line = 1; int character = 0; bool actual = SymbolUtil.PositionIsWithinSymbolBody(symbolWithBody, defaultUri, line, character); Assert.IsFalse(actual); }
public void InBodyOfSymbolWOBody2() { int line = 3; int character = 0; bool actual = SymbolUtil.PositionIsWithinSymbolBody(symbolWithoutBody, defaultUri, line, character); Assert.IsFalse(actual); }
public void SymbolWOBody_TotalRange_In() { int line = 3; int character = 0; bool actual = SymbolUtil.PositionIsWithinSymbolTotalRange(symbolWithoutBody, defaultUri, line, character); Assert.IsFalse(actual); }
public void Identifier_Outside2() { int line = 2; int character = -1; bool actual = SymbolUtil.PositionIsWithinSymbolIdentifier(symbolWithBody, defaultUri, line, character); Assert.IsFalse(actual); }
public void Wrongfile_totalRange() { int line = 2; int character = 2; bool actual = SymbolUtil.PositionIsWithinSymbolTotalRange(symbolInAnotherFile, defaultUri, line, character); Assert.IsFalse(actual); }
public void Identifier_Inside() { int line = 2; int character = 0; bool actual = SymbolUtil.PositionIsWithinSymbolIdentifier(symbolWithBody, defaultUri, line, character); Assert.IsTrue(actual); }
public void TotalRange_Outside2() { int line = 7; int character = 0; bool actual = SymbolUtil.PositionIsWithinSymbolTotalRange(symbolWithBody, defaultUri, line, character); Assert.IsFalse(actual); }
public void TotalRange_Inside1() { int line = 3; int character = 0; bool actual = SymbolUtil.PositionIsWithinSymbolTotalRange(symbolWithBody, defaultUri, line, character); Assert.IsTrue(actual); }
public void UndoBarryPointSymbols(AxMapControl mapControl) { if (this.barryPoints.Count > 0) { this.barryPoints.RemoveAt(this.barryPoints.Count - 1); SymbolUtil.ClearElement(mapControl, this.barryElements[this.barryElements.Count - 1]); this.barryElements.RemoveAt(this.barryElements.Count - 1); } }
private void SetPolygonMarkerSymbol(ISymbol symbol) { SimpleFillSymbolClass simpleFillSymbol = symbol as SimpleFillSymbolClass; SimpleLineSymbolClass simpleLineSymbol = new SimpleLineSymbolClass(); SetPolylineMarkerSymbol(simpleLineSymbol as ISymbol); simpleFillSymbol.Outline = simpleLineSymbol; simpleFillSymbol.Color = SymbolUtil.GetColor(222, 222, 222); }
public void ResetStopPointSymbols(AxMapControl mapControl) { this.stopPoints.Clear(); this.stopElements.ForEach(element => SymbolUtil.ClearElement(mapControl, element)); this.stopElements.Clear(); IActiveView pActiveView = mapControl.ActiveView; pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); mapControl.Refresh(); }
private Source CreateSource() { Source source = new Source(); source.Address = AmqpDestinationHelper.GetDestinationAddress(info.Destination, session.Connection); source.Outcomes = new[] { SymbolUtil.ATTACH_OUTCOME_ACCEPTED, SymbolUtil.ATTACH_OUTCOME_RELEASED, SymbolUtil.ATTACH_OUTCOME_REJECTED, SymbolUtil.ATTACH_OUTCOME_MODIFIED }; source.DefaultOutcome = MessageSupport.MODIFIED_FAILED_INSTANCE; if (info.IsDurable) { source.ExpiryPolicy = SymbolUtil.ATTACH_EXPIRY_POLICY_NEVER; source.Durable = (int)TerminusDurability.UNSETTLED_STATE; source.DistributionMode = SymbolUtil.ATTACH_DISTRIBUTION_MODE_COPY; } else { source.ExpiryPolicy = SymbolUtil.ATTACH_EXPIRY_POLICY_SESSION_END; source.Durable = (int)TerminusDurability.NONE; } if (info.IsBrowser) { source.DistributionMode = SymbolUtil.ATTACH_DISTRIBUTION_MODE_COPY; } source.Capabilities = new[] { SymbolUtil.GetTerminusCapabilitiesForDestination(info.Destination) }; Map filters = new Map(); if (info.NoLocal) { filters.Add(SymbolUtil.ATTACH_FILTER_NO_LOCAL, AmqpNmsNoLocalType.NO_LOCAL); } if (info.HasSelector) { filters.Add(SymbolUtil.ATTACH_FILTER_SELECTOR, new AmqpNmsSelectorType(info.Selector)); } if (filters.Count > 0) { source.FilterSet = filters; } return(source); }
public void ShouldGetContractMonth(string symbol, int expected) { int actual = DatePool.GetSymbolMonth(symbol); if (SymbolUtil.GetSymbolType(symbol) == SymbolType.Spot) { int monthDifference = DateTime.Now.Month - 7; actual -= monthDifference; } Assert.Equal(expected, actual); }
public void RemoveBarryPoint(AxMapControl mapControl, IPoint point) { if (this.BarryPoints.Count > 0) { int index = JudgePointIsInCircle(this.barryPoints, point); if (index != -1) { this.barryPoints.RemoveAt(index); SymbolUtil.ClearElement(mapControl, this.barryElements[index]); this.barryElements.RemoveAt(index); } } }
private static void ShowRouteMethod(AxMapControl mapControl, IFeature pFeature) { IEnvelope pEnvelope = pFeature.Extent; double width = pEnvelope.Width; double height = pEnvelope.Height; pEnvelope.XMax += width * 1.5; pEnvelope.XMin -= width * 1.5; pEnvelope.YMax += height * 1.5; pEnvelope.YMin -= height * 1.5; mapControl.Extent = pEnvelope; SymbolUtil.DrawLineSymbol(mapControl, pFeature.Shape as IGeometry); }
public void Negatives() { int startLine = -1; int startCol = -1; int endLine = -1; int endCol = -1; int targetLine = 5; int targetCol = 5; bool actual = SymbolUtil.Wraps(startLine, startCol, endLine, endCol, targetLine, targetCol); Assert.IsFalse(actual); }
public void singleCharEdgeCase1out() { int startLine = 3; int startCol = 3; int endLine = 3; int endCol = 4; int targetLine = 3; int targetCol = 5; bool actual = SymbolUtil.Wraps(startLine, startCol, endLine, endCol, targetLine, targetCol); Assert.IsFalse(actual); }
public void LineAfter() { int startLine = 3; int startCol = 3; int endLine = 7; int endCol = 7; int targetLine = 9; int targetCol = 9; bool actual = SymbolUtil.Wraps(startLine, startCol, endLine, endCol, targetLine, targetCol); Assert.IsFalse(actual); }
public void targetAtSymbolEndMultiLine_1off() { int startLine = 3; int startCol = 3; int endLine = 7; int endCol = 7; int targetLine = 7; int targetCol = 8; bool actual = SymbolUtil.Wraps(startLine, startCol, endLine, endCol, targetLine, targetCol); Assert.IsFalse(actual); }
public void zeroCharTheoreticalEdgeCase() { int startLine = 3; int startCol = 3; int endLine = 3; int endCol = 3; int targetLine = 3; int targetCol = 3; bool actual = SymbolUtil.Wraps(startLine, startCol, endLine, endCol, targetLine, targetCol); Assert.IsTrue(actual); }
public void SameEndLineTrue() { int startLine = 3; int startCol = 3; int endLine = 7; int endCol = 7; int targetLine = 7; int targetCol = 1; bool actual = SymbolUtil.Wraps(startLine, startCol, endLine, endCol, targetLine, targetCol); Assert.IsTrue(actual); }
public void targetAtSymbolStartMultiLine() { int startLine = 3; int startCol = 3; int endLine = 7; int endCol = 7; int targetLine = 3; int targetCol = 3; bool actual = SymbolUtil.Wraps(startLine, startCol, endLine, endCol, targetLine, targetCol); Assert.IsTrue(actual); }