// // Summary: // Delete message directly from connected modem // // Parameters: // scope: // Scope Delete (all/by index) // // storage: // Message storage (SIM / Phone). public Boolean DeleteSMS(DeleteScope scope, string storage) { bool result = false; try { comm.DeleteMessages(scope, storage); return(true); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(result); }
/// <summary> /// Deletes the specified group of messages. /// </summary> /// <param name="scope">Specifies the messages that are affected by this command.</param> /// <param name="storage">The storage to use.</param> /// <remarks> /// To delete a single message, use the <see cref="M:GsmComm.GsmCommunication.GsmCommMain.DeleteMessage(System.Int32,System.String)" /> function. /// <seealso cref="M:GsmComm.GsmCommunication.GsmCommMain.DeleteMessage(System.Int32,System.String)" /> /// </remarks> public void DeleteMessages(DeleteScope scope, string storage) { int num = (int)scope; DeleteFlag deleteFlag = (DeleteFlag)Enum.Parse(typeof(DeleteFlag), num.ToString()); string[] str = new string[5]; str[0] = "Deleting \""; str[1] = scope.ToString(); str[2] = "\" messages in storage \""; str[3] = storage; str[4] = "\"..."; this.LogIt(LogLevel.Info, string.Concat(str)); this.theDevice.SelectReadStorage(storage); this.theDevice.DeleteMessage(1, deleteFlag); }
protected void DelAllSMS(DeleteScope scope) { string storage = PhoneStorageType.Sim; // ALTERNATIVE: PhoneStorageType.Phone try { // Delete the message with the specified index from storage comm.DeleteMessages(DeleteScope.All, storage); } catch (Exception ex) { Log("ERROR", "Exception in Deleting SMS from GSM Modem: " + ex.Message); } }