コード例 #1
0
        // Token: 0x06001507 RID: 5383 RVA: 0x0004A82C File Offset: 0x00048A2C
        protected override void OnDataClassificationsRetrieved(FilteringResults filteringResults)
        {
            if (this.invokeFips)
            {
                TimeSpan timeSpan = DateTime.UtcNow - this.fipsScanStartTime;
                this.policyTipRequestLogger.AppendExtraData("FipsLatency", timeSpan.TotalMilliseconds.ToString());
                if (filteringResults != null)
                {
                    StringBuilder stringBuilder = new StringBuilder();
                    if (filteringResults.Streams != null)
                    {
                        foreach (StreamIdentity streamIdentity in filteringResults.Streams)
                        {
                            stringBuilder.Append(string.Format("(StreamName:{0}/StreamId:{1}/ParentId:{2})", streamIdentity.Name, streamIdentity.Id, streamIdentity.ParentId));
                        }
                    }
                    StringBuilder stringBuilder2 = new StringBuilder();
                    if (filteringResults.ScanResults != null)
                    {
                        foreach (ScanResult scanResult in filteringResults.ScanResults)
                        {
                            stringBuilder2.Append(string.Format("(StreamName:{0}/StreamId:{1}/ElapsedTime:{2})", scanResult.Stream.Name, scanResult.Stream.Id, scanResult.ElapsedTime));
                        }
                    }
                    this.policyTipRequestLogger.AppendExtraData("FipsParsedStreams", stringBuilder.ToString());
                    this.policyTipRequestLogger.AppendExtraData("FipsPerScanResultLatency", stringBuilder2.ToString());
                }
            }
            IEnumerable <DiscoveredDataClassification> enumerable = FipsResultParser.ParseDataClassifications(filteringResults, base.Tracer);

            this.policyTipRequestLogger.AppendData("NewClassifications", DiscoveredDataClassification.ToString(enumerable));
            IEnumerable <DiscoveredDataClassification> dlpDetectedClassificationObjects = this.ScanResultStorageProvider.GetDlpDetectedClassificationObjects();

            this.policyTipRequestLogger.AppendData("OldClassifications", DiscoveredDataClassification.ToString(dlpDetectedClassificationObjects));
            IEnumerable <DiscoveredDataClassification> enumerable2 = FipsResultParser.UnionDiscoveredDataClassificationsFromDistinctStreams(dlpDetectedClassificationObjects, enumerable);

            this.policyTipRequestLogger.AppendData("UnionClassifications", DiscoveredDataClassification.ToString(enumerable2));
            base.SetDataClassifications(enumerable2);
            this.ScanResultStorageProvider.SetHasDlpDetectedClassifications();
            this.ScanResultStorageProvider.SetDlpDetectedClassificationObjects(enumerable2);
            StringBuilder stringBuilder3 = new StringBuilder();

            foreach (DiscoveredDataClassification discoveredDataClassification in enumerable2)
            {
                stringBuilder3.Append(discoveredDataClassification.Id);
                stringBuilder3.Append("|");
            }
            this.ScanResultStorageProvider.SetDlpDetectedClassifications(stringBuilder3.ToString());
            if (!enumerable2.Any <DiscoveredDataClassification>())
            {
                this.NoContentMatch = true;
            }
        }
コード例 #2
0
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            if (this.FileData == null || !this.FileData.Any <byte>())
            {
                throw new ErrorFileIsTooSmallForFingerprintException();
            }
            if (this.FileData.Length > 15728640)
            {
                throw new ErrorFileIsTooLargeForFingerprintException(this.FileData.Length, 15728640);
            }
            int textScanLimit = this.GetTextScanLimit();

            try
            {
                using (MemoryStream memoryStream = new MemoryStream(this.FileData))
                {
                    string fileName = "Default";
                    using (FileFilteringServiceInvokerRequest fileFilteringServiceInvokerRequest = FileFilteringServiceInvokerRequest.CreateInstance(fileName, memoryStream, textScanLimit, base.CurrentOrgContainerId.ObjectGuid.ToString()))
                    {
                        base.WriteVerbose(Strings.VerboseBeginTextExtraction(this.FileData.Length, textScanLimit));
                        FilteringResults unifiedContentResults = UnifiedContentServiceInvoker.GetUnifiedContentResults(fileFilteringServiceInvokerRequest);
                        base.WriteVerbose(Strings.VerboseEndTextExtraction(unifiedContentResults.Streams.Count));
                        List <StreamIdentity> list = (from streamId in unifiedContentResults.Streams
                                                      where NewFingerprint.IsTextAvailableStream(streamId)
                                                      select streamId).ToList <StreamIdentity>();
                        string streamNames = string.Join(";", from streamId in list
                                                         select string.Format("{0}: {1}", streamId.Name, string.Join <StreamType>(",", streamId.Types ?? new StreamType[0])));
                        base.WriteVerbose(Strings.VerboseExtractedTextStreams(list.Count, streamNames));
                        StreamIdentity streamIdentity = unifiedContentResults.Streams.FirstOrDefault((StreamIdentity streamId) => streamId.ParentId == 0);
                        if (!NewFingerprint.IsSupportedFileType(streamIdentity))
                        {
                            throw new ErrorFileTypeIsUnsupportedException();
                        }
                        StreamIdentity streamIdentity2 = null;
                        if (NewFingerprint.IsTextAvailableStream(streamIdentity))
                        {
                            streamIdentity2 = streamIdentity;
                        }
                        else if (list.Count > 0)
                        {
                            streamIdentity2 = list[0];
                        }
                        if (streamIdentity2 == null)
                        {
                            throw new ErrorFileHasNoTextContentException();
                        }
                        if (RuleAgentResultUtils.HasExceededProcessingLimit(streamIdentity2))
                        {
                            throw new ErrorExceededTextScanLimitException(textScanLimit);
                        }
                        if (list.Count > 1 && (streamIdentity.Types == null || streamIdentity.Types.Length != 1 || streamIdentity.Types[0] != 3))
                        {
                            this.WriteWarning(Strings.WarningMultipleStreamForFingerprint(list.Count, streamIdentity2.Name));
                        }
                        this.extractedText = streamIdentity2.Content.TextReader.ReadToEnd();
                        base.WriteVerbose(Strings.VerboseSelectedTextStream(this.extractedText.Length, this.extractedText));
                    }
                }
            }
            catch (FilteringServiceFailureException innerException)
            {
                throw new ErrorFailedExtractTextForFingerprintException(innerException);
            }
            TaskLogger.LogExit();
        }
コード例 #3
0
    void Update()
    {
        RaycastHit hit;

        float theDistance = -1.0f;

        Vector3 forward = transform.TransformDirection(Vector3.forward) * 10000;

        Debug.DrawRay(transform.position, forward, Color.red);


        if (Physics.Raycast(transform.position, (forward), out hit))
        {
            theDistance = hit.distance;
            print(theDistance + " " + hit.collider.gameObject.name);

            if (hit.collider.gameObject.name == "ProductsBtn")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("Product Scene", Color.black, 2.0f);
                }
            }
            if (hit.collider.gameObject.name == "BasketButton")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("Basket Scene", Color.black, 2.0f);
                }
            }

            if (hit.collider.gameObject.name == "OrdersBtn")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("OrdersScene", Color.black, 2.0f);
                }
            }

            if (hit.collider.gameObject.name == "BasketButton")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("Basket Scene", Color.black, 2.0f);
                }
            }

            if (hit.collider.gameObject.name == "HomeButton")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("Home Scene", Color.black, 2.0f);
                }
            }

            if (hit.collider.gameObject.name == "view3Dbtn")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("3DObjectScene", Color.black, 2.0f);
                }
            }

            if (hit.collider.gameObject.name == "ProdButtonHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("Product Description", Color.black, 2.0f);
                }
            }

            if (hit.collider.gameObject.name == "backBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("Basket Scene", Color.black, 2.0f);
                }
            }

            if (hit.collider.gameObject.name == "view3dBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    Initiate.Fade("3DObjectScene", Color.black, 2.0f);
                }
            }

            if (hit.collider.gameObject.name == "addToBasketBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    ProductDescription.addToBasket();
                }
            }

            if (hit.collider.gameObject.name == "CheckOutBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    checkOutPanel.gameObject.SetActive(true);
                }
            }

            if (hit.collider.gameObject.name == "cancelBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    checkOutPanel.gameObject.SetActive(false);
                }
            }
            if (hit.collider.gameObject.name == "purchaseBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    confirmationPopUp.gameObject.SetActive(true);
                }
            }

            if (hit.collider.gameObject.name == "cnclBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    confirmationPopUp.gameObject.SetActive(false);
                }
            }

            if (hit.collider.gameObject.name == "continueBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    BasketProducts.proceedWithOrder();
                }
            }

            if (hit.collider.gameObject.name == "removeBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    ProductDescription.removeFromBasket();
                    itemPanelOnBasket.gameObject.SetActive(false);
                }
            }

            if (hit.collider.gameObject.name == "GoBtnHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    filterPrint.text = FilteringResults.test();
                }
            }

            if (hit.collider.gameObject.name == "openSizeDrpHelper")
            {
                if (Input.GetKeyDown(KeyCode.P))
                {
                    FetchSizesFromDb.sizeDropdown();
                    sizeDropdown.gameObject.SetActive(true);
                    sizeDropdownTemplate.gameObject.SetActive(true);
                }
            }
        }
    }