Пример #1
0
        /// <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));
        }
Пример #2
0
 public PrimaryTypeGo(KnownPrimaryType primaryType) : base(primaryType)
 {
     Name.OnGet += v =>
     {
         return(ImplementationName);
     };
 }
Пример #3
0
        /// <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));
        }
Пример #4
0
 public PrimaryTypeCs(KnownPrimaryType primaryType) : base(primaryType)
 {
     Name.OnGet += v =>
     {
         return ImplementationName;
     };
 }
Пример #5
0
        public static bool PrimaryType(this IModelType type, KnownPrimaryType typeToMatch)
        {
            if (type == null)
            {
                return(false);
            }

            return(type is PrimaryType primaryType && primaryType.KnownPrimaryType == typeToMatch);
        }
Пример #6
0
        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);
        }
Пример #7
0
        /// <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);
        }
Пример #8
0
 /// <summary>
 ///     Initializes a new instance of PrimaryType class from a known type.
 /// </summary>
 protected PrimaryType(KnownPrimaryType knownPrimaryType)
 {
     KnownPrimaryType = knownPrimaryType;
     Name             = KnownPrimaryType.ToString();
 }
Пример #9
0
 protected PrimaryTypeCsa(KnownPrimaryType primaryType) : base(primaryType)
 {
 }
Пример #10
0
 public PrimaryTypeModel(KnownPrimaryType knownPrimaryType)
     : this (new PrimaryType(knownPrimaryType))
 {
 }
Пример #11
0
 /// <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;
Пример #12
0
 public PrimaryTypeRb(KnownPrimaryType primaryType) : base(primaryType)
 {
     Name.OnGet += v => ImplementationName;
 }
Пример #13
0
        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;
 }
Пример #15
0
 public PrimaryTypeSDKImpl(KnownPrimaryType primary)
     : base(primary)
 {
 }
Пример #16
0
 /// <summary>
 /// Initializes a new instance of PrimaryType class from a known type.
 /// </summary>
 public PrimaryType(KnownPrimaryType type)
 {
     Type = type;
     Name = Type.ToString();
 }
Пример #17
0
 /// <summary>
 /// Initializes a new instance of PrimaryType class from a known type.
 /// </summary>
 public PrimaryType(KnownPrimaryType type)
 {
     Type = type;
     Name = Type.ToString();
 }
Пример #18
0
 /// <summary>
 ///     Initializes a new instance of PrimaryType class from a known type.
 /// </summary>
 protected PrimaryType(KnownPrimaryType knownPrimaryType)
 {
     KnownPrimaryType = knownPrimaryType;
     Name = KnownPrimaryType.ToString();
 }
Пример #19
0
 public PrimaryTypeModel(KnownPrimaryType knownPrimaryType)
     : this(new PrimaryType(knownPrimaryType))
 {
 }
Пример #20
0
 protected PrimaryTypeCsa(KnownPrimaryType primaryType) : base(primaryType)
 {
 }
Пример #21
0
 public PrimaryTypePy(KnownPrimaryType primaryType) : base(primaryType)
 {
     Name.OnGet += v => ImplementationName;
 }
Пример #22
0
 public PrimaryTypeJv(KnownPrimaryType type)
     : base(type)
 {
     Name.OnGet += v => ImplementationName;
 }