/// <summary> /// 创建工作单元 /// </summary> /// <param name="propagation">事务传播方式</param> /// <param name="isolationLevel">事务隔离级别</param> /// <returns></returns> public IUnitOfWork Begin(Propagation propagation = Propagation.Required, IsolationLevel?isolationLevel = null) { switch (propagation) { case Propagation.Required: return(FindedUowCreateVirtual() ?? CreateUow(isolationLevel)); case Propagation.Supports: return(FindedUowCreateVirtual() ?? CreateUowNothing(_allUows.LastOrDefault()?.IsNotSupported ?? false)); case Propagation.Mandatory: return(FindedUowCreateVirtual() ?? throw new Exception("Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常")); case Propagation.NotSupported: return(CreateUowNothing(true)); case Propagation.Never: var isNotSupported = _allUows.LastOrDefault()?.IsNotSupported ?? false; if (isNotSupported == false) { for (var a = _rawUows.Count - 1; a >= 0; a--) { if (_rawUows[a].Uow.GetOrBeginTransaction(false) != null) { throw new Exception("Propagation_Never: 以非事务方式执行操作,如果当前事务存在则抛出异常"); } } } return(CreateUowNothing(isNotSupported)); case Propagation.Nested: return(CreateUow(isolationLevel)); default: throw new NotImplementedException(); } }
protected internal void InjectTraceContext(HttpWebRequest message, ISpan parentSpan) { // Expects the currentspan to be the span to inject into var headers = message.Headers; Propagation.Inject(Tracer.CurrentSpan.Context, headers, (c, k, v) => { if (k == B3Constants.XB3TraceId) { if (v.Length > 16 && Options.UseShortTraceIds) { v = v.Substring(v.Length - 16, 16); } } if (c.Get(k) != null) { c.Remove(k); } c.Add(k, v); }); if (parentSpan != null) { headers.Add(B3Constants.XB3ParentSpanId, parentSpan.Context.SpanId.ToLowerBase16()); } }
protected internal SpanContext ExtractTraceContext(HttpContext context) { var request = context.Request; return(Propagation.Extract(request.Headers, (d, k) => { d.TryGetValue(k, out var result); return result; })); }
protected internal ISpanContext ExtractTraceContext(HttpContext context) { var request = context.Request; try { return Propagation.Extract(request.Headers, headerGetter); } catch (SpanContextParseException) { // Ignore } return null; }
protected internal ISpanContext ExtractTraceContext(HttpContext context) { var request = context.Request; try { return(Propagation.Extract(request.Headers, (d, k) => { d.TryGetValue(k, out StringValues result); return result; })); } catch (SpanContextParseException) { // Ignore } return(null); }
public CodecConfiguration WithPropagation(Propagation propagation) { switch (propagation) { case Propagation.Jaeger: AddCodec(BuiltinFormats.HttpHeaders, new TextMapCodec(true)); AddCodec(BuiltinFormats.TextMap, new TextMapCodec(false)); break; case Propagation.B3: AddCodec(BuiltinFormats.HttpHeaders, new B3TextMapCodec()); AddCodec(BuiltinFormats.TextMap, new B3TextMapCodec()); break; default: _logger.LogError("Unhandled propagation {propagation}", propagation); break; } return(this); }
/// <summary> /// Actualización del paquete en los distintas dependencias. /// </summary> /// <param name="args">Argumentos de propagación, los mismos del update + build</param> public static void ProgragationMethod(Propagation args) { // version main var versionSpec = new VersionSpec(args.GitAddress, args.branch, args.Token, args.packageName, args.packageType, args.DependantRelease, args.username, args.email); try { versionSpec.SetVersionToDependant((message) => Colorful.Console.WriteLine($"${message}", Color.Green)); } catch (Exception ex) { Colorful.Console.WriteLine($"Error en la ejecución {ex.Message}", Color.Red); Colorful.Console.WriteLine($"Error en la ejecución {ex.StackTrace}", Color.Red); if (ex.InnerException != null) { Colorful.Console.WriteLine($"Error en la ejecución {ex.InnerException.Message}", Color.DarkRed); Colorful.Console.WriteLine($"Error en la ejecución {ex.InnerException.StackTrace}", Color.DarkRed); } } }
public override void Resume(Propagation.TrainingContinuation state) { throw new NotImplementedException(); }
public IRepositoryUnitOfWork Begin(Propagation propagation, IsolationLevel?isolationLevel = null) { if (propagation == Propagation.Requierd) { if (_isNotSupported == false) { for (var a = _uows.Count - 1; a >= 0; a--) { if (_uows[a].GetOrBeginTransaction(false) != null) { return(new UnitOfWorkProxy(_uows[a])); } } } var uow = new RepositoryUnitOfWork(_fsql); if (isolationLevel != null) { uow.IsolationLevel = isolationLevel.Value; } try { uow.GetOrBeginTransaction(); } catch { uow.Dispose(); throw; } _uows.Add(uow); return(uow); } if (propagation == Propagation.Supports) { if (_isNotSupported == false) { for (var a = _uows.Count - 1; a >= 0; a--) { if (_uows[a].GetOrBeginTransaction(false) != null) { return(new UnitOfWorkProxy(_uows[a])); } } } return(new UnitOfWorkNothing(_fsql)); } if (propagation == Propagation.Mandatory) { if (_isNotSupported == false) { for (var a = _uows.Count - 1; a >= 0; a--) { if (_uows[a].GetOrBeginTransaction(false) != null) { return(new UnitOfWorkProxy(_uows[a])); } } throw new Exception("Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常"); } throw new Exception("Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常(NotSupported 事务挂起中)"); } if (propagation == Propagation.NotSupported) { if (_isNotSupported == false) { _isNotSupported = true; return(new UnitOfWorkNothing(_fsql) { OnDispose = () => _isNotSupported = false }); } return(new UnitOfWorkNothing(_fsql)); } if (propagation == Propagation.Never) { if (_isNotSupported == false) { for (var a = _uows.Count - 1; a >= 0; a--) { if (_uows[a].GetOrBeginTransaction(false) != null) { throw new Exception("Propagation_Never: 以非事务方式执行操作,如果当前事务存在则抛出异常"); } } } return(new UnitOfWorkNothing(_fsql)); } if (propagation == Propagation.Nested) { var uow = new RepositoryUnitOfWork(_fsql); if (isolationLevel != null) { uow.IsolationLevel = isolationLevel.Value; } try { uow.GetOrBeginTransaction(); } catch { uow.Dispose(); throw; } _uows.Add(uow); return(uow); } throw new NotImplementedException(); }
/// <summary> /// <para>支持传入 事务传播方式 <see cref="Propagation"/>,事务级别 <see cref="IsolationLevel"/> 参数值</para> /// </summary> /// <param name="propagation">事务传播方式</param> /// <param name="isolationLevel">事务隔离级别</param> public UnitOfWorkAttribute(Propagation propagation, IsolationLevel isolationLevel) { Propagation = propagation; IsolationLevel = isolationLevel; }
public FlightData() { InitializeComponent(); //AGauge.BackgroundImage = Image.FromStream(new MemoryStream(Properties.Resources.guagebg)); GMap.NET.GMaps.Instance.PrimaryCache = new MissionPlanner.Maps.MyImageCache(); GMapControl.MapProvider = GMapProviders.GoogleSatelliteMap; GMapControl.MapScaleInfoEnabled = true; GMapControl.ScalePen = new Pen(Color.Orange); GMapControl.Position = new PointLatLng(-35, 117.89); this.gMapControl1.OnPositionChanged += new GMap.NET.PositionChanged(this.gMapControl1_OnPositionChanged); // this.gMapControl1.Click += new System.EventHandler(this.gMapControl1_Click); this.gMapControl1.MouseDown += this.gMapControl1_MouseDown; this.gMapControl1.MouseLeave += this.gMapControl1_MouseLeave; this.gMapControl1.MouseMove += this.gMapControl1_MouseMove; //gMapControl1.ShowTileGridLines = true; // same as flightdata gMapControl1.CacheLocation = Settings.GetDataDirectory() + "gmapcache" + Path.DirectorySeparatorChar; gMapControl1.MaxZoom = 24; gMapControl1.MinZoom = 1; gMapControl1.Zoom = 3; gMapControl1.ScaleMode = ScaleModes.Fractional; gMapControl1.LevelsKeepInMemmory = 5; TRK_zoom.Maximum = 24; TRK_zoom.Minimum = 1; TRK_zoom.Value = 3; gMapControl1.OnMapZoomChanged += gMapControl1_OnMapZoomChanged; gMapControl1.DisableFocusOnMouseEnter = true; gMapControl1.OnMarkerEnter += gMapControl1_OnMarkerEnter; gMapControl1.OnMarkerLeave += gMapControl1_OnMarkerLeave; gMapControl1.RoutesEnabled = true; gMapControl1.PolygonsEnabled = true; tfrpolygons = new GMapOverlay("tfrpolygons"); gMapControl1.Overlays.Add(tfrpolygons); kmlpolygons = new GMapOverlay("kmlpolygons"); gMapControl1.Overlays.Add(kmlpolygons); geofence = new GMapOverlay("geofence"); gMapControl1.Overlays.Add(geofence); polygons = new GMapOverlay("polygons"); gMapControl1.Overlays.Add(polygons); photosoverlay = new GMapOverlay("photos overlay"); gMapControl1.Overlays.Add(photosoverlay); routes = new GMapOverlay("routes"); gMapControl1.Overlays.Add(routes); rallypointoverlay = new GMapOverlay("rally points"); gMapControl1.Overlays.Add(rallypointoverlay); gMapControl1.Overlays.Add(poioverlay); Task.Run(mainloop); prop = new Propagation(gMapControl1); }
/// <summary> /// <para>支持传入 事务传播方式 <see cref="Propagation"/>,事务级别 <see cref="IsolationLevel"/> 参数值</para> /// </summary> /// <param name="propagation">事务传播方式</param> /// <param name="isolationLevel">事务隔离级别</param> public TransactionAttribute(Propagation propagation, IsolationLevel isolationLevel) : base(propagation, isolationLevel) { }
public BackPropagation(Propagation forwardPropagation, IEnumerable <ExitError> errors) { this.forwardPropagation = forwardPropagation; this.errors = errors; }