Exemplo n.º 1
0
 private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
 {
     client = new BoardClient(IPAddress.Parse("127.0.0.1"), 11000);
     client.StartClient();
     Task.Run(CheckConnection);
     Content = new LoginPage(client, this);
 }
Exemplo n.º 2
0
        private static void Main()
        {
            var baseUrl    = Settings.Default.BaseUrl;
            var appId      = Settings.Default.AppId;
            var font       = Settings.Default.FontFamily;
            var fontSize   = Settings.Default.FontSize;
            var dateFormat = Settings.Default.DateTimeFormat;

            var board      = new BoardClient(baseUrl, appId);
            var fontFamily = LoadFontFamilyFromFile(font);
            var lastImage  = RenderText(fontFamily, fontSize, "");

            while (true)
            {
                var newTime     = DateTime.Now.ToString(dateFormat);
                var newImage    = RenderText(fontFamily, fontSize, newTime);
                var differences = GetDifferences(lastImage, newImage).ToArray();

                if (differences.Length > 0)
                {
                    var minX = differences.Min(point => point.X);
                    var maxX = differences.Max(point => point.X);
                    // var minY = differences.Min(point => point.Y);
                    // var maxY = differences.Max(point => point.Y);

                    board.Clear(minX / 2 - 4, 0, maxX / 2, newImage.Height / 2);

                    var region      = new Rectangle(minX, 0, maxX - minX, newImage.Height);
                    var redrawImage = GetRegionFromBitmap(newImage, region);

                    Console.WriteLine("drawing: {0}", newTime);

                    board.Execute(redrawImage);
                    lastImage = newImage;
                }

                Thread.Sleep(1000);
            }
        }
Exemplo n.º 3
0
 public VisitorPage(BoardClient client, Window mainWindow) : this()
 {
     _client     = client;
     _mainWindow = mainWindow;
 }
 public AdminPage(BoardClient client, Window window) : this()
 {
     _client     = client;
     _mainWindow = window;
 }
 public LoginPage(BoardClient client, Window mainWindow) : this()
 {
     _client     = client;
     _mainWindow = mainWindow;
 }