static void Main(string[] args) { var builder = new AppBuilder(); var app = builder.Build(Startup.Configuration); var server = new ServerFactory().Create(app, 8081); ThreadPool.QueueUserWorkItem(_ => { while (true) { Thread.Sleep(1000); var sc = new ScreenCapture(); var image = sc.CaptureScreen(); using (var ms = new MemoryStream()) { image.Save(ms, ImageFormat.Png); var s = Convert.ToBase64String(ms.ToArray()); var connection = new FileConnectionManager<ScreenSharing>( Startup.DependencyResolver.Resolve<IMessageBus>(), Startup.DependencyResolver.Resolve<IJsonSerializer>(), Startup.DependencyResolver.Resolve<ITraceManager>() ); connection.SendFile("image/png", s); } Console.WriteLine("Data sent"); } }); Console.WriteLine("Running on localhost:8081"); Console.ReadKey(); }
public DbTask(string name, FileConnectionManager fileConnection) : this(name) { this.FileConnection = fileConnection; }
public static int ExecuteNonQuery(IConnectionManager connectionManager, string name, FileConnectionManager fileConnection) => new XmlaTask(name, fileConnection) { ConnectionManager = connectionManager }.ExecuteNonQuery();
public static void ExecuteReader(string name, FileConnectionManager fileConnection, Action beforeRowReadAction, Action afterRowReadAction, params Action <object>[] actions) => new XmlaTask(name, fileConnection) { BeforeRowReadAction = beforeRowReadAction, AfterRowReadAction = afterRowReadAction, Actions = actions.ToList() }.ExecuteReader();
public static int ExecuteNonQuery(string name, FileConnectionManager fileConnection) => new XmlaTask(name, fileConnection).ExecuteNonQuery();
public XmlaTask(string name, FileConnectionManager fileConnection) : base(name, fileConnection) { Init(); }
public SqlTask(string name, FileConnectionManager fileConnection, IEnumerable <QueryParameter> parameter) : base(name, fileConnection) { Parameter = parameter; }
public SqlTask(string name, FileConnectionManager fileConnection) : base(name, fileConnection) { }
public static int ExecuteNonQuery(string name, FileConnectionManager fileConnection, IEnumerable <QueryParameter> parameterList) => new SqlTask(name, fileConnection, parameterList).ExecuteNonQuery();