Ejemplo n.º 1
0
        /// <summary>
        /// Perform processing for this engine
        /// </summary>
        /// <param name="data">
        /// The <see cref="IFlowData"/> instance containing data for the
        /// current request.
        /// </param>
        /// <param name="deviceData">
        /// The <see cref="IDeviceDataHash"/> instance to populate with
        /// property values
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// Thrown if a required parameter is null
        /// </exception>
        protected override void ProcessEngine(IFlowData data, IDeviceDataHash deviceData)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }
            if (deviceData == null)
            {
                throw new ArgumentNullException(nameof(deviceData));
            }

            using (var relevantEvidence = new EvidenceDeviceDetectionSwig())
            {
                foreach (var evidenceItem in data.GetEvidence().AsDictionary())
                {
                    if (EvidenceKeyFilter.Include(evidenceItem.Key))
                    {
                        relevantEvidence.Add(new KeyValuePair <string, string>(
                                                 evidenceItem.Key,
                                                 evidenceItem.Value.ToString()));
                    }
                }

                // The results object is disposed in the dispose method of the
                // DeviceDataHash object.
#pragma warning disable CA2000 // Dispose objects before losing scope
                (deviceData as DeviceDataHash).SetResults(new ResultsSwigWrapper(_engine.process(relevantEvidence)));
#pragma warning restore CA2000 // Dispose objects before losing scope
            }
        }
Ejemplo n.º 2
0
        public override ResultsDeviceDetectionSwig processDeviceDetection(EvidenceDeviceDetectionSwig evidence)
        {
            global::System.IntPtr      cPtr = DeviceDetectionHashEngineModulePINVOKE.EngineHashSwig_processDeviceDetection__SWIG_0(swigCPtr, EvidenceDeviceDetectionSwig.getCPtr(evidence));
            ResultsDeviceDetectionSwig ret  = (cPtr == global::System.IntPtr.Zero) ? null : new ResultsDeviceDetectionSwig(cPtr, true);

            if (DeviceDetectionHashEngineModulePINVOKE.SWIGPendingException.Pending)
            {
                throw DeviceDetectionHashEngineModulePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EvidenceDeviceDetectionSwig obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Ejemplo n.º 4
0
 public ResultsHashSwig process(EvidenceDeviceDetectionSwig evidence)
 {
     return(_object.process(evidence));
 }