Beispiel #1
0
 private void InitializeExceptionHandler(ITweetinviContainer container)
 {
     container.RegisterType <IExceptionHandler, ExceptionHandler>(RegistrationLifetime.InstancePerThread);
     container.RegisterType <IWebExceptionInfoExtractor, WebExceptionInfoExtractor>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <ITwitterTimeoutException, TwitterTimeoutException>();
     container.RegisterType <ITwitterExceptionInfo, TwitterExceptionInfo>();
 }
Beispiel #2
0
        public void Initialize(ITweetinviContainer container)
        {
            if (container != _container)
            {
                throw new InvalidOperationException("This container can only be initialized with the main container");
            }

            container.RegisterGeneric(typeof(IFactory <>), typeof(Factory <>));
            container.RegisterType <ITaskDelayer, TaskDelayer>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAttributeHelper, AttributeHelper>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IHttpUtility, HttpUtility>(RegistrationLifetime.InstancePerApplication);
            container.RegisterGeneric(typeof(IWeakEvent <>), typeof(WeakEvent <>));
            container.RegisterInstance(typeof(ITweetinviEvents), new TweetinviEvents());
            container.RegisterType <ITwitterClientEvents, TwitterClientEvents>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ISingleAggregateExceptionThrower, SingleAggregateExceptionThrower>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterExceptionFactory, TwitterExceptionFactory>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterException, TwitterException>();
            container.RegisterType <IPagedOperationsHelper, PagedOperationsHelper>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <JsonContentFactory, JsonContentFactory>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IMultiLevelCursorIteratorFactory, MultiLevelCursorIteratorFactory>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IPageCursorIteratorFactories, PageCursorIteratorFactories>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterResultFactory, TwitterResultFactory>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITweetinviJsonConverter, TweetinviJsonConverter>(RegistrationLifetime.InstancePerApplication);

            InitializeParameters(container);
            InitializeParametersValidators(container);
        }
Beispiel #3
0
        public void Initialize(ITweetinviContainer container)
        {
            container.RegisterType <ISearchResultFactory, SearchResultFactory>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITweetFactory, TweetFactory>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITweetFactoryQueryExecutor, TweetFactoryQueryExecutor>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <IUserFactory, UserFactory>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IUserFactoryQueryExecutor, UserFactoryQueryExecutor>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <IFriendshipFactory, FriendshipFactory>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <IMessageFactory, MessageFactory>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IMessageFactoryQueryExecutor, MessageFactoryQueryExecutor>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <ITwitterListIdentifierFactory, TwitterListIdentifierFactory>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterListFactory, TwitterListFactory>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITwitterListFactoryQueryExecutor, TwitterListFactoryQueryExecutor>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITwitterListFactoryQueryGenerator, TwitterListFactoryQueryGenerator>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <IGeoFactory, GeoFactory>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <ISavedSearchFactory, SavedSearchFactory>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ISavedSearchJsonFactory, SavedSearchJsonFactory>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ISavedSearchQueryExecutor, SavedSearchFactoryQueryExecutor>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ISavedSearchQueryGenerator, SavedSearchFactoryQueryGenerator>(RegistrationLifetime.InstancePerThread);

            // This is instance per thread as we have a CredentialsAccessor that is an instance per thread.
            container.RegisterType <ITwitterQueryFactory, TwitterQueryFactory>(RegistrationLifetime.InstancePerThread);
        }
Beispiel #4
0
        private void InitializeDTOs(ITweetinviContainer container)
        {
            container.RegisterType <ITweetDTO, TweetDTO>();
            container.RegisterType <ITwitterListDTO, TwitterListDTO>();
            container.RegisterType <IUserDTO, UserDTO>();
            container.RegisterType <IRelationshipDetailsDTO, RelationshipDetailsDTO>();

            container.RegisterType <ITweetEntities, TweetEntitiesDTO>();
            container.RegisterType <IObjectEntities, ObjectEntitiesDTO>();
            container.RegisterType <IUserEntities, UserEntities>();

            container.RegisterType <IUrlEntity, UrlEntity>();
            container.RegisterType <IHashtagEntity, HashtagEntity>();
            container.RegisterType <IDescriptionEntity, DescriptionEntity>();
            container.RegisterType <ISymbolEntity, SymbolEntity>();

            container.RegisterType <IQuickReplyOption, QuickReplyOption>();
            container.RegisterType <IQuickReplyDTO, QuickReplyDTO>();
            container.RegisterType <IApp, App>();
            container.RegisterType <IEventInitiatedViaDTO, EventInitiatedViaDTO>();
            container.RegisterType <IMessageDataDTO, MessageDataDTO>();
            container.RegisterType <IQuickReplyResponse, QuickReplyResponse>();
            container.RegisterType <IMessageCreateTargetDTO, MessageCreateTargetDTO>();
            container.RegisterType <IEventDTO, EventDTO>();
            container.RegisterType <IMessageCreateDTO, MessageCreateDTO>();
            container.RegisterType <IGetMessageDTO, GetMessageDTO>();
            container.RegisterType <IGetMessagesDTO, GetMessagesDTO>();
            container.RegisterType <ICreateMessageDTO, CreateMessageDTO>();
            container.RegisterType <IAttachmentDTO, AttachmentDTO>();
            container.RegisterType <IMessageEntities, MessageEntitiesDTO>();
            container.RegisterType <IMediaEntity, MediaEntity>();
        }
 public void Initialize(ITweetinviContainer container)
 {
     InitializeControllers(container);
     InitializeQueryExecutors(container);
     InitializeQueryGenerators(container);
     InitializeHelpers(container);
 }
Beispiel #6
0
 private void InitializeQueryParameters(ITweetinviContainer container)
 {
     container.RegisterType <ITwitterListUpdateQueryParameters, TwitterListUpdateQueryParameters>();
     container.RegisterType <IGetTweetsFromListQueryParameters, GetTweetsFromListQueryParameters>();
     container.RegisterType <IUserTimelineQueryParameters, UserTimelineQueryParameters>();
     container.RegisterType <IGetUserFavoritesQueryParameters, GetUserFavoritesQueryParameters>();
 }
Beispiel #7
0
        private void InitializeControllers(ITweetinviContainer container)
        {
            container.RegisterType <IAuthController, AuthController>();
            container.RegisterType <IAccountSettingsController, AccountSettingsController>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IHelpController, HelpController>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IMessageController, MessageController>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITimelineController, TimelineController>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITrendsController, TrendsController>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITweetController, TweetController>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUserController, UserController>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterListController, TwitterListController>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ISearchController, SearchController>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAccountActivityController, AccountActivityController>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IChunkedUploader, ChunkedUploader>();

            // v2
            container.RegisterType <ISearchV2Controller, SearchV2Controller>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITweetsV2Controller, TweetsV2Controller>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUsersV2Controller, UsersV2Controller>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IStreamsV2Controller, StreamsV2Controller>(RegistrationLifetime.InstancePerApplication);
        }
Beispiel #8
0
        private void InitializeQueryGenerators(ITweetinviContainer container)
        {
            container.RegisterType <IAccountSettingsQueryGenerator, AccountSettingsQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAuthQueryGenerator, AuthQueryGenerator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IHelpQueryGenerator, HelpQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IMessageQueryGenerator, MessageQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITimelineQueryGenerator, TimelineQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITrendsQueryGenerator, TrendsQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITweetQueryGenerator, TweetQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUserQueryGenerator, UserQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ISearchQueryGenerator, SearchQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterListQueryGenerator, TwitterListQueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAccountActivityQueryGenerator, AccountActivityQueryGenerator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IQueryParameterGenerator, QueryParameterGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterListQueryParameterGenerator, TwitterListQueryParameterGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUserQueryParameterGenerator, UserQueryParameterGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ISearchQueryParameterGenerator, SearchQueryParameterGenerator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IUploadQueryGenerator, UploadQueryGenerator>(RegistrationLifetime.InstancePerApplication);

            // v2
            container.RegisterType <ISearchV2QueryGenerator, SearchV2QueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITweetsV2QueryGenerator, TweetsV2QueryGenerator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUsersV2QueryGenerator, UsersV2QueryGenerator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IStreamsV2QueryGenerator, StreamsV2QueryGenerator>(RegistrationLifetime.InstancePerApplication);
        }
Beispiel #9
0
 public void Initialize(ITweetinviContainer container)
 {
     container.RegisterType <IWebhooksHelper, WebhooksHelper>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <IWebhooksRoutes, WebhooksRoutes>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <IWebhookRouter, WebhookRouter>();
     container.RegisterType <IAccountActivityRequestHandler, AccountActivityRequestHandler>();
 }
        public void Initialize(ITweetinviContainer container)
        {
            container.RegisterType <ITwitterAccessor, TwitterAccessor>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ICredentialsAccessor, CredentialsAccessor>(RegistrationLifetime.InstancePerApplication);

            RegisterRateLimitHandler(container);
        }
Beispiel #11
0
        public void Initialize(ITweetinviContainer container)
        {
            container.RegisterType <ITweetStream, TweetStream>();
            container.RegisterType <ISampleStream, SampleStream>();
            container.RegisterType <ITrackedStream, TrackedStream>();
            container.RegisterType <IFilteredStream, FilteredStream>();

            container.RegisterType <AccountActivityStream, AccountActivityStream>();
            container.RegisterType <IAccountActivityStream, AccountActivityStream>();

            container.RegisterType <IFilterStreamTweetMatcher, FilterStreamTweetMatcher>();
            container.RegisterType <IFilterStreamTweetMatcherFactory, FilterStreamTweetMatcherFactory>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IWarningMessage, WarningMessage>();
            container.RegisterType <IWarningMessageTooManyFollowers, WarningMessageTooManyFollowers>();
            container.RegisterType <IWarningMessageFallingBehind, WarningMessageFallingBehind>();

            container.RegisterType <IStreamTask, StreamTask>();
            container.RegisterType <IStreamResultGenerator, StreamResultGenerator>();

            container.RegisterGeneric(typeof(IStreamTrackManager <>), typeof(StreamTrackManager <>));

            container.RegisterType <IWebhookDispatcher, WebhookDispatcher>();
            container.RegisterType <IStreamTaskFactory, StreamTaskFactory>(RegistrationLifetime.InstancePerApplication);
        }
Beispiel #12
0
 // Initialize Models that are not objects coming from Twitter
 private void InitializeTweetinviModels(ITweetinviContainer container)
 {
     container.RegisterType <IMedia, Media>();
     container.RegisterType <IEditableMedia, Media>();
     container.RegisterType <ISearchQueryResult, SearchQueryResult>();
     container.RegisterGeneric(typeof(IResultsWithCursor <>), typeof(ResultsWithCursor <>));
 }
 private void RegisterRateLimitHandler(ITweetinviContainer container)
 {
     container.RegisterType <IRateLimitAwaiter, RateLimitAwaiter>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <IRateLimitCache, RateLimitCache>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <IRateLimitCacheManager, RateLimitCacheManager>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <IRateLimitHelper, RateLimitHelper>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <IRateLimitUpdaterFactory, RateLimitUpdaterFactory>(RegistrationLifetime.InstancePerApplication);
 }
Beispiel #14
0
 private void InitializeQueryValidators(ITweetinviContainer container)
 {
     container.RegisterType <IMessageQueryValidator, MessageQueryValidator>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <ITweetQueryValidator, TweetQueryValidator>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <IUserQueryValidator, UserQueryValidator>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <ISearchQueryValidator, SearchQueryValidator>(RegistrationLifetime.InstancePerApplication);
     container.RegisterType <ITwitterListQueryValidator, TwitterListQueryValidator>(RegistrationLifetime.InstancePerApplication);
 }
        public static void Register()
        {
            TweetinviContainer.BeforeRegistrationComplete += (sender, arguments) =>
            {
                ITweetinviContainer container = arguments.TweetinviContainer;

                container.RegisterType <ITwitterQuery, TwitterQueryRemoteAuth>();
            };
        }
Beispiel #16
0
        private void InitializeModules(ITweetinviContainer container)
        {
            _moduleCatalog.Add(new TweetinviAspNetModule());

            _moduleCatalog.ForEach(module =>
            {
                module.Initialize(container);
            });
        }
Beispiel #17
0
 public RateLimitCache(
     IHelpQueryGenerator helpQueryGenerator,
     IJsonObjectConverter jsonObjectConverter,
     ITweetinviContainer tweetinviContainer)
 {
     _helpQueryGenerator  = helpQueryGenerator;
     _jsonObjectConverter = jsonObjectConverter;
     _tweetinviContainer  = tweetinviContainer;
     _tokenRateLimits     = new Dictionary <IOAuthCredentials, ITokenRateLimits>();
 }
 public RateLimitCache(
     IHelpQueryGenerator helpQueryGenerator,
     IJsonObjectConverter jsonObjectConverter,
     ITweetinviContainer tweetinviContainer)
 {
     _helpQueryGenerator = helpQueryGenerator;
     _jsonObjectConverter = jsonObjectConverter;
     _tweetinviContainer = tweetinviContainer;
     _tokenRateLimits = new Dictionary<ITwitterCredentials, ITokenRateLimits>();
 }
Beispiel #19
0
 public RateLimitCache(
     IHelpQueryGenerator helpQueryGenerator,
     IJsonObjectConverter jsonObjectConverter,
     ITweetinviContainer container)
 {
     _helpQueryGenerator    = helpQueryGenerator;
     _jsonObjectConverter   = jsonObjectConverter;
     _container             = container;
     _credentialsRateLimits = new Dictionary <ITwitterCredentials, ICredentialsRateLimits>();
 }
        public void Initialize(ITweetinviContainer container)
        {
            InitializeTwitterModels(container);
            InitializeTweetinviModels(container);

            InitializeDTOs(container);
            InitializeHelpers(container);
            InitializeWrappers(container);
            InitializeExceptionHandler(container);
            InitializeSerialization(container);
        }
Beispiel #21
0
        public TweetinviContainer(ITweetinviContainer container)
        {
            RegistrationActions = new List <Action <ContainerBuilder> >();
            _containerBuilder   = new ContainerBuilder();

            container.RegistrationActions.ForEach(register =>
            {
                register(_containerBuilder);
                RegistrationActions.Add(register);
            });
        }
Beispiel #22
0
        public static void AddModule(ITweetinviModule module)
        {
            lock (_resolveLock)
            {
                var updatedContainer = new Tweetinvi.Injectinvi.TweetinviContainer(Container);
                module.Initialize(updatedContainer);
                updatedContainer.Initialize();

                Container = updatedContainer;
            }
        }
Beispiel #23
0
        public void Initialize(ITweetinviContainer container)
        {
            container.RegisterType <ITwitterAccessor, TwitterAccessor>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ICredentialsAccessor, CredentialsAccessor>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ICredentialsStore, CredentialsStore>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IAuthFactory, AuthFactory>();
            container.RegisterType <IWebTokenFactory, WebTokenFactory>();
            container.RegisterType <ICursorQueryHelper, CursorQueryHelper>();

            RegisterRateLimitHandler(container);
        }
Beispiel #24
0
        public void Initialize(ITweetinviContainer container)
        {
            // Register a singleton of the container, do not use InstancePerApplication
            container.RegisterInstance(typeof(ITweetinviContainer), container);

            container.RegisterType <IAuthClient, AuthClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAuthRequester, AuthRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IAccountSettingsClient, AccountSettingsClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAccountSettingsRequester, AccountSettingsRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IExecuteClient, ExecuteClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IExecuteRequester, ExecuteRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IRateLimitsClient, RateLimitsClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IHelpClient, HelpClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IHelpRequester, HelpRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IListsClient, ListsClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterListsRequester, TwitterListsRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IMessagesClient, MessagesClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IMessageRequester, MessageRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ISearchClient, SearchClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ISearchRequester, SearchRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IStreamsClient, StreamsClient>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITimelinesClient, TimelinesClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITimelinesRequester, TimelinesRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITrendsClient, TrendsClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITrendsRequester, TrendsRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITweetsClient, TweetsClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITweetsRequester, TweetsRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IUploadClient, UploadClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUploadRequester, UploadRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IUsersClient, UsersClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUsersRequester, UsersRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IAccountActivityClient, AccountActivityClient>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAccountActivityRequester, AccountActivityRequester>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IRawExecutors, RawExecutors>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterClientFactories, TwitterClientFactories>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IJsonClient, JsonClient>(RegistrationLifetime.InstancePerApplication);
        }
Beispiel #25
0
        private void InitializeJsonControllers(ITweetinviContainer container)
        {
            container.RegisterType <IAccountJsonController, AccountJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IFriendshipJsonController, FriendshipJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IGeoJsonController, GeoJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IHelpJsonController, HelpJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IMessageJsonController, MessageJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ISavedSearchJsonController, SavedSearchJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITimelineJsonController, TimelineJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITrendsJsonController, TrendsJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITweetJsonController, TweetJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IUserJsonController, UserJsonController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITwitterListJsonController, TwitterListJsonController>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <ISearchJsonController, SearchJsonController>(RegistrationLifetime.InstancePerThread);
        }
        private void InitializeQueryExecutors(ITweetinviContainer container)
        {
            container.RegisterType <IAccountSettingsQueryExecutor, AccountSettingsQueryExecutor>();
            container.RegisterType <IAuthQueryExecutor, AuthQueryExecutor>();

            container.RegisterType <IHelpQueryExecutor, HelpQueryExecutor>();
            container.RegisterType <IMessageQueryExecutor, MessageQueryExecutor>();
            container.RegisterType <ITimelineQueryExecutor, TimelineQueryExecutor>();
            container.RegisterType <ITrendsQueryExecutor, TrendsQueryExecutor>();
            container.RegisterType <ITweetQueryExecutor, TweetQueryExecutor>();
            container.RegisterType <IUserQueryExecutor, UserQueryExecutor>();
            container.RegisterType <ITwitterListQueryExecutor, TwitterListQueryExecutor>();

            container.RegisterType <ISearchQueryExecutor, SearchQueryExecutor>();
            container.RegisterType <IUploadQueryExecutor, UploadQueryExecutor>();
            container.RegisterType <IUploadMediaStatusQueryExecutor, UploadMediaStatusQueryExecutor>();
        }
        public void Initialize(ITweetinviContainer container)
        {
            container.RegisterType <IWebRequestExecutor, WebRequestExecutor>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterRequestHandler, TwitterRequestHandler>();

            container.RegisterType <IConsumerOnlyCredentials, ConsumerOnlyCredentials>();
            container.RegisterType <ITwitterCredentials, TwitterCredentials>();

            container.RegisterType <IOAuthQueryParameter, OAuthQueryParameter>();
            container.RegisterType <IOAuthWebRequestGeneratorFactory, OAuthWebRequestGeneratorFactory>();

            container.RegisterType <IWebHelper, WebHelper>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IHttpClientWebHelper, HttpClientWebHelper>();
            container.RegisterType <ITwitterResponse, TwitterResponse>();

            container.RegisterType <ITwitterQuery, TwitterQuery>();
        }
        private void InitializeParameters(ITweetinviContainer container)
        {
            // Base
            container.RegisterType <ICustomRequestParameters, CustomRequestParameters>();

            // Identifiers
            container.RegisterType <ITweetIdentifier, TweetIdentifier>();
            container.RegisterType <IUserIdentifier, UserIdentifier>();
            container.RegisterType <ITwitterListIdentifier, TwitterListIdentifier>();

            container.RegisterType <IGeoCode, GeoCode>();

            // Parameters
            container.RegisterType <ITwitterListUpdateParameters, TwitterListUpdateParameters>();
            container.RegisterType <IGetTweetsFromListParameters, GetTweetsFromListParameters>();

            // Account
            container.RegisterType <IAccountUpdateProfileBannerParameters, AccountUpdateProfileBannerParameters>();

            // Search
            container.RegisterType <ISearchTweetsParameters, SearchTweetsParameters>();
            container.RegisterType <ISearchUsersParameters, SearchUsersParameters>();

            // Tweet
            container.RegisterType <IPublishTweetParameters, PublishTweetParameters>();
            container.RegisterType <IPublishTweetOptionalParameters, PublishTweetOptionalParameters>();
            container.RegisterType <IGetUserFavoritesParameters, GetUserFavoritesParameters>();

            // Account
            container.RegisterType <IAccountSettingsRequestParameters, AccountSettingsRequestParameters>();

            // Timeline
            container.RegisterType <IHomeTimelineParameters, HomeTimelineParameters>();
            container.RegisterType <IUserTimelineParameters, UserTimelineParameters>();
            container.RegisterType <IMentionsTimelineParameters, MentionsTimelineParameters>();
            container.RegisterType <IRetweetsOfMeTimelineParameters, RetweetsOfMeTimelineParameter>();

            // Message
            _container.RegisterType <IGetMessagesParameters, GetMessagesParameters>();
            _container.RegisterType <IPublishMessageParameters, PublishMessageParameters>();

            // Upload
            container.RegisterType <IChunkUploadInitParameters, ChunkUploadInitParameters>();
            container.RegisterType <IChunkUploadAppendParameters, ChunkUploadAppendParameters>();
        }
Beispiel #29
0
        private void InitializeControllers(ITweetinviContainer container)
        {
            container.RegisterType <IAccountController, AccountController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IFriendshipController, FriendshipController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IGeoController, GeoController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IHelpController, HelpController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IMessageController, MessageController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ISavedSearchController, SavedSearchController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITimelineController, TimelineController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITrendsController, TrendsController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITweetController, TweetController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IUserController, UserController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <ITwitterListController, TwitterListController>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <ISearchController, SearchController>(RegistrationLifetime.InstancePerThread);
            container.RegisterType <IWebhookController, WebhookController>(RegistrationLifetime.InstancePerThread);

            container.RegisterType <IChunkedUploader, ChunkedUploader>();
        }
Beispiel #30
0
        private static void InitializeParametersValidators(ITweetinviContainer container)
        {
            container.RegisterType <IParametersValidator, ParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IAccountActivityClientParametersValidator, AccountActivityClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAccountActivityClientRequiredParametersValidator, AccountActivityClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IAccountSettingsClientParametersValidator, AccountSettingsClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAccountSettingsClientRequiredParametersValidator, AccountSettingsClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IAuthClientParametersValidator, AuthClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IAuthClientRequiredParametersValidator, AuthClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IHelpClientParametersValidator, HelpClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IHelpClientRequiredParametersValidator, HelpClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITwitterListsClientParametersValidator, TwitterListsClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITwitterListsClientRequiredParametersValidator, TwitterListsClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IMessagesClientParametersValidator, MessagesClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IMessagesClientRequiredParametersValidator, MessagesClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ISearchClientParametersValidator, SearchClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ISearchClientRequiredParametersValidator, SearchClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITimelineClientParametersValidator, TimelineClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITimelineClientRequiredParametersValidator, TimelineClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITrendsClientParametersValidator, TrendsClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITrendsClientRequiredParametersValidator, TrendsClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <ITweetsClientParametersValidator, TweetsClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <ITweetsClientRequiredParametersValidator, TweetsClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IUploadClientParametersValidator, UploadClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUploadClientRequiredParametersValidator, UploadClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IUsersClientParametersValidator, UsersClientParametersValidator>(RegistrationLifetime.InstancePerApplication);
            container.RegisterType <IUsersClientRequiredParametersValidator, UsersClientRequiredParametersValidator>(RegistrationLifetime.InstancePerApplication);

            container.RegisterType <IUserQueryValidator, UserQueryValidator>(RegistrationLifetime.InstancePerApplication);
        }
Beispiel #31
0
        // Initialize Models that are Twitter objects
        private void InitializeTwitterModels(ITweetinviContainer container)
        {
            container.RegisterType <ITweet, Tweet>();
            container.RegisterType <ITweetWithSearchMetadata, TweetWithSearchMetadata>();
            container.RegisterType <IOEmbedTweet, OEmbedTweet>();

            container.RegisterType <IUser, User>();
            container.RegisterType <IAuthenticatedUser, AuthenticatedUser>();

            container.RegisterType <ITwitterList, TwitterList>();

            container.RegisterType <ICoordinates, CoordinatesDTO>();
            container.RegisterType <ILocation, Location>();

            container.RegisterType <IAccountSettings, AccountSettings>();
            container.RegisterType <IMessage, Message>();
            container.RegisterType <IMention, Mention>();
            container.RegisterType <IRelationshipDetails, RelationshipDetails>();
            container.RegisterType <IRelationshipState, RelationshipState>();
            container.RegisterType <ISavedSearch, SavedSearch>();
        }
 public TweetinviFactoriesModule(ITweetinviContainer container)
 {
     _container = container;
 }
 public TweetinviControllersModule(ITweetinviContainer container)
 {
     _container = container;
 }
 public TweetinviCoreModule(ITweetinviContainer container)
 {
     _container = container;
 }
 public TweetinviContainerEventArgs(ITweetinviContainer container)
 {
     TweetinviContainer = container;
 }
 public StreaminviModule(ITweetinviContainer container)
 {
     _container = container;
 }
 public TweetinviLogicModule(ITweetinviContainer container)
 {
     _container = container;
 }
 public TweetinviCredentialsModule(ITweetinviContainer container)
 {
     _container = container;
 }