public static string ToClientString(this ClientScanResultStorage storage) { if (storage == null) { throw new ArgumentNullException("storage"); } string text = storage.ClassifiedParts.ToClientString(); string text2 = storage.DlpDetectedClassificationObjects.ToClientString(); string text3 = storage.DlpDetectedClassificationObjects.ToNamesClientString(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat(ScanResultExtensions.ClientScanResultStorageToStringFormat, new object[] { storage.RecoveryOptions.ToString(), text, text2, text3 }); return(stringBuilder.ToString()); }
public static ClientScanResultStorage ToClientScanResultStorage(this string clientData) { string empty = string.Empty; string empty2 = string.Empty; ScanResultExtensions.SplitClientData(clientData, out empty, out empty2); string[] dcnames = ScanResultExtensions.GetDCNames(empty2); if (string.IsNullOrEmpty(empty)) { throw new ClientScanResultParseException("leftClientData is empty"); } string[] array = empty.Split(new char[] { '?' }); if (array == null || array.Length != 3) { throw new ClientScanResultParseException("parts are invalid or don't contain 3 elements"); } RecoveryOptions recoveryOptions; if (!Enum.TryParse <RecoveryOptions>(array[0], out recoveryOptions) || !(Enum.IsDefined(typeof(RecoveryOptions), recoveryOptions) | recoveryOptions.ToString().Contains(","))) { throw new ClientScanResultParseException("recoveryOptions is not a valid RecoveryOptions enum value"); } ClientScanResultStorage clientScanResultStorage = new ClientScanResultStorage(); clientScanResultStorage.RecoveryOptions = (int)recoveryOptions; clientScanResultStorage.ClassifiedParts = array[1].ToClassifiedParts(); clientScanResultStorage.DlpDetectedClassificationObjects = array[2].ToDlpDetectedClassificationObjects(); if (dcnames.Length != clientScanResultStorage.DlpDetectedClassificationObjects.Count) { throw new ClientScanResultParseException("Numberof dcNames don't match the number of DlpDetectedClassificationObjects."); } for (int i = 0; i < dcnames.Length; i++) { clientScanResultStorage.DlpDetectedClassificationObjects[i].ClassificationName = dcnames[i]; } return(clientScanResultStorage); }
// Token: 0x0600155E RID: 5470 RVA: 0x0004C06B File Offset: 0x0004A26B public ClientScanResultStorageProvider(string clientData, Item storeItem) : base(storeItem) { this.clientScanResultStorage = ClientScanResultStorage.CreateInstance(clientData); }