本文整理汇总了C#中IUserIdentifier类的典型用法代码示例。如果您正苦于以下问题:C# IUserIdentifier类的具体用法?C# IUserIdentifier怎么用?C# IUserIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUserIdentifier类属于命名空间,在下文中一共展示了IUserIdentifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UserTimelineQueryParameters
public UserTimelineQueryParameters(
IUserIdentifier userIdentifier,
IUserTimelineParameters queryParameters)
{
UserIdentifier = userIdentifier;
QueryParameters = queryParameters;
}
示例2: GetUserTimeline
// User Timeline
public string GetUserTimeline(IUserIdentifier userIdentifier, int maximumNumberOfTweets = 40)
{
var requestParameters = _timelineQueryParameterGenerator.CreateUserTimelineParameters();
requestParameters.MaximumNumberOfTweetsToRetrieve = maximumNumberOfTweets;
return GetUserTimeline(userIdentifier, requestParameters);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例13: UnMuteUser
/// <summary>
/// Unmute a specific user.
/// </summary>
public static bool UnMuteUser(IUserIdentifier userIdentifier)
{
return AccountController.UnMuteUser(userIdentifier);
}
示例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);
}
示例15: CheckUserSubscriptionAsync
public async Task<bool> CheckUserSubscriptionAsync(IUserIdentifier user)
{
return await _taskFactory.ExecuteTaskAsync(() => CheckUserSubscription(user));
}