当前位置: 首页>>代码示例>>C#>>正文


C# IUserIdentifier类代码示例

本文整理汇总了C#中IUserIdentifier的典型用法代码示例。如果您正苦于以下问题:C# IUserIdentifier类的具体用法?C# IUserIdentifier怎么用?C# IUserIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IUserIdentifier类属于命名空间,在下文中一共展示了IUserIdentifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UserTimelineQueryParameters

 public UserTimelineQueryParameters(
     IUserIdentifier userIdentifier,
     IUserTimelineParameters queryParameters)
 {
     UserIdentifier = userIdentifier;
     QueryParameters = queryParameters;
 }
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:7,代码来源:UserTimelineRequestQueryParameters.cs

示例2: GetUserTimeline

        // User Timeline
        public string GetUserTimeline(IUserIdentifier userIdentifier, int maximumNumberOfTweets = 40)
        {
            var requestParameters = _timelineQueryParameterGenerator.CreateUserTimelineParameters();
            requestParameters.MaximumNumberOfTweetsToRetrieve = maximumNumberOfTweets;

            return GetUserTimeline(userIdentifier, requestParameters);
        }
开发者ID:rudiv,项目名称:tweetinvi,代码行数:8,代码来源:TimelineJsonController.cs

示例3: GenerateParameterExpectedResult

        public static string GenerateParameterExpectedResult(IUserIdentifier userDTO, string idParameterName = "user_id", string screenNameParameterName = "screen_name")
        {
            if (userDTO.Id != TweetinviSettings.DEFAULT_ID)
            {
                return String.Format("{0}={1}", idParameterName, userDTO.GetHashCode());
            }

            return String.Format("{0}={1}", screenNameParameterName, userDTO.GetHashCode());
        }
开发者ID:SowaLabs,项目名称:Tweetinvi-obsolete,代码行数:9,代码来源:UserQueryGeneratorHelper.cs

示例4: GetUserTimeline

        public IEnumerable<ITweet> GetUserTimeline(IUserIdentifier userIdentifier, IUserTimelineParameters parameters)
        {
            if (parameters == null)
            {
                parameters = _timelineQueryParameterGenerator.CreateUserTimelineParameters();
            }

            var queryParameters = _timelineQueryParameterGenerator.CreateUserTimelineQueryParameters(userIdentifier, parameters);
            return GetUserTimline(queryParameters);
        }
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:10,代码来源:TimelineController.cs

示例5: GetUserSubscribedListsQuery

        // User Lists
        public string GetUserSubscribedListsQuery(IUserIdentifier userIdentifier, bool getOwnedListsFirst)
        {
            if (!_userQueryValidator.CanUserBeIdentified(userIdentifier))
            {
                return null;
            }

            var userIdParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(userIdentifier);
            return GenerateUserListsQuery(userIdParameter, getOwnedListsFirst);
        }
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:11,代码来源:TwitterListQueryGenerator.cs

示例6: GetFollowerIdsQuery

        // Followers
        public string GetFollowerIdsQuery(IUserIdentifier userDTO, int maxFollowersToRetrieve)
        {
            if (!_userQueryValidator.CanUserBeIdentified(userDTO))
            {
                return null;
            }

            string userIdentifierParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(userDTO);
            return GenerateGetFollowerIdsQuery(userIdentifierParameter, maxFollowersToRetrieve);
        }
开发者ID:SowaLabs,项目名称:Tweetinvi-obsolete,代码行数:11,代码来源:UserQueryGenerator.cs

示例7: GetRelationshipDetailsQuery

        // Get Existing Relationship
        public string GetRelationshipDetailsQuery(IUserIdentifier sourceUserIdentifier, IUserIdentifier targetUserIdentifier)
        {
            if (!_userQueryValidator.CanUserBeIdentified(sourceUserIdentifier) ||
                !_userQueryValidator.CanUserBeIdentified(targetUserIdentifier))
            {
                return null;
            }

            string sourceParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(sourceUserIdentifier, "source_id", "source_screen_name");
            string targetParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(targetUserIdentifier, "target_id", "target_screen_name");
            return string.Format(Resources.Friendship_GetRelationship, sourceParameter, targetParameter);
        }
开发者ID:SowaLabs,项目名称:Tweetinvi-obsolete,代码行数:13,代码来源:FriendshipQueryGenerator.cs

示例8: Initialize

        private void Initialize(string text, IUserIdentifier recipient)
        {
            if (string.IsNullOrEmpty(text))
            {
                throw new ArgumentNullException("Message Text cannot be null or empty.");
            }

            if (recipient == null)
            {
                throw new ArgumentNullException("Message recipient cannot be null.");
            }

            Text = text;
            Recipient = recipient;
        }
开发者ID:SowaLabs,项目名称:TweetinviNew,代码行数:15,代码来源:PublishMessageParameters.cs

示例9: Init

        private void Init()
        {
            _maximumNumberOfTweetsParameterValue = TestHelper.GenerateRandomInt();
            _fakeUserIdentifier = A.Fake<IUserIdentifier>();

            _fakeHomeTimelineParameters = A.Fake<IHomeTimelineParameters>();
            _fakeHomeTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue);


            _fakeUserTimelineParameters = A.Fake<IUserTimelineParameters>();
            _fakeUserTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue);
            
            _fakeUserTimelineQueryParameters = A.Fake<IUserTimelineQueryParameters>();
            _fakeUserTimelineQueryParameters.CallsTo(x => x.Parameters).Returns(_fakeUserTimelineParameters);
            _fakeUserTimelineQueryParameters.CallsTo(x => x.UserIdentifier).Returns(_fakeUserIdentifier);

            _fakeMentionsTimelineParameters = A.Fake<IMentionsTimelineParameters>();
            _fakeMentionsTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue);

            _userIdentifierParameter = TestHelper.GenerateString();
            _includeRTSParameter = TestHelper.GenerateString();
            _excludeRepliesParameter = TestHelper.GenerateString();
            _includeContributorDetailsParameter = TestHelper.GenerateString();
            _maximumNumberOfTweetsParameter = TestHelper.GenerateString();
            _trimUserParameter = TestHelper.GenerateString();
            _sinceIdParameter = TestHelper.GenerateString();
            _maxIdParameter = TestHelper.GenerateString();
            _includeDetailsParameter = TestHelper.GenerateString();

            var queryParameterBuilder = new StringBuilder();
            
            queryParameterBuilder.Append(_includeContributorDetailsParameter);
            queryParameterBuilder.Append(_maximumNumberOfTweetsParameter);
            queryParameterBuilder.Append(_trimUserParameter);
            queryParameterBuilder.Append(_sinceIdParameter);
            queryParameterBuilder.Append(_maxIdParameter);
            queryParameterBuilder.Append(_includeDetailsParameter);

            var homeQueryParameter = _excludeRepliesParameter + queryParameterBuilder;
            var userQueryParameter = _userIdentifierParameter + _includeRTSParameter + _excludeRepliesParameter + queryParameterBuilder;

            _expectedTimelineQuery = String.Format(Resources.Timeline_GetHomeTimeline, homeQueryParameter);
            _expectedUserTimelineQuery = String.Format(Resources.Timeline_GetUserTimeline, userQueryParameter);
            _expectedMentionsTimelineQuery = String.Format(Resources.Timeline_GetMentionsTimeline, queryParameterBuilder);
        }
开发者ID:SowaLabs,项目名称:Tweetinvi-obsolete,代码行数:45,代码来源:TimelineQueryGeneratorTests.cs

示例10: Create

        public ITwitterListIdentifier Create(string slug, IUserIdentifier userIdentifier)
        {
            if (userIdentifier == null)
            {
                return null;
            }

            if (userIdentifier.Id != TweetinviSettings.DEFAULT_ID)
            {
                return Create(slug, userIdentifier.Id);
            }

            if (!string.IsNullOrEmpty(userIdentifier.ScreenName))
            {
                return Create(slug, userIdentifier.ScreenName);
            }

            return null;
        }
开发者ID:SowaLabs,项目名称:Tweetinvi-obsolete,代码行数:19,代码来源:TwitterListIdentifierFactory.cs

示例11: GenerateIdOrScreenNameParameter

        public string GenerateIdOrScreenNameParameter(
            IUserIdentifier userIdentifier,
            string idParameterName = "user_id",
            string screenNameParameterName = "screen_name")
        {
            if (userIdentifier == null)
            {
                throw new ArgumentException("Cannot extract id or name parameter from a null userIdentifier.");
            }

            if (!_userQueryValidator.CanUserBeIdentified(userIdentifier))
            {
                throw new ArgumentException("Cannot extract either id or name parameter from the given userIdentifier.");
            }

            if (_userQueryValidator.IsUserIdValid(userIdentifier.Id))
            {
                return GenerateUserIdParameter(userIdentifier.Id, idParameterName);
            }

            return GenerateScreenNameParameter(userIdentifier.ScreenName, screenNameParameterName);
        }
开发者ID:SowaLabs,项目名称:Tweetinvi-obsolete,代码行数:22,代码来源:UserQueryParameterGenerator.cs

示例12: UpdateRelationshipAuthorizationsWith

        // Update Relationship Authorization With

        /// <summary>
        /// Changes the authorizations you give to a specific user.
        /// </summary>
        public static bool UpdateRelationshipAuthorizationsWith(IUserIdentifier userIdentifier, bool retweetsEnabled, bool deviceNotifictionEnabled)
        {
            return FriendshipController.UpdateRelationshipAuthorizationsWith(userIdentifier, retweetsEnabled, deviceNotifictionEnabled);
        }
开发者ID:SowaLabs,项目名称:TweetinviNew,代码行数:9,代码来源:Account.cs

示例13: UnMuteUser

 /// <summary>
 /// Unmute a specific user.
 /// </summary>
 public static bool UnMuteUser(IUserIdentifier userIdentifier)
 {
     return AccountController.UnMuteUser(userIdentifier);
 }
开发者ID:SowaLabs,项目名称:TweetinviNew,代码行数:7,代码来源:Account.cs

示例14: CreateUserTimelineQueryParameters

        // Query Parameters
        public IUserTimelineQueryParameters CreateUserTimelineQueryParameters(IUserIdentifier userIdentifier, IUserTimelineParameters userTimelineParameters)
        {
            var userIdentifierParameter = TweetinviFactory.CreateConstructorParameter("userIdentifier", userIdentifier);
            var queryParameters = TweetinviFactory.CreateConstructorParameter("parameters", userTimelineParameters);

            return _userTimelineRequestQueryParameterFactory.Create(userIdentifierParameter, queryParameters);
        }
开发者ID:rudiv,项目名称:tweetinvi,代码行数:8,代码来源:TimelineQueryParameterGenerator.cs

示例15: CheckUserSubscriptionAsync

 public async Task<bool> CheckUserSubscriptionAsync(IUserIdentifier user)
 {
     return await _taskFactory.ExecuteTaskAsync(() => CheckUserSubscription(user));
 }
开发者ID:SowaLabs,项目名称:TweetinviNew,代码行数:4,代码来源:TwitterList.cs


注:本文中的IUserIdentifier类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。