コード例 #1
0
        /// <summary>
        /// Return a probe given a probeCapabilities. If exists more that one probe with these capabilities,
        /// it return a first probe.
        /// </summary>
        /// <param name="probeCapabilities">The probe capabilities.</param>
        /// <returns></returns>
        public IProbe GetProbe(IProbeCapabilities probeCapabilities)
        {
            LoadProbes();

            var probe =
                this.probes.SingleOrDefault(
                    p =>
                    (p.Metadata.OvalObject.Equals(probeCapabilities.OvalObject) &&
                     (p.Metadata.PlataformName.Equals(probeCapabilities.PlataformName) ||
                      p.Metadata.PlataformName.Equals(FamilyEnumeration.undefined))));

            if (probe != null)
            {
                return(probe.Value);
            }
            return(null);
        }
コード例 #2
0
        public IEnumerable <SelectedProbe> GetNotSupportedObjects(IEnumerable <ObjectType> objectTypes, FamilyEnumeration plataform)
        {
            List <SelectedProbe> selectedProbes = new List <SelectedProbe>();

            var objectTypesByComponentString =
                from t in objectTypes
                group t by t.ComponentString into types
                select new { Capability = types.Key, objectsTypes = types };

            foreach (var type in objectTypesByComponentString)
            {
                IProbeCapabilities capability = this.CreateProbeCapability(type.Capability, plataform);
                IProbe             probe      = this.GetProbe(capability);
                if (probe == null)
                {
                    probe = this.probes.First().Value;
                    SelectedProbe selectedProbe = new SelectedProbe(probe, type.objectsTypes, (ProbeCapabilities)capability);
                    selectedProbes.Add(selectedProbe);
                }
            }
            return(selectedProbes);
        }
コード例 #3
0
ファイル: ProbeManager.cs プロジェクト: jonaslsl/modSIC
        /// <summary>
        /// Return a probe given a probeCapabilities. If exists more that one probe with these capabilities,
        /// it return a first probe.
        /// </summary>
        /// <param name="probeCapabilities">The probe capabilities.</param>
        /// <returns></returns>
        public IProbe GetProbe(IProbeCapabilities probeCapabilities)
        {
            LoadProbes();

            var probe = 
                this.probes.SingleOrDefault(
                    p => 
                        (p.Metadata.OvalObject.Equals(probeCapabilities.OvalObject) &&
                         (p.Metadata.PlataformName.Equals(probeCapabilities.PlataformName) ||
                          p.Metadata.PlataformName.Equals(FamilyEnumeration.undefined))));
            if (probe != null)
            {
                return probe.Value;
            }
            return null;
        }