public override void DeleteAccessProfile(string Token) { ConfStorageLoad(); if (ConfStorage.AccessProfileList.ContainsKey(Token)) { if (AccessProfileInUse(Token)) { string message = string.Format("Access Profile with token {0} is in use.", Token); LoggingService.LogMessage(message, DUT.PACS.Simulator.ExternalLogging.MessageType.Error); FaultLib.ReturnFault(message, new string[] { "Sender", "InvalidArgVal", "ReferenceInUse" }); } else { ConfStorage.AccessProfileList.Remove(Token); EventServer.ConfigurationAccessProfileRemovedEvent(this, Token); LoggingService.LogMessage(string.Format("Access Profile with token '{0}' was deleted.", Token), DUT.PACS.Simulator.ExternalLogging.MessageType.Message); } } else { string message = string.Format("Access Profile with token {0} does not exist", Token); LoggingService.LogMessage(message, DUT.PACS.Simulator.ExternalLogging.MessageType.Error); FaultLib.ReturnFault(message, new string[] { "Sender", "InvalidArgVal", "NotFound" }); } ConfStorageSave(); }