/// <summary> /// 获取指定成员名称的成员值的读写器。 /// </summary> /// <param name="key">成员名称</param> /// <returns>返回值的读写器</returns> public XFieldValueRW this[string key] { get { if (fieldsCache.TryGetValue(key, out var field)) { return(new XFieldValueRW(obj, field)); } if ((flags & XBindingFlags.RWNoFoundException) != 0) { throw new MissingMemberException(type.Name, key); } return(null); } }
public static bool TryParse(string name, out T value) { if (NameCache.TryGetValue(name, out var containedValue)) { value = (T)containedValue; return(true); } value = default(T); return(false); }
public static DbProviderFactory GetFactory(string providerName) { if (providerName == null) { throw new ArgumentNullException(nameof(providerName)); } if (ProviderTypesCache.TryGetValue(providerName, out var value)) { return(value); } return(ProviderTypesCache.LockGetOrAdd(providerName, name => SearchFactory(name))); }