⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deliverysignatureprofessional.cs

📁 微软的行业应用解决方案示例
💻 CS
字号:
using System;
using System.Drawing.Imaging;
using System.Windows.Forms;
using HardwareDistributor.Properties;

namespace HardwareDistributor.UI
{
    public partial class DeliverySignatureProfessional : DeliverySignatureBase
    {
        #region Constructors

        public DeliverySignatureProfessional(Guid orderId, int customerId)
            : base(orderId, customerId)
        {
            InitializeComponent();

            // We are removing both the Control Box and the Minimize Box, so that we don't
            // have to handle these in our code. This is not necessary in Windows Mobile Standard,
            // but we are writing this code so that it works on all platforms without any changes
            // or any recompiling.
            this.ControlBox = false;
            this.MinimizeBox = false;
        }

        #endregion

        #region Event Handlers

        /// <summary>
        /// Clears the signature capture control
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void linkLabelClear_Click_1(object sender, EventArgs e)
        {
            try
            {
                //Clear the control				
                signatureCapture1.Clear();
            }
            catch (Exception ex)
            {
                Business.Services.LogErrors(ex);
                MessageBox.Show(Resources.ClearSignatureError, Resources.SystemError);
            }
        }

        /// <summary>
        /// Allows the user to escape the signature capture in Windows Mobile Standard
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void signatureCapture1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Up)
            {
                e.Handled = true;
                this.SelectNextControl(signatureCapture1, false, true, false, true);
            }
            else if (e.KeyCode == Keys.Down)
            {
                e.Handled = true;
                this.SelectNextControl(signatureCapture1, true, true, false, true);
            }
        }

        /// Custom Handling for the back key
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BackKeyDown(object sender, KeyEventArgs e)
        {
            if ((e.KeyCode == System.Windows.Forms.Keys.Back))
            {
                // Back

                // if the back key is hit, close this dialog
                this.DialogResult = DialogResult.Cancel;
                this.Close();
            }
        }

        #endregion

        #region DeliverySignatureBase Methods

        /// <summary>
        /// check with the signature control if the sgnature has been provided
        /// </summary>
        /// <returns></returns>
        protected override bool SignatureCaptured()
        {
            return this.signatureCapture1.SignatureCaptured;
        }

        /// <summary>
        /// Create signature image file
        /// </summary>
        protected override void CreateSignatureImageFile(string filePath, ImageFormat imageFormat)
        {
            //Save the signature as a GIF file
            signatureCapture1.Save(filePath, imageFormat);

        }

        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -