/// <summary> /// The DisplayNewMonitor method. /// </summary> /// <param name="monitor">The monitor to display.</param> /// <param name="location">The location of the new monitor.</param> public void DisplayNewMonitor(Monitor monitor, Point location) { var newPosition = new MonitorPosition { MonitorId = monitor.Id, Position = new Rect { Left = location.X, Top = location.Y, Height = 60, Width = 80 } }; CurrentMonitorPositions.Add(newPosition); var monitorPanel = new MonitorPanel { Tag = newPosition, Location = new Point(location.X, location.Y), Size = new Size(80, 60), BorderStyle = BorderStyle.FixedSingle }; AddMonitorPanel(monitorPanel, monitor.Name); }
private void SetForGoodPosition(MonitorPosition pos) { var screen = Screen.Bounds; _logger.Debug($"A fő ablak Pointerrének a lékérése"); //az előtérben lévő program pointerének megszerzése IntPtr hwWindowHandle = NativeMethods.GetForegroundWindow(); //IntPtr hwWindowHandle = GetMainWindowHandle(adobe); _logger.Debug($"A fő ablak Pointerrének a lékérése sikeres volt: {hwWindowHandle}"); var halfWidth = screen.Width / 2; switch (pos) { case MonitorPosition.Left: _logger.Debug($"A poziónálás a bal oldalra"); NativeMethods.SetWindowPos(hwWindowHandle, HW.Top, screen.X, screen.Y, halfWidth, screen.Height, SWD.SHOWWINDOW); break; case MonitorPosition.Right: _logger.Debug($"A poziónálás a jobb oldalra"); NativeMethods.SetWindowPos(hwWindowHandle, HW.Top, screen.X + halfWidth, screen.Y, halfWidth, screen.Height, SWD.SHOWWINDOW); break; default: _logger.Debug($"A poziónálás a bal oldalra"); NativeMethods.SetWindowPos(hwWindowHandle, HW.Top, screen.X, screen.Y, halfWidth, screen.Height, SWD.SHOWWINDOW); break; } _logger.Debug($"A poziciónált ablak előtérbe helyezése"); //előtérbe állítása ha valami beugrott volna közben NativeMethods.SetForegroundWindow(hwWindowHandle); }
public void AddNewCikk(ItemNumber item, MonitorPosition pos) { if (Items.Count < MaxCikkCount) { if (item != default) { if (pos != MonitorPosition.None) { foreach (var pDF in item.PDFs) { pDF.Position = pos; } } else { for (int i = 0; i < item.PDFs.Count; i++) { item.PDFs[i].Position = (MonitorPosition)i; } } Items.Add(item); } } }
/// <summary> /// The DisplayMonitorPosition method. /// </summary> /// <param name="position">The monitor position to display.</param> public void DisplayMonitorPosition(MonitorPosition position) { var width = position.Position.Width / 2; var height = position.Position.Height / 2; int left = 0; if (position.Position.Left > 0) { left = position.Position.Left / 2; } int top = 0; if (position.Position.Top > 0) { top = position.Position.Top / 2; } if (position.Position.Width < 10) { width = 10; } if (position.Position.Height < 10) { height = 10; } var panel = new MonitorPanel { Tag = position, Location = new Point(left, top), Size = new Size(width, height), BorderStyle = BorderStyle.FixedSingle }; var monitorIdFilter = new Dictionary <Filters.Value, string> { { Filters.Value.Id, position.MonitorId } }; var monitorName = MainForm.CurrentSystem.GetMonitors(monitorIdFilter).FirstOrDefault()?.Name ?? position.MonitorId; AddMonitorPanel(panel, monitorName); }
private bool SplitForOneSide(PDFModelOverTCP model, MonitorPosition pos) { _logger.Info($"A {model.PDFFileName} pdf poziciónálása a {model.MonitorIndex} monitorra, a {pos.ToString()} oldalára"); //ha a standard empty vagy nyitva van akkor nem kell csinálnia semmit if (model.PDFFileName.EndsWith(".pdf") == false) { model.PDFFileName += ".pdf"; } //az adobehez az argumentumok beállítása try { _logger.Debug($"A {model.PDFFileName} pdfhez az argumentumok beállítása"); string args = ProcessOperations.SetArguments(model.PDFFileName); _logger.Debug($"A {model.PDFFileName} pdfhez a PDF olvasó beállítása a {args} argumentumokkal"); //az adobe program elindítása a megadott argumentumokkal Process adobeProc = ProcessOperations.StartAdobe(args); Adobes.Add(adobeProc); _logger.Debug($"A {model.PDFFileName} pdfhez a PDF olvasó beállítása a {args} argumentumokkal beállítva"); _logger.Debug($"A {model.PDFFileName} pdfhez a poziciónálása megkezdése"); //a megfelelő helyre állítása a megadott monitoron a megadott helyre SetForGoodPosition(pos); _logger.Debug($"A {model.PDFFileName} pdfhez a PDF reader utáni script futtatása"); //a readermódba állító program elindítása ProcessOperations.StartReader(); return(true); } catch (PDFNotFoundException) { } catch (Exception) { } return(false); }
/// <summary> /// The DisplayMonitorPosition method. /// </summary> /// <param name="position">The monitor position to display.</param> public void DisplayMonitorPosition(MonitorPosition position) { var width = position.Position.Width / 2; var height = position.Position.Height / 2; int left = 0; if (position.Position.Left > 0) { left = position.Position.Left / 2; } int top = 0; if (position.Position.Top > 0) { top = position.Position.Top / 2; } if (position.Position.Width < 10) { width = 10; } if (position.Position.Height < 10) { height = 10; } var monitors = CurrentMonitorWall.Monitors; var monitor = monitors.FirstOrDefault(mon => mon.Id == position.MonitorId); var monitorIndex = monitors.IndexOf(monitor) + 1; Monitor.Layouts layout = monitor?.Layout ?? Monitor.Layouts.CellLayout4x4; CurrentCellIndex = 0; foreach (MonitorSelection selection in CurrentMonitorSelections) { if (selection.Owner.Split('@')[0] == MainForm.CurrentUserName && selection.Monitor == monitorIndex) { CurrentCellIndex = selection.Cell; CurrentMonitorIndex = selection.Monitor; CurrentInputMode = selection.InputMode; } } var panel = new MonitorSelectionPanel(this, layout, CurrentCellIndex) { Tag = position, Location = new Point(left, top), Size = new Size(width, height), BorderStyle = BorderStyle.FixedSingle }; foreach (MonitorSelection selection in CurrentMonitorSelections) { if (selection.Owner.Split('@')[0] != MainForm.CurrentUserName && selection.Monitor == monitorIndex) { panel.SelectCell(selection.Cell, selection.Owner.Split('@')[0], CurrentInputMode); } } var monitorIdFilter = new Dictionary <Filters.Value, string> { { Filters.Value.Id, position.MonitorId } }; var monitorName = MainForm.CurrentSystem.GetMonitors(monitorIdFilter).FirstOrDefault()?.Name ?? position.MonitorId; AddMonitorSelectionPanel(panel, monitorName); }
public PDFModelOverTCP(MonitorPosition position) { Position = position; }
public PDFModelOverTCP(string fileName, byte[] data, MonitorPosition position) : this(position) { PDFFileName = fileName; Data = data; }
public PDFModelOverTCP(string fileName, MonitorPosition position) : this(position) { PDFFileName = fileName; //Data = System.IO.File.ReadAllBytes(fileName); }