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