Пример #1
0
        internal static NdapiMetaObject GetOrCreate(Type type)
        {
            NdapiMetaObject metaObject;

            if (_cache.TryGetValue(type, out metaObject))
            {
                return(metaObject);
            }

            metaObject = new NdapiMetaObject(type);
            _cache.Add(type, metaObject);
            return(metaObject);
        }
Пример #2
0
 /// <summary>
 /// Gets a <see cref="NdapiMetaObject"/> for the specified class.
 /// </summary>
 /// <param name="type">A Ndapi class.</param>
 /// <returns>The meta object instance.</returns>
 public static NdapiMetaObject GetMetaObjectFrom(Type type) => NdapiMetaObject.GetOrCreate(type);