private void downloadBtn_Click(object sender, EventArgs e) { if (!this.downloading) { if (Device.Instance.IsConnected()) { if (ApplicationSettings.Instance.Active) { Device.Instance.DownloadContacts(); this.downloadBtn.Text = "Downloading..."; this.downloading = true; this.downloadBtn.Invalidate(); } 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"); } } //this.downloadBtn.Enabled = false; }
public void SendSMS(string address, string text) { if (ApplicationSettings.Instance.Active) { Boolean bPresentDlg = true; if (address != null && text != null) { if (address.Length != 0 && text.Length != 0) { SMSCmd cmd = new SMSCmd(); cmd.Address = address; cmd.Text = text; sendCommand(cmd); bPresentDlg = false; } } if (bPresentDlg) { SMSDlg dlg = new SMSDlg(); dlg.setAddress(address); dlg.setText(text); dlg.Show(); } } else { BuyDlg dlg = new BuyDlg(); dlg.ShowDialog(); //MessageBox.Show("Upgrade to Blurts Pro to enable this feature.", "Blurts - by MLH Software"); } }
public void sendCommand(CmdBase msg) { if (s_stream != null && IsConnected()) { if (ApplicationSettings.Instance.Active || !msg.isProCmd()) { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] data = encoding.GetBytes(msg.ToString()); byte[] dataLen = BitConverter.GetBytes(IPAddress.HostToNetworkOrder((int)data.Length)); byte[] binaryLen = BitConverter.GetBytes((int)0); byte[] rv = new byte[dataLen.Length + binaryLen.Length + data.Length]; System.Buffer.BlockCopy(dataLen, 0, rv, 0, dataLen.Length); System.Buffer.BlockCopy(binaryLen, 0, rv, dataLen.Length, binaryLen.Length); System.Buffer.BlockCopy(data, 0, rv, dataLen.Length + binaryLen.Length, data.Length); if (Directory.Exists(ApplicationSettings.Instance.LocalDataPath + @"\debug\raw")) { FileStream stream = new FileStream(ApplicationSettings.Instance.LocalDataPath + @"\debug\raw\data_out.bin", FileMode.OpenOrCreate); BinaryWriter w = new BinaryWriter(stream); w.Seek((int)stream.Length, SeekOrigin.Begin); w.Write(rv, 0, rv.Length); w.Close(); } s_stream.Write(rv, 0, rv.Length); } 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"); } }
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"); } }
public void DialPhone(string phoneNumber) { if (ApplicationSettings.Instance.Active) { if (phoneNumber != null && phoneNumber.Length > 0) { CallCmd cmd = new CallCmd(); cmd.PhoneNumber = phoneNumber; sendCommand(cmd); } else { SMSContactDlg dlg = new SMSContactDlg(false); //DialDlg dlg = new DialDlg(); //Screen desktop = Screen.PrimaryScreen; //dlg.Location = new Point(desktop.WorkingArea.Width - dlg.Width - 10, desktop.WorkingArea.Height - dlg.Height - 10); if (dlg.ShowDialog() == DialogResult.OK) { String number = dlg.PhoneNumber; if (number.Length > 0) { CallCmd cmd = new CallCmd(); cmd.PhoneNumber = number; sendCommand(cmd); } } } } else { BuyDlg dlg = new BuyDlg(); dlg.ShowDialog(); //MessageBox.Show("Upgrade to Blurts Pro to enable this feature.", "Blurts - by MLH Software"); } }