Beispiel #1
0
        public static IEnumerable <Type> RetrieveKnownConditionValueTypes()
        {
            List <Type> knownTypes = new List <Type>();

            KnownTypesProvider.AddKnownAttributeTypes(knownTypes);
            return((IEnumerable <Type>)knownTypes);
        }
Beispiel #2
0
        private static IEnumerable <Type> GetKnownAliasedValueTypes()
        {
            List <Type> knownTypes = new List <Type>();

            KnownTypesProvider.AddKnownAttributeTypes(knownTypes);
            return((IEnumerable <Type>)knownTypes);
        }
Beispiel #3
0
 private static void RegisterAssembly(Assembly assembly)
 {
     if (KnownTypesProvider.GetProxyTypesAttribute(assembly) == null || KnownTypesProvider.KnownAssemblies.Contains(assembly))
     {
         return;
     }
     lock (KnownTypesProvider._lockObj)
     {
         if (KnownTypesProvider._knownAssemblies.Contains(assembly))
         {
             return;
         }
         KnownTypesProvider._knownAssemblies.Add(assembly);
         KnownTypesProvider._regenerateknownCustomValueTypes = true;
         KnownTypesProvider._regenerateknownOrganizationRequestResponseTypes = true;
     }
 }
Beispiel #4
0
        /// <summary>Enables users to map a xsi:type name to any type.</summary>
        /// <returns>Type: Returns_Type
        /// The type the xsi:type name and namespace is mapped to.</returns>
        /// <param name="typeNamespace">Returns_String. The xsi:type namespace to map.</param>
        /// <param name="typeName">Returns_String. The xsi:type name to map.</param>
        /// <param name="declaredType">Returns_Type. The type declared in the data contract.</param>
        /// <param name="knownTypeResolver">System.Runtime.Serialization.DataContractResolverhttp://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractresolver.aspx. The known type resolver.</param>
        public override Type ResolveName(
            string typeName,
            string typeNamespace,
            Type declaredType,
            DataContractResolver knownTypeResolver)
        {
            Type type = knownTypeResolver.ResolveName(typeName, typeNamespace, declaredType, (DataContractResolver)null);

            if (type == (Type)null)
            {
                string key = KnownTypesProvider.QualifiedName(typeName, typeNamespace);
                Dictionary <string, Type> requestResponseTypes = KnownTypesProvider.KnownOrganizationRequestResponseTypes;
                if (requestResponseTypes.ContainsKey(key))
                {
                    return(requestResponseTypes[key]);
                }
                KnownTypesProvider.KnownCustomValueTypes?.TryGetValue(typeName, out type);
            }
            return(type);
        }
Beispiel #5
0
        public static IEnumerable <Type> RetrieveKnownValueTypes()
        {
            List <Type> knownTypes = new List <Type>();

            KnownTypesProvider.AddKnownAttributeTypes(knownTypes);
            knownTypes.Add(typeof(AliasedValue));
            knownTypes.Add(typeof(Dictionary <string, string>));
            knownTypes.Add(typeof(Entity));
            knownTypes.Add(typeof(Entity[]));
            knownTypes.Add(typeof(ColumnSet));
            knownTypes.Add(typeof(EntityReferenceCollection));
            knownTypes.Add(typeof(QueryBase));
            knownTypes.Add(typeof(QueryExpression));
            knownTypes.Add(typeof(QueryExpression[]));
            knownTypes.Add(typeof(LocalizedLabel[]));
            knownTypes.Add(typeof(PagingInfo));
            knownTypes.Add(typeof(Relationship));
            knownTypes.Add(typeof(AttributePrivilegeCollection));
            knownTypes.Add(typeof(RelationshipQueryCollection));
            knownTypes.Add(typeof(EntityMetadataCollection));
            knownTypes.Add(typeof(MetadataFilterExpression));
            knownTypes.Add(typeof(MetadataConditionExpression));
            knownTypes.Add(typeof(MetadataQueryBase));
            knownTypes.Add(typeof(DeletedMetadataFilters));
            knownTypes.Add(typeof(DeletedMetadataCollection));
            knownTypes.Add(typeof(ExecuteMultipleSettings));
            knownTypes.Add(typeof(OrganizationRequestCollection));
            knownTypes.Add(typeof(ExecuteMultipleResponseItemCollection));
            knownTypes.Add(typeof(QuickFindResultCollection));
            knownTypes.Add(typeof(QuickFindConfigurationCollection));
            knownTypes.Add(typeof(AttributeMappingCollection));
            knownTypes.Add(typeof(OrganizationDetail));
            foreach (Type type in KnownTypesProvider.KnownCustomValueTypes.Values)
            {
                knownTypes.Add(type);
            }
            return((IEnumerable <Type>)knownTypes);
        }
Beispiel #6
0
 private static IEnumerable <Type> GetKnownParameterTypes()
 {
     return(KnownTypesProvider.RetrieveKnownValueTypes());
 }
Beispiel #7
0
 private static void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args)
 {
     KnownTypesProvider.RegisterAssembly(args.LoadedAssembly);
 }