private void printerSelect_button_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(device_textBox.Text))
     {
         using (DynamicLocalPrintQueueForm localQueueForm = new DynamicLocalPrintQueueForm(false))
         {
             localQueueForm.ShowDialog(this);
             if (localQueueForm.DialogResult == DialogResult.OK)
             {
                 _localPrintQueueInfo = localQueueForm.PrintQueues.First();
                 device_textBox.Text  = _localPrintQueueInfo.AssociatedAssetId + @", " + _localPrintQueueInfo.PrintDriver.DriverName;
             }
         }
     }
     else
     {
         using (DynamicLocalPrintQueueForm localQueueForm = new DynamicLocalPrintQueueForm(_localPrintQueueInfo, false))
         {
             localQueueForm.ShowDialog(this);
             {
                 if (localQueueForm.DialogResult == DialogResult.OK)
                 {
                     _localPrintQueueInfo = localQueueForm.PrintQueues.First();
                     device_textBox.Text  = _localPrintQueueInfo.AssociatedAssetId + @", " + _localPrintQueueInfo.PrintDriver.DriverName;
                 }
             }
         }
     }
 }
Example #2
0
 private void addDynamic_ToolStripButton_Click(object sender, EventArgs e)
 {
     using (DynamicLocalPrintQueueForm form = new DynamicLocalPrintQueueForm(true))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             foreach (DynamicLocalPrintQueueInfo queue in form.PrintQueues)
             {
                 _printQueues.Add(queue);
                 _printQueueRows.Add(new LocalPrintQueueRow(queue));
             }
         }
     }
 }
Example #3
0
        private void EditDynamicQueue(LocalPrintQueueRow row, DynamicLocalPrintQueueInfo dynamicQueue)
        {
            using (DynamicLocalPrintQueueForm form = new DynamicLocalPrintQueueForm(dynamicQueue, true))
            {
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    _printQueueRows.Remove(row);
                    _printQueues.Remove(dynamicQueue);

                    foreach (DynamicLocalPrintQueueInfo queue in form.PrintQueues)
                    {
                        _printQueues.Add(queue);
                        _printQueueRows.Add(new LocalPrintQueueRow(queue));
                    }
                }
            }
        }