Beispiel #1
0
 // Отключение от сервера лицензий
 public static void myDisconnectSL()
 {
     if (TRsMemMap.vStateSL == TRsMemMap.eStateSL.DISCON)
     {
         return;
     }
     if (TRsMemMap.vStateSL == TRsMemMap.eStateSL.WAIT_DISCON)
     {
         return;
     }
     if (TRsMemMap.vStateSL == TRsMemMap.eStateSL.WAIT_CON)
     {
         return;
     }
     //
     if (LicenseConnection.Instance.Connected == false)
     {
         TRsMemMap.vStateSL = TRsMemMap.eStateSL.DISCON;
         return;
     }
     ;
     //
     TRsMemMap.vStateSL = TRsMemMap.eStateSL.WAIT_DISCON;
     LicenseConnection.Instance.Disconnect();
 }
Beispiel #2
0
        // Подключение к серверу лицензий
        public static void myConnectSL()
        {
            if (TRsMemMap.vStateSL == TRsMemMap.eStateSL.CON)
            {
                return;
            }
            if (TRsMemMap.vStateSL == TRsMemMap.eStateSL.WAIT_CON)
            {
                return;
            }
            if (TRsMemMap.vStateSL == TRsMemMap.eStateSL.WAIT_DISCON)
            {
                return;
            }
            //
            if (LicenseConnection.Instance.Connected == true)
            {
                TRsMemMap.vStateSL = TRsMemMap.eStateSL.CON;
                return;
            }
            ;
            //
            TRsMemMap.vStateSL = TRsMemMap.eStateSL.WAIT_CON;
            String St = TRsMemMap.dUrlSL;

            System.EventHandler <ConnectionEventArgs> connectionEventHandler = new EventHandler <ConnectionEventArgs>(lChangeConnectionStatus);
            LicenseConnection.Instance.TryConnect(St, connectionEventHandler);
        }
Beispiel #3
0
 // Реализация события подключения к серверу лицензий
 private static void lChangeConnectionStatus(object sender, ConnectionEventArgs e)
 {
     if (e.Connected)
     {
         TRsMemMap.vStateSL = TRsMemMap.eStateSL.CON;
     }
     else
     {
         TRsMemMap.vStateSL = TRsMemMap.eStateSL.DISCON;
     };
 }