Esempio n. 1
0
        /// <summary>
        /// Analyze the results of the login query and call the callback.
        /// </summary>
        private void AnalyseResults(KmodQuery ignored)
        {
            if (OutMsg is K3p.kmo_invalid_config)
            {
                Res = WmLoginTicketQueryRes.InvalidCfg;
            }

            else if (OutMsg is K3p.kmo_get_kws_ticket)
            {
                try
                {
                    Res    = WmLoginTicketQueryRes.OK;
                    Ticket = new WmLoginTicket();
                    Ticket.FromB64Ticket(((K3p.kmo_get_kws_ticket)OutMsg).Ticket);
                }

                catch (Exception ex)
                {
                    Res     = WmLoginTicketQueryRes.MiscError;
                    OutDesc = "cannot parse ticket: " + ex.Message;
                }
            }

            else
            {
                Res = WmLoginTicketQueryRes.MiscError;
            }

            Callback2(this);
        }
Esempio n. 2
0
        /// <summary>
        /// Analyze the results of the login query and call the callback.
        /// </summary>
        private void AnalyseResults(KmodQuery ignored)
        {
            if (OutMsg is K3p.kmo_invalid_config)
            {
                Res = WmLoginTicketQueryRes.InvalidCfg;
            }

            else if (OutMsg is K3p.kmo_get_kws_ticket)
            {
                try
                {
                    Res = WmLoginTicketQueryRes.OK;
                    Ticket = new WmLoginTicket();
                    Ticket.FromB64Ticket(((K3p.kmo_get_kws_ticket)OutMsg).Ticket);
                }

                catch (Exception ex)
                {
                    Res = WmLoginTicketQueryRes.MiscError;
                    OutDesc = "cannot parse ticket: " + ex.Message;
                }
            }

            else
            {
                Res = WmLoginTicketQueryRes.MiscError;
            }

            Callback2(this);
        }