Esempio n. 1
0
        public bool TryResolveType <T>(string name, string @namespace, out T type) where T : OdcmType
        {
            string canonicalName = OdcmObject.MakeCanonicalName(name, @namespace);

            var odcmType = _Types.FirstOrDefault(t => t.CanonicalName().Equals(canonicalName, StringComparison.InvariantCulture));

            type = odcmType as T;
            return(type != null);
        }
Esempio n. 2
0
        public bool TryResolveType <T>(string name, string @namespace, out T type) where T : OdcmType
        {
            string canonicalName = OdcmObject.MakeCanonicalName(name, @namespace);

            foreach (OdcmType candidate in _Types)
            {
                if (candidate.CanonicalName().Equals(canonicalName, StringComparison.InvariantCulture))
                {
                    type = candidate as T;
                    return(true);
                }
            }

            type = null;

            return(false);
        }