Example #1
0
        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();
        }
Example #2
0
 public DbTask(string name, FileConnectionManager fileConnection) : this(name)
 {
     this.FileConnection = fileConnection;
 }
Example #3
0
 public static int ExecuteNonQuery(IConnectionManager connectionManager, string name, FileConnectionManager fileConnection) => new XmlaTask(name, fileConnection)
 {
     ConnectionManager = connectionManager
 }.ExecuteNonQuery();
Example #4
0
 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();
Example #5
0
 public static int ExecuteNonQuery(string name, FileConnectionManager fileConnection) => new XmlaTask(name, fileConnection).ExecuteNonQuery();
Example #6
0
 public XmlaTask(string name, FileConnectionManager fileConnection) : base(name, fileConnection)
 {
     Init();
 }
Example #7
0
 public SqlTask(string name, FileConnectionManager fileConnection, IEnumerable <QueryParameter> parameter) : base(name, fileConnection)
 {
     Parameter = parameter;
 }
Example #8
0
 public SqlTask(string name, FileConnectionManager fileConnection) : base(name, fileConnection)
 {
 }
Example #9
0
 public static int ExecuteNonQuery(string name, FileConnectionManager fileConnection, IEnumerable <QueryParameter> parameterList) => new SqlTask(name, fileConnection, parameterList).ExecuteNonQuery();