/// <summary> /// Returns true if the <paramref name="type"/> is a DictionaryType with ValueType matching <paramref name="typeToMatch"/> /// </summary> /// <param name="type"></param> /// <param name="typeToMatch"></param> /// <returns></returns> public static bool IsDictionaryContainingType(this IModelType type, KnownPrimaryType typeToMatch) { DictionaryType dictionaryType = type as DictionaryType; PrimaryType dictionaryPrimaryType = dictionaryType?.ValueType as PrimaryType; return(dictionaryPrimaryType != null && dictionaryPrimaryType.IsPrimaryType(typeToMatch)); }
public PrimaryTypeGo(KnownPrimaryType primaryType) : base(primaryType) { Name.OnGet += v => { return(ImplementationName); }; }
/// <summary> /// Returns true if the <paramref name="type"/>is a SequenceType matching <paramref name="typeToMatch"/> /// </summary> /// <param name="type"></param> /// <param name="typeToMatch"></param> /// <returns></returns> public static bool IsSequenceContainingType(this IModelType type, KnownPrimaryType typeToMatch) { SequenceType sequenceType = type as SequenceType; PrimaryType sequencePrimaryType = sequenceType?.ElementType as PrimaryType; return(sequencePrimaryType != null && sequencePrimaryType.IsPrimaryType(typeToMatch)); }
public PrimaryTypeCs(KnownPrimaryType primaryType) : base(primaryType) { Name.OnGet += v => { return ImplementationName; }; }
public static bool PrimaryType(this IModelType type, KnownPrimaryType typeToMatch) { if (type == null) { return(false); } return(type is PrimaryType primaryType && primaryType.KnownPrimaryType == typeToMatch); }
public static bool IsPrimaryType(this IType type, KnownPrimaryType typeToMatch) { if (type == null) { return(false); } PrimaryType primaryType = type as PrimaryType; return(primaryType != null && primaryType.Type == typeToMatch); }
/// <summary> /// Returns true if the <paramref name="type"/> is a PrimaryType with KnownPrimaryType matching <paramref name="typeToMatch"/> /// or a DictionaryType with ValueType matching <paramref name="typeToMatch"/> or a SequenceType matching <paramref name="typeToMatch"/> /// </summary> /// <param name="type"></param> /// <param name="typeToMatch"></param> /// <returns></returns> public static bool IsOrContainsPrimaryType(this IModelType type, KnownPrimaryType typeToMatch) { if (type == null) { return(false); } if (type.IsPrimaryType(typeToMatch) || type.IsDictionaryContainingType(typeToMatch) || type.IsSequenceContainingType(typeToMatch)) { return(true); } return(false); }
/// <summary> /// Initializes a new instance of PrimaryType class from a known type. /// </summary> protected PrimaryType(KnownPrimaryType knownPrimaryType) { KnownPrimaryType = knownPrimaryType; Name = KnownPrimaryType.ToString(); }
protected PrimaryTypeCsa(KnownPrimaryType primaryType) : base(primaryType) { }
public PrimaryTypeModel(KnownPrimaryType knownPrimaryType) : this (new PrimaryType(knownPrimaryType)) { }
/// <summary> /// Returns true if the type is a PrimaryType with KnownPrimaryType matching typeToMatch. /// </summary> /// <param name="type"></param> /// <param name="typeToMatch"></param> /// <returns></returns> public static bool IsPrimaryType(this IModelType type, KnownPrimaryType typeToMatch) => typeToMatch == (type as PrimaryType)?.KnownPrimaryType;
public PrimaryTypeRb(KnownPrimaryType primaryType) : base(primaryType) { Name.OnGet += v => ImplementationName; }
public static bool IsPrimaryType(this IType type, KnownPrimaryType typeToMatch) { if (type == null) { return false; } PrimaryType primaryType = type as PrimaryType; return primaryType != null && primaryType.Type == typeToMatch; }
public PrimaryTypeOc(KnownPrimaryType type, string implName = null) : base(type) { Name.OnGet += v => implName ?? ImplementationName; }
public PrimaryTypeSDKImpl(KnownPrimaryType primary) : base(primary) { }
/// <summary> /// Initializes a new instance of PrimaryType class from a known type. /// </summary> public PrimaryType(KnownPrimaryType type) { Type = type; Name = Type.ToString(); }
public PrimaryTypeModel(KnownPrimaryType knownPrimaryType) : this(new PrimaryType(knownPrimaryType)) { }
public PrimaryTypePy(KnownPrimaryType primaryType) : base(primaryType) { Name.OnGet += v => ImplementationName; }
public PrimaryTypeJv(KnownPrimaryType type) : base(type) { Name.OnGet += v => ImplementationName; }