Imports EgtUILib
Imports EgtWPFLib
Imports System.IO
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Class CicloStartWD

   Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)

   Public Sub New(Owner As Window)
      Me.Owner = Owner
      InitializeComponent()
   End Sub

   ' inizializzo la finestra
   Private Sub StartLauncherWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
      ' posiziono la fistra in centro alla pagina
      Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
      Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
      ' imopposto il messaggio di avvio
      CicloStartTxbl.Text = EgtMsg(91130)   ' Esegui programma?
   End Sub

   ' creo un progetto nuovo
   Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
      Me.Close()
   End Sub

   ' Ultimo progetto
   Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
      ' Aspetto e lo avvio
      System.Threading.Thread.Sleep(300)
      ' avvio il ciclo start della macchina
      m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
      Me.Close()
   End Sub

End Class
