本文整理汇总了C#中System.Action.CheckIfArgValid方法的典型用法代码示例。如果您正苦于以下问题:C# Action.CheckIfArgValid方法的具体用法?C# Action.CheckIfArgValid怎么用?C# Action.CheckIfArgValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Action
的用法示例。
在下文中一共展示了Action.CheckIfArgValid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateQueue
public virtual Task<HttpResponseMessage> CreateQueue(string virtualHostName, string queueName,
Action<CreateQueueArgs> args,
CancellationToken cancellationToken =
default(CancellationToken))
{
queueName.CheckIfArgValid("queueName");
virtualHostName.CheckIfArgValid("virtualHostName");
args.CheckIfArgValid("args");
var queue = new CreateQueueArgsImpl();
args(queue);
string url = string.Format("api/queues/{0}/{1}", virtualHostName.SanitizeVirtualHostName(), queueName);
return cancellationToken == default(CancellationToken)
? Put(url, queue)
: Put(url, queue, cancellationToken);
}
示例2: BindQueueToExchange
public virtual Task<HttpResponseMessage> BindQueueToExchange(string virtualHostName, string exchangeName,
string queueName,
Action<BindQueueArgs> args,
CancellationToken cancellationToken =
default(CancellationToken))
{
queueName.CheckIfArgValid("queueName");
virtualHostName.CheckIfArgValid("virtualHostName");
exchangeName.CheckIfArgValid("exchangeName");
args.CheckIfArgValid("args");
var queueBinding = new BindQueueArgsImpl();
args(queueBinding);
string url = string.Format("api/bindings/{0}/e/{1}/q/{2}", virtualHostName.SanitizeVirtualHostName(),
exchangeName, queueName);
return cancellationToken == default(CancellationToken)
? Post(url, queueBinding)
: Post(url, queueBinding, cancellationToken);
}
示例3: CreateUserPermissions
public virtual Task<HttpResponseMessage> CreateUserPermissions(string virtualHostName, string userName,
Action<UserPermissionsArgs> args,
CancellationToken cancellationToken =
default(CancellationToken))
{
virtualHostName.CheckIfArgValid("virtualHostName");
userName.CheckIfArgValid("userName");
args.CheckIfArgValid("args");
var permissions = new UserPermissionsArgsImpl();
args(permissions);
string url = string.Format("api/permissions/{0}/{1}", virtualHostName.SanitizeVirtualHostName(), userName);
return cancellationToken == default(CancellationToken)
? Put(url, permissions)
: Put(url, permissions, cancellationToken);
}
示例4: CreateUser
public virtual Task<HttpResponseMessage> CreateUser(string userName, Action<UserArgs> args,
CancellationToken cancellationToken =
default(CancellationToken))
{
userName.CheckIfArgValid("userName");
args.CheckIfArgValid("args");
var user = new UserArgsImpl();
args(user);
string url = string.Format("api/users/{0}", userName);
return cancellationToken == default(CancellationToken) ? Put(url, user) : Put(url, user, cancellationToken);
}