internal Type ResolveKnownType(Assembly assembly) { if (Helpers.IsNullOrEmpty(KnownTypeName)) { return(null); } try { Type type = Type.GetType(KnownTypeName); if (type != null) { return(type); } } catch { } try { int i = KnownTypeName.IndexOf(','); string fullName = (i > 0 ? KnownTypeName.Substring(0, i) : KnownTypeName).Trim(); Type type = (assembly == null ? Assembly.GetCallingAssembly() : assembly).GetType(fullName); if (type != null) { return(type); } } catch { } return(null); }
/// <summary> /// Creates a new instance of the ProtoIncludeAttribute. /// </summary> /// <param name="tag">The unique index (within the type) that will identify this data.</param> /// <param name="knownTypeName">The additional type to serialize/deserialize.</param> public ProtoIncludeAttribute(int tag, string knownTypeName) { if (tag <= 0) throw new ArgumentOutOfRangeException("tag", "Tags must be positive integers"); if (Helpers.IsNullOrEmpty(knownTypeName)) throw new ArgumentNullException("knownTypeName", "Known type cannot be blank"); this.tag = tag; this.knownTypeName = knownTypeName; }
public ProtoPartialMemberAttribute(int tag, string memberName) : base(tag) { if (Helpers.IsNullOrEmpty(memberName)) { throw new ArgumentNullException("memberName"); } this.memberName = memberName; }
// Token: 0x060000CA RID: 202 RVA: 0x0000280A File Offset: 0x00000A0A public ProtoPartialIgnoreAttribute(string memberName) { if (Helpers.IsNullOrEmpty(memberName)) { throw new ArgumentNullException("memberName"); } this.memberName = memberName; }
/// <summary> /// Creates a new ProtoMemberAttribute instance. /// </summary> /// <param name="tag">Specifies the unique tag used to identify this member within the type.</param> /// <param name="memberName">Specifies the member to be serialized.</param> public ProtoPartialMemberAttribute(int tag, string memberName) #if FALSE : base(tag) #endif { #if BLITCREMENTAL #else if (Helpers.IsNullOrEmpty(memberName)) { throw new ArgumentNullException("memberName"); } #endif this.memberName = memberName; }