本文整理匯總了C#中API.Select方法的典型用法代碼示例。如果您正苦於以下問題:C# API.Select方法的具體用法?C# API.Select怎麽用?C# API.Select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類API
的用法示例。
在下文中一共展示了API.Select方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Execute
public void Execute(API.CommandManager manager, IRemoteCommandArguments arguments)
{
var args = (SelectArguments)arguments;
Guard.ArgumentNotNullForCommand<Select>(args.Selector);
API.FieldCommands.Select selectCommand = null;
if (args.SelectMode.HasValue)
{
if (args.Value != null)
{
selectCommand = manager.Select(args.Value, args.SelectMode.Value);
}
else if (args.Values != null)
{
selectCommand = manager.Select(args.SelectMode.Value, args.Values.ToArray());
}
else if (args.Index != null)
{
selectCommand = manager.Select(args.Index.Value);
}
else if (args.Indices != null)
{
selectCommand = manager.Select(args.Indices.ToArray());
}
else if (args.ValueExpression != null)
{
selectCommand = manager.Select(args.ValueExpression, args.SelectMode.Value);
}
else
{
throw new InvalidCommandException<Select>();
}
}
else
{
if (args.Value != null)
{
selectCommand = manager.Select(args.Value);
}
else if (args.Values != null)
{
selectCommand = manager.Select(args.Values.ToArray());
}
else if (args.Index != null)
{
selectCommand = manager.Select(args.Index.Value);
}
else if (args.Indices != null)
{
selectCommand = manager.Select(args.Indices.ToArray());
}
else if (args.ValueExpression != null)
{
selectCommand = manager.Select(args.ValueExpression);
}
else
{
throw new InvalidCommandException<Select>();
}
}
if (args.MatchConditions.HasValue)
{
selectCommand.From(args.Selector, args.MatchConditions.Value);
}
else
{
selectCommand.From(args.Selector);
}
}