// Token: 0x06000017 RID: 23 RVA: 0x000027A4 File Offset: 0x000009A4
        public void SetClassificationResults(ICAClassificationResultCollection results)
        {
            if (ULS.ShouldTrace(ULSCat.msoulscat_SEARCH_DataLossPrevention, 100))
            {
                ULS.SendTraceTag(4850008U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 100, "FASTClassificationItem.SetClassificationResults :: saving results for [{0}]", new object[]
                {
                    this.ItemId
                });
            }
            IUpdateableBucketField updateableBucketField = this.record[this.managedPropertiesPosition] as IUpdateableBucketField;

            if (updateableBucketField != null)
            {
                if (this.persistClassificationData)
                {
                    updateableBucketField.AddField(this.lastScanPropertyName, StandardFields.GetStandardDateTimeField(new DateTime?(DateTime.UtcNow)), BuiltInTypes.DateTimeType);
                }
                ICollection <long?>  collection  = new List <long?>();
                ICollection <long?>  collection2 = new List <long?>();
                ICollection <string> collection3 = new List <string>();
                HashSet <long>       hashSet     = new HashSet <long>();
                if (results != null && results.Count > 0)
                {
                    this.resultCount = results.Count;
                    for (int i = 0; i < this.resultCount; i++)
                    {
                        ICAClassificationResult icaclassificationResult = results[i + 1];
                        if (ULS.ShouldTrace(ULSCat.msoulscat_SEARCH_DataLossPrevention, 100))
                        {
                            ULS.SendTraceTag(4850009U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 100, "FASTClassificationItem.SetClassificationResults :: Results Found :: package={0} ruleId={1}", new object[]
                            {
                                icaclassificationResult.RulePackageID,
                                icaclassificationResult.ID
                            });
                        }
                        long?resultBase = this.ruleStore.GetResultBase(icaclassificationResult.RulePackageID, icaclassificationResult.ID);
                        if (resultBase == null)
                        {
                            ULS.SendTraceTag(6038295U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 50, "FASTClassificationItem.SetClassificationResults :: Unkwown rule ID in result (should not happen). :: package={0} ruleId={1}", new object[]
                            {
                                icaclassificationResult.RulePackageID,
                                icaclassificationResult.ID
                            });
                        }
                        else
                        {
                            long value = resultBase.Value;
                            if (!hashSet.Add(value))
                            {
                                ULS.SendTraceTag(5833436U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 50, "FASTClassificationItem.SetClassificationResults :: Duplicate rule entry is being ignored.  Duplicate rule entries should not happen. :: package={0} ruleId={1}", new object[]
                                {
                                    icaclassificationResult.RulePackageID,
                                    icaclassificationResult.ID
                                });
                            }
                            else
                            {
                                long value2 = value + (long)((int)icaclassificationResult.GetAttributeValue("BD770258-EA9C-4162-B79C-7AD408EC7CD5"));
                                long value3 = value + (long)((int)icaclassificationResult.GetAttributeValue("AFF85B32-1BA9-4EDE-9286-F08A7EE5A421"));
                                collection.Add(new long?(value2));
                                collection2.Add(new long?(value3));
                                collection3.Add(icaclassificationResult.ID);
                            }
                        }
                    }
                    if (this.persistClassificationData && this.resultCount > 0)
                    {
                        if (ULS.ShouldTrace(ULSCat.msoulscat_SEARCH_DataLossPrevention, 100))
                        {
                            ULS.SendTraceTag(4850010U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 100, "FASTClassificationItem.SetClassificationResults :: Updating managed properties");
                        }
                        IUpdateableListField <long?> updateableListField = (IUpdateableListField <long?>)StandardFields.ListDescriptor <long?>(BuiltInTypes.Int64Type).CreateField();
                        updateableListField.Value = collection;
                        updateableBucketField.AddField(this.countPropertyName, updateableListField, BuiltInTypes.ListType(BuiltInTypes.Int64Type));
                        updateableListField       = (IUpdateableListField <long?>)StandardFields.ListDescriptor <long?>(BuiltInTypes.Int64Type).CreateField();
                        updateableListField.Value = collection2;
                        updateableBucketField.AddField(this.confidencePropertyName, updateableListField, BuiltInTypes.ListType(BuiltInTypes.Int64Type));
                        IUpdateableListField <string> updateableListField2 = (IUpdateableListField <string>)StandardFields.ListDescriptor <string>(BuiltInTypes.StringType).CreateField();
                        updateableListField2.Value = collection3;
                        updateableBucketField.AddField(this.typePropertyName, updateableListField2, BuiltInTypes.ListType(BuiltInTypes.StringType));
                    }
                }
            }
        }
        // Token: 0x060000AE RID: 174 RVA: 0x00004A9C File Offset: 0x00002C9C
        public override void ProcessRecordCore(IRecord record)
        {
            Guid tenantId = this.GetTenantId(record);

            if (!this.isIPClassificationQueryEnabled)
            {
                base.SetNextRecord();
                return;
            }
            IUpdateableBucketField updateableBucketField = record[this.otherPosition] as IUpdateableBucketField;

            if (updateableBucketField != null)
            {
                for (int i = 0; i < updateableBucketField.FieldCount; i++)
                {
                    string text = updateableBucketField.Name(i);
                    if (string.Equals(text, "SensitiveType", StringComparison.OrdinalIgnoreCase))
                    {
                        IUpdateableListField <string> updateableListField = updateableBucketField[text] as IUpdateableListField <string>;
                        if (updateableListField == null)
                        {
                            ULS.SendTraceTag(5833439U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 20, "DLPQuerySensitiveResultTranslationProducer.ProcessRecordCore :: tenantId={0}, fieldName={1}; Found a result entry for the field name (expected to represent the sensitive type list), but its type was not IUpdateableListField<string> or its value was null.  Cannot do any data-loss-prevention result-set translation.", new object[]
                            {
                                tenantId,
                                text
                            });
                        }
                        else
                        {
                            for (int j = 0; j < updateableListField.Count; j++)
                            {
                                string text2 = DLPQuerySensitiveResultTranslationOperator.Store.RuleIdToRuleName(updateableListField[j]);
                                if (text2 == null)
                                {
                                    ULS.SendTraceTag(5833440U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 20, "DLPQuerySensitiveResultTranslationProducer.ProcessRecordCore :: tenantId={0}, fieldIndex={1}, fieldValue={2}; Found a result entry for the field name (expected to represent the sensitive type list), but the value at this index was either null or an invalid rule ID.  Cannot translate this value.", new object[]
                                    {
                                        tenantId,
                                        j,
                                        updateableListField[j]
                                    });
                                }
                                else
                                {
                                    updateableListField[j] = text2;
                                }
                            }
                        }
                    }
                    else if (string.Equals(text, "SensitiveMatchCount", StringComparison.OrdinalIgnoreCase) || string.Equals(text, "SensitiveMatchConfidence", StringComparison.OrdinalIgnoreCase))
                    {
                        IUpdateableListField <long?> updateableListField2 = updateableBucketField[text] as IUpdateableListField <long?>;
                        long?[] array = updateableBucketField[text].Value as long?[];
                        if (array == null || updateableListField2 == null)
                        {
                            ULS.SendTraceTag(5833441U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 20, "DLPQuerySensitiveResultTranslationProducer.ProcessRecordCore :: tenantId={0}, fieldName={1}; Found a result entry for the field name, but its value was null or not of type long?[] or the field was not of type IUpdateableListField<long?>.  Cannot do any data-loss-prevention result-set translation.", new object[]
                            {
                                tenantId,
                                text
                            });
                        }
                        else
                        {
                            for (int k = 0; k < array.Length; k++)
                            {
                                array[k] &= (long)((ulong)-1);
                            }
                            updateableListField2.Value = array;
                        }
                    }
                }
            }
            else
            {
                ULS.SendTraceTag(5833442U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 20, "DLPQuerySensitiveResultTranslationProducer.ProcessRecordCore :: tenantId={0}; The 'Other' field in the record was null, so we cannot do any data-loss-prevention result-set translation.", new object[]
                {
                    tenantId
                });
            }
            base.SetNextRecord();
        }
        // Token: 0x060000BE RID: 190 RVA: 0x00004E74 File Offset: 0x00003074
        protected override void ProcessRecordInScopeIterationMode()
        {
            IField field = this.holder[this.tenantIdPosition];

            if (field != null)
            {
                this.tenantId = (Guid)field.Value;
            }
            else
            {
                ULS.SendTraceTag(5833443U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 50, "DLPQuerySensitiveTypeTranslationProducer.ProcessRecordInScopeIterationMode :: Could not extract the tenant ID from the record.  Using the empty Guid.");
            }
            if (!VariantConfiguration.IsFeatureEnabled(39, this.tenantId.ToString()))
            {
                return;
            }
            try
            {
                IUpdateableListField <string> updateableListField = this.holder[this.selectPropertiesPosition] as IUpdateableListField <string>;
                if (updateableListField != null)
                {
                    bool flag  = false;
                    bool flag2 = false;
                    int  num   = 0;
                    while (num < updateableListField.Count && !flag2)
                    {
                        string b = updateableListField[num];
                        if (string.Equals("SensitiveType", b, StringComparison.OrdinalIgnoreCase))
                        {
                            flag2 = true;
                        }
                        else if (string.Equals("SensitiveMatchCount", b, StringComparison.OrdinalIgnoreCase) || string.Equals("SensitiveMatchConfidence", b, StringComparison.OrdinalIgnoreCase))
                        {
                            flag = true;
                        }
                        num++;
                    }
                    if (flag && !flag2)
                    {
                        updateableListField.Add("SensitiveType");
                    }
                }
                base.ProcessRecordInScopeIterationMode();
            }
            catch (ThreadAbortException)
            {
            }
            catch (OutOfMemoryException)
            {
                throw;
            }
            catch (SecurityAccessDeniedException)
            {
                throw;
            }
            catch (ArgumentException)
            {
                throw;
            }
            catch (Exception ex)
            {
                ULS.SendTraceTag(5833472U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 10, "DLPQuerySensitiveTypeTranslationProducer.ProcessRecordInScopeIterationMode :: tenantId={0}; exception={1}", new object[]
                {
                    this.tenantId,
                    ex
                });
                throw;
            }
        }