本文整理汇总了C#中VkParameters类的典型用法代码示例。如果您正苦于以下问题:C# VkParameters类的具体用法?C# VkParameters怎么用?C# VkParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VkParameters类属于命名空间,在下文中一共展示了VkParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get
public ReadOnlyCollection<Message> Get(
MessageType type,
out int totalCount,
int? count = null,
int? offset = null,
DateTime? timeOffset = null,
MessagesFilter? filter = null,
int? previewLength = null,
long? lastMessageId = null)
{
VkErrors.ThrowIfNumberIsNegative(() => count);
VkErrors.ThrowIfNumberIsNegative(() => offset);
VkErrors.ThrowIfNumberIsNegative(() => previewLength);
VkErrors.ThrowIfNumberIsNegative(() => lastMessageId);
var parameters = new VkParameters
{
{ "out", type },
{ "offset", offset },
{ "count", count },
{ "time_offset", timeOffset},
{ "filters", filter },
{ "preview_length", previewLength },
{ "last_message_id", lastMessageId }
};
VkResponse response = _vk.Call("messages.get", parameters);
totalCount = response["count"];
VkResponseArray items = response["items"];
return items.ToReadOnlyCollectionOf<Message>(item => item);
}
示例2: Leave
public bool Leave(long groupId)
{
var parameters = new VkParameters {
{ "group_id", groupId }
};
return _vk.Call("groups.leave", parameters);
}
示例3: AddGroup
public bool AddGroup(ulong groupId)
{
var parameters = new VkParameters
{
{ "group_id", groupId }
};
return _vk.Call("fave.addGroup", parameters);
}
示例4: CheckLink
public LinkAccessType CheckLink([NotNull] string url)
{
VkErrors.ThrowIfNullOrEmpty(() => url);
var parameters = new VkParameters { {"url", url} };
return _vk.Call("utils.checkLink", parameters, true);
}
示例5: GetStreetsById
public ReadOnlyCollection<Street> GetStreetsById(params int[] streetIds)
{
var parameters = new VkParameters();
parameters.Add<int>("street_ids", streetIds);
VkResponseArray response = _vk.Call("database.getStreetsById", parameters, true);
return response.ToReadOnlyCollectionOf<Street>(x => x);
}
示例6: ResolveScreenName
public VkObject ResolveScreenName([NotNull] string screenName)
{
VkErrors.ThrowIfNullOrEmpty(() => screenName);
var parameters = new VkParameters {{"screen_name", screenName}};
return _vk.Call("utils.resolveScreenName", parameters, true);
}
示例7: IsAppUser
public bool IsAppUser(long? userId)
{
var parameters = new VkParameters {
{ "user_id", userId }
};
return _vk.Call("users.isAppUser", parameters);
}
示例8: Get
public Status Get(long userId, long? groupId = null)
{
var parameters = new VkParameters {
{ "user_id", userId },
{ "group_id", groupId }
};
return _vk.Call("status.get", parameters);
}
示例9: Join
public bool Join(long? groupId, bool? notSure = null)
{
var parameters = new VkParameters {
{ "group_id", groupId },
{ "not_sure", notSure }
};
return _vk.Call("groups.join", parameters);
}
示例10: GetLyrics
public Lyrics GetLyrics(long lyricsId)
{
var parameters = new VkParameters
{
{ "lyrics_id", lyricsId }
};
return _vk.Call("audio.getLyrics", parameters);
}
示例11: Add
public int Add(long owner_id, long doc_id, string access_key = null)
{
VkErrors.ThrowIfNumberIsNegative(() => owner_id);
VkErrors.ThrowIfNumberIsNegative(() => doc_id);
var parameters = new VkParameters { { "owner_id", owner_id }, { "doc_id", doc_id }, { "access_key", access_key } };
return _vk.Call("docs.add", parameters);
}
示例12: CreateChat
/// <summary>
/// Создаёт беседу с несколькими участниками.
/// </summary>
/// <param name="userIds">Идентификаторы пользователей, которых нужно включить в беседу (мультидиалог).</param>
/// <param name="title">Название беседы.</param>
/// <returns>После успешного выполнения возвращает идентификатор созданной беседы.</returns>
/// <remarks>
/// Для вызова этого метода Ваше приложение должно иметь права с битовой маской, содержащей <see cref="Settings.Messages"/>.
/// Страница документации ВКонтакте <see href="http://vk.com/dev/messages.createChat"/>.
/// </remarks>
public long CreateChat(IEnumerable<long> userIds, [NotNull] string title)
{
if (string.IsNullOrEmpty(title))
throw new ArgumentException("Title can not be empty or null.", "userIds");
var parameters = new VkParameters { { "uids", userIds }, { "title", HttpUtility.UrlEncode(title) } };
return _vk.Call("messages.createChat", parameters);
}
示例13: DeleteBan
public bool DeleteBan(IEnumerable<ulong> userIds, IEnumerable<ulong> groupIds)
{
var parameters = new VkParameters
{
{ "user_ids", userIds },
{ "group_ids", groupIds }
};
return _vk.Call("newsfeed.deleteBan", parameters);
}
示例14: ApproveRequest
public bool ApproveRequest(ulong groupId, ulong userId)
{
var parameters = new VkParameters
{
{ "group_id", groupId },
{ "user_id", userId }
};
return _vk.Call("groups.approveRequest", parameters);
}
示例15: ClearCache
public bool ClearCache(Uri url)
{
var parameters = new VkParameters
{
{ "url", url }
};
return _vk.Call("pages.clearCache", parameters);
}