public FramebufferToplevelImpl(IOutputBackend outputBackend, IInputBackend inputBackend) { _outputBackend = outputBackend; _inputBackend = inputBackend; Invalidate(default(Rect)); _inputBackend.Initialize(this, e => Input?.Invoke(e)); }
internal static LinuxFramebufferLifetime Initialize <T>(T builder, IOutputBackend outputBackend) where T : AppBuilderBase <T>, new() { var platform = new LinuxFramebufferPlatform(outputBackend); builder.UseSkia().UseWindowingSubsystem(platform.Initialize, "fbdev"); return(new LinuxFramebufferLifetime(platform._fb)); }
public OutputFilter CreateFilter(IEnumerable <IOutputConfiguration> configurations) { Lazy <GraphiteBackend> graphite = new Lazy <GraphiteBackend>(() => new GraphiteBackend(this.graphiteConfiguration)); Lazy <StatsDBackend> statsD = new Lazy <StatsDBackend>(() => new StatsDBackend(this.statsDConfiguration)); Lazy <ConsoleBackend> console = new Lazy <ConsoleBackend>(() => new ConsoleBackend()); List <OutputTarget> targets = new List <OutputTarget>(); foreach (var configuration in configurations) { IOutputBackend backend = null; if ("graphite".Equals(configuration.Target, StringComparison.OrdinalIgnoreCase)) { backend = graphite.Value; } else if ("statsd".Equals(configuration.Target, StringComparison.OrdinalIgnoreCase)) { backend = statsD.Value; } else if ("console".Equals(configuration.Target, StringComparison.OrdinalIgnoreCase)) { backend = console.Value; } else { throw new ArgumentException("Unknown output target \"{0}\".".FormatWith(configuration.Target), "configurations"); } var target = new OutputTarget( configuration.PathPattern, configuration.Type, configuration.MetricsPrefix, backend); targets.Add(target); } List <IOutputBackend> backends = new List <IOutputBackend>(); if (graphite.IsValueCreated) { backends.Add(graphite.Value); } if (statsD.IsValueCreated) { backends.Add(statsD.Value); } if (console.IsValueCreated) { backends.Add(console.Value); } var filter = new OutputFilter(targets, backends); return(filter); }
public OutputTarget(string pathPattern, string types, string metricsPrefix, IOutputBackend backend) { if (backend == null) throw new ArgumentNullException("backend"); this.backend = backend; this.fileCheck = string.IsNullOrEmpty(pathPattern) ? null : new Regex(pathPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); this.typeCheck = new Regex(types, RegexOptions.Compiled | RegexOptions.IgnoreCase); this.metricsPrefix = metricsPrefix; }
public OutputTarget(string pathPattern, string types, string metricsPrefix, IOutputBackend backend) { if (backend == null) { throw new ArgumentNullException("backend"); } this.backend = backend; this.fileCheck = string.IsNullOrEmpty(pathPattern) ? null : new Regex(pathPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); this.typeCheck = new Regex(types, RegexOptions.Compiled | RegexOptions.IgnoreCase); this.metricsPrefix = metricsPrefix; }
public LinuxFramebufferLifetime(IOutputBackend fb) { _fb = fb; }
LinuxFramebufferPlatform(IOutputBackend backend) { _fb = backend; }
public LinuxFramebufferLifetime(IOutputBackend fb, IInputBackend input) { _fb = fb; _inputBackend = input; }