Esempio n. 1
0
 public AlertBase(DisplayItemType ItemType, String alertName)
 {
     try
     {
         commonInit();
         put(KEY_ALERT_NAME, alertName);
         //put(KEY_VERSION, AboutDialog.APP_VERSION);
         put(KEY_ALERT_TYPE, (int)ItemType);
         //put(KEY_ACTIVATED, ActivationScreen.isKeyValid() ? "true" : "false");
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
 }
        void OnMsgArrivedEvent(object msg, EventArgs e)
        {
            try
            {
                AlertBase       alert = (AlertBase)msg;
                DisplayItemType type  = alert.ItemType;
                switch (type)
                {
                case DisplayItemType.STATUS:
                {
                    //processStatusAlert(new StatusAlert(data));
                    break;
                }

                case DisplayItemType.CONTACTS:
                {
                    string       data         = msg.ToString();
                    ContactAlert contactAlert = new ContactAlert(data);
                    this.downloadBtn.Text = "Download: " + contactAlert.Index + " left";
                    this.downloadBtn.Invalidate();

                    if (int.Parse(contactAlert.Index) % 10 == 0)
                    {
                        Display();
                    }

                    if (int.Parse(contactAlert.Index) == 1)
                    {
                        this.downloadBtn.Text = "Download";
                        this.downloading      = false;
                        this.downloadBtn.Invalidate();
                        Display();
                    }
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("BlackBerry_MsgArrivedEvent:" + Environment.NewLine + ex.ToString());
            }
        }
Esempio n. 3
0
        void OnMsgArrivedEvent(object msg, EventArgs e)
        {
            try
            {
                AlertBase       alert = (AlertBase)msg;
                DisplayItemType type  = alert.ItemType;
                string          data  = msg.ToString();
                switch (type)
                {
                case DisplayItemType.UNKNOWN:
                {
                    break;
                }

                case DisplayItemType.STATUS:
                {
                    //processStatusAlert(new StatusAlert(data));
                    break;
                }

                case DisplayItemType.CONNECT:
                {
                    //processConnectAlert(new ConnectAlert(data));
                    break;
                }

                case DisplayItemType.EMAIL:
                {
                    //processEmailAlert(new EmailAlert(data));
                    break;
                }

                case DisplayItemType.CALL:
                {
                    processCallAlert(new CallAlert(data));
                    break;
                }

                case DisplayItemType.LOCK:
                {
                    //processLockAlert(new LockAlert(data));
                    break;
                }

                case DisplayItemType.SMS:
                {
                    //processSMSAlert(new SMSAlert(data));
                    break;
                }

                case DisplayItemType.SCREEN:
                {
                    //processScreenCaptureAlert(new ScreenCaptureAlert(data));
                    break;
                }

                case DisplayItemType.CONTACTS:
                {
                    //processContactAlert(new ContactAlert(data));
                    break;
                }

                case DisplayItemType.CLIPBOARD:
                {
                    //processClipboardAlert(new ClipboardAlert(data));
                    break;
                }

                case DisplayItemType.DISCONNECT:
                {
                    //processDisconnectAlert(new DisconnectAlert(data));
                    break;
                }

                case DisplayItemType.LEVEL:
                {
                    //processLevelAlertAlert(new LevelAlert(data));
                    break;
                }

                case DisplayItemType.MACRO:
                {
                    //processMacroAlertAlert(new MacroAlert(data));
                    break;
                }

                case DisplayItemType.PIN_MSG:
                {
                    //processPINMsgAlert(new PINMsgAlert(data));
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("BlackBerry_MsgArrivedEvent:" + Environment.NewLine + ex.ToString());
            }
        }
Esempio n. 4
0
        static public AlertBase CreateAlert(string data)
        {
            AlertBase retVal = null;

            try
            {
                AlertBase       msg  = new AlertBase(data);
                DisplayItemType type = msg.ItemType;
                switch (type)
                {
                case DisplayItemType.UNKNOWN:
                {
                    break;
                }

                case DisplayItemType.STATUS:
                {
                    retVal = new StatusAlert(data);
                    break;
                }

                case DisplayItemType.CONNECT:
                {
                    retVal = new ConnectAlert(data);
                    break;
                }

                case DisplayItemType.EMAIL:
                {
                    retVal = new EmailAlert(data);
                    break;
                }

                case DisplayItemType.CALL:
                {
                    retVal = new CallAlert(data);
                    break;
                }

                case DisplayItemType.LOCK:
                {
                    retVal = new LockAlert(data);
                    break;
                }

                case DisplayItemType.SMS:
                {
                    retVal = new SMSAlert(data);
                    break;
                }

                case DisplayItemType.SCREEN:
                {
                    retVal = new ScreenCaptureAlert(data);
                    break;
                }

                case DisplayItemType.CONTACTS:
                {
                    retVal = new ContactAlert(data);
                    break;
                }

                case DisplayItemType.CLIPBOARD:
                {
                    retVal = new ClipboardAlert(data);
                    break;
                }

                case DisplayItemType.DISCONNECT:
                {
                    retVal = new DisconnectAlert(data);
                    break;
                }

                case DisplayItemType.LEVEL:
                {
                    retVal = new LevelAlert(data);
                    break;
                }

                case DisplayItemType.MACRO:
                {
                    retVal = new MacroAlert(data);
                    break;
                }

                case DisplayItemType.PIN_MSG:
                {
                    retVal = new PINMsgAlert(data);
                    break;
                }

                case DisplayItemType.INPUT_MSG:
                {
                    retVal = new InputAlert(data);
                    break;
                }

                case DisplayItemType.READFILE:
                {
                    retVal = new ReadFileAlert(data);
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("process Message Error:" + Environment.NewLine + ex.ToString());
                retVal = null;
            }
            return(retVal);
        }