Ejemplo n.º 1
0
 public static MissingLicensePlateList CreateIfNotExistsAndGetInstance(IMissingPlateClient mlpClient, IExceptionEventObservable parent)
 {
     lock (mlpLock)
     {
         if (null == mlpList || mlpList.IsDisposed)
         {
             mlpList = new MissingLicensePlateList(mlpClient, parent);
         }
         return(mlpList);
     }
 }
Ejemplo n.º 2
0
        private async void submitButton_Click(object sender, EventArgs e)
        {
            var plateNumber = lettersBox.Text + digitsBox.Text;

            if (!plateNumber.ValidatePlateNumber())
            {
                var eventArgs = new ExceptionEventArgs {
                    ExceptionMessage = Resources.Error_BadLicensePlateNumber
                };
                ExceptionEventHandler?.Invoke(this, eventArgs);
                return;
            }

            await mlpClient.InsertPlateRecord(plateNumber, DateTime.Now);

            await MissingLicensePlateList.CreateIfNotExistsAndGetInstance(mlpClient, this).UpdateDatasource();

            await UpdateDlpDataSource();
        }
Ejemplo n.º 3
0
        private void showMlpList_Click(object sender, EventArgs e)
        {
            MissingLicensePlateList mlpList = MissingLicensePlateList.CreateIfNotExistsAndGetInstance(mlpClient, this);

            mlpList.Show();
        }