Exemplo n.º 1
0
 /// <summary>
 /// close dongle before form closing
 /// </summary>
 private void DongleForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.dongle != null)
     {
         this.dongle.Dispose();
         this.dongle = null;
     }
 }
Exemplo n.º 2
0
 public static IDongle GetDongle()
 {
     if (ContextManager.dongle == null)
     {
         ContextManager.dongle = applicationContext.GetObject <IDongle>(configSelected[ContextConst.DongleSelectedKey]);
     }
     return(ContextManager.dongle);
 }
Exemplo n.º 3
0
        private void DongleForm_Load(object sender, EventArgs e)
        {
            this.logger = ContextManager.GetLogger();
            this.dongle = ContextManager.GetDongle();

            this.UserRootKey.Text = BitConverter.ToString(ByteUtil.Malloc(16, 0x0a));
            this.TestPlain.Text   = "01234567";

            Update();

            RefreshDongle(true);
        }
Exemplo n.º 4
0
        public static void Close()
        {
            if (ContextManager.dongle != null)
            {
                ContextManager.dongle.Close();
                ContextManager.dongle = null;
            }

            if (ContextManager.reader != null)
            {
                ContextManager.reader.Close();
                ContextManager.reader = null;
            }
        }
Exemplo n.º 5
0
 static DongleUtil()
 {
     dongle = ContextManager.GetDongle();
 }