コード例 #1
0
            private static void PopulateCache()
            {
                var sourceAssembly = CSRequest.SyncRequestType.Assembly;

#if BCL
                var allTypes = sourceAssembly.GetTypes();
#else
                var allTypesInfos = sourceAssembly.DefinedTypes;
                var allTypes      = new List <Type>();
                foreach (var typeInfo in allTypesInfos)
                {
                    allTypes.Add(typeInfo.AsType());
                }
#endif
                // Look up all CognitoSync request objects for caching.
                foreach (var type in allTypes)
                {
                    var typeInfo = TypeFactory.GetTypeInfo(type);
                    if (CSRequest.SyncRequestType.IsAssignableFrom(typeInfo) && !typeInfo.Equals(CSRequest.SyncRequestType))
                    {
                        var csRequest = new CSRequest(type);
                        requestCache[type] = csRequest;
                    }
                }
            }
コード例 #2
0
            private static void PopulateCache()
            {
                var sourceAssembly = CSRequest.SyncRequestType.Assembly;
                var allTypes       = sourceAssembly.GetTypes();

                // Look up all CognitoSync request objects for caching.
                foreach (var type in allTypes)
                {
                    var typeInfo = TypeFactory.GetTypeInfo(type);
                    if (CSRequest.SyncRequestType.IsAssignableFrom(typeInfo) && !typeInfo.Equals(CSRequest.SyncRequestType))
                    {
                        var csRequest = new CSRequest(type);
                        requestCache[type] = csRequest;
                    }
                }
            }