예제 #1
0
        private void AddCapability(OdcmObject odcmObject, OdcmCapability capability)
        {
            var capabilities = _propertyCapabilitiesCache.GetCapabilities(odcmObject);

            // Check if this annotation was overridden by the object
            bool overridden = capabilities.Any(x => x.TermName == capability.TermName);

            if (!overridden)
            {
                capabilities.Add(capability);
            }
        }
예제 #2
0
        private static OdcmCapability DefaultCapability(OdcmObject odcmObject, string term)
        {
            OdcmCapability result = UserDefaultCapabilityProvider?.Invoke(odcmObject, term);

            if (result == null)
            {
                DefaultProvider func;
                if (_wellKnownCapabilities.TryGetValue(term, out func))
                {
                    result = func(odcmObject, term);
                }
            }
            return(result);
        }
예제 #3
0
        private void AddCapability(OdcmObject odcmObject, OdcmCapability capability)
        {
            try
            {
                var capabilities = _propertyCapabilitiesCache.GetCapabilities(odcmObject);

                // Check if this annotation was overridden by the object
                bool overridden = capabilities.Any(x => x.TermName == capability.TermName);

                if (!overridden)
                {
                    capabilities.Add(capability);
                }
            }
            catch (Exception e)
            {
                Logger.Error(e, e.Message);
            }
        }
예제 #4
0
 public static string GetShortName(this OdcmCapability capability)
 {
     return(_wellKnownCapabilityNames[OdcmProjection.ToInternal(capability.TermName)]);
 }