Esempio n. 1
0
 private void cmbPage_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbPage.SelectedIndex == cmbPage.Items.Count - 1)
     {
         // "Custom..." selected
         var form = FormFactory.Create <FPageSize>();
         form.PageSizeDimens = lastPageSizeItem.Type == ScanPageSize.Custom
             ? lastPageSizeItem.CustomDimens
             : lastPageSizeItem.Type.PageDimensions();
         if (form.ShowDialog() == DialogResult.OK)
         {
             UpdatePageSizeList();
             SelectCustomPageSize(form.PageSizeName, form.PageSizeDimens);
         }
         else
         {
             cmbPage.SelectedIndex = lastPageSizeIndex;
         }
     }
     lastPageSizeIndex = cmbPage.SelectedIndex;
     lastPageSizeItem  = (PageSizeListItem)cmbPage.SelectedItem;
 }
Esempio n. 2
0
 private void cmbPage_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbPage.SelectedIndex == cmbPage.Items.Count - 1)
     {
         // "Custom..." selected
         var form = FormFactory.Create<FPageSize>();
         form.PageSizeDimens = lastPageSizeItem.Type == ScanPageSize.Custom
             ? lastPageSizeItem.CustomDimens
             : lastPageSizeItem.Type.PageDimensions();
         if (form.ShowDialog() == DialogResult.OK)
         {
             UpdatePageSizeList();
             SelectCustomPageSize(form.PageSizeName, form.PageSizeDimens);
         }
         else
         {
             cmbPage.SelectedIndex = lastPageSizeIndex;
         }
     }
     lastPageSizeIndex = cmbPage.SelectedIndex;
     lastPageSizeItem = (PageSizeListItem)cmbPage.SelectedItem;
 }