public void RunMacro(string macroName) { if (IsConnected()) { if (ApplicationSettings.Instance.Active) { MacroAlert alert = new MacroAlert(); alert.MacroName = macroName; alert.ProcessMessage(); } else { BuyDlg dlg = new BuyDlg(); dlg.ShowDialog(); //MessageBox.Show("Upgrade to Blurts Pro to enable this feature.", "Blurts - by MLH Software"); } } else { MessageBox.Show("BlackBerry not connected.", "Blurts - by MLH Software"); } }
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); }