public void SetMember(MemberInfo member0) { lock (M2C) { M2C[member0] = this; } if (member0 is Type) { IsNonValue = true; return; } member = member0; if (MemberInfoExtensions.MemberIsReadOnly(member0)) { // cant restore? // SkipSaveOnExit = true; IsReadOnly = true; } IsStatic = MemberInfoExtensions.MemberIsStatic(member0); UseSingleton = !IsStatic; ReturnType = MemberInfoExtensions.MemberReturnType(member0); if (ReturnType.IsGenericType && ReturnType.GetGenericTypeDefinition() == (typeof(ListAsSet <>))) { return; } }
public static bool CantBeSingletonValueMember(MemberInfo fnd0) { if (fnd0 == null) { return(true); } if (fnd0 is _EventInfo) { return(true); } if (fnd0 is Type) { return(true); } if (!MemberInfoExtensions.MemberIsStatic(fnd0)) { return(true); } if (fnd0.MemberReturnType() == null) { return(true); } return(false); }