本文整理汇总了C#中CommandFlags类的典型用法代码示例。如果您正苦于以下问题:C# CommandFlags类的具体用法?C# CommandFlags怎么用?C# CommandFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommandFlags类属于命名空间,在下文中一共展示了CommandFlags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateLongCommand
internal static Command CreateLongCommand(string name, Func<FSharpOption<int>, Register, LongCommandResult> func, CommandFlags flags = CommandFlags.None)
{
var fsharpFunc = FSharpFuncUtil.Create(func);
var list = name.Select(InputUtil.CharToKeyInput).ToFSharpList();
var commandName = CommandName.NewManyKeyInputs(list);
return Command.NewLongCommand(commandName, flags, fsharpFunc);
}
示例2: Command
/// <summary>
/// Initializes a new instance of the <see cref="Command"/> class.
/// </summary>
/// <param name="flags">Command flags.</param>
/// <param name="name">The command's name.</param>
/// <param name="description">The command's description.</param>
/// <param name="usage">The command's usage string.</param>
/// <param name="helpMessage">The command's help message.</param>
protected Command(CommandFlags flags, string name, string description, string usage, string helpMessage)
{
Name = name;
Description = description;
Usage = usage;
HelpMessage = helpMessage;
Flags = flags;
}
示例3: Exists
/// <summary>
/// EXISTS http://redis.io/commands/exists
/// </summary>
public Task<bool> Exists(CommandFlags commandFlags = CommandFlags.None)
{
return TraceHelper.RecordReceive(Settings, Key, CallType, async () =>
{
var r = await Command.KeyExistsAsync(Key, commandFlags).ForAwait();
return Tracing.CreateReceived(r, sizeof(bool));
});
}
示例4: Dispose
public void Dispose()
{
if (Disposing != null)
Disposing(this);
Flags = CommandFlags.None;
ValidateHnd = null;
PrepareHnd = null;
ExecuteHnd = null;
FinishHnd = null;
}
示例5: Common
// private Properties.WidgetPropsManager _prop_man;
// Constructor is 'protected'
protected Common()
{
_cur_element = null;
_cur_window = null;
_obj_props_panel = null;
_cur_action = CommandFlags.TB_NONE;
_obj_tree_il = null;
_py_editor = new mkdb.Python.PyFileEditor();
// _prop_man = new mkdb.Properties.WidgetPropsManager();
}
示例6: CommandDefinition
/// <summary>
/// Initialize the command definition
/// </summary>
public CommandDefinition(string commandText, object parameters = null, IDbTransaction transaction = null, int? commandTimeout = null,
CommandType? commandType = null, CommandFlags flags = CommandFlags.Buffered
#if ASYNC
, CancellationToken cancellationToken = default(CancellationToken)
#endif
)
{
CommandText = commandText;
Parameters = parameters;
Transaction = transaction;
CommandTimeout = commandTimeout;
CommandType = commandType;
Flags = flags;
#if ASYNC
CancellationToken = cancellationToken;
#endif
}
示例7: Combine
public RedisValue[] Combine(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None)
{
return RedisSync.SetCombine(operation, first, second, flags);
}
示例8: CombineAsync
public Task<RedisValue[]> CombineAsync(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None)
{
return RedisAsync.SetCombineAsync(operation, first, second, flags);
}
示例9: EvaluateAsync
/// <summary>
/// Evaluates this LoadedLuaScript against the given database, extracting parameters for the passed in object if any.
///
/// This method sends the SHA1 hash of the ExecutableScript instead of the script itself. If the script has not
/// been loaded into the passed Redis instance it will fail.
/// </summary>
public Task<RedisResult> EvaluateAsync(IDatabaseAsync db, object ps = null, RedisKey? withKeyPrefix = null, CommandFlags flags = CommandFlags.None)
{
RedisKey[] keys;
RedisValue[] args;
Original.ExtractParameters(ps, withKeyPrefix, out keys, out args);
return db.ScriptEvaluateAsync(Hash, keys, args, flags);
}
示例10: CombineAndStoreAsync
public Task<long> CombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None)
{
return RedisAsync.SetCombineAndStoreAsync(operation, destination, first, second, flags);
}
示例11: Select
private ServerEndPoint Select(int slot, RedisCommand command, CommandFlags flags)
{
flags = Message.GetMasterSlaveFlags(flags); // only intersted in master/slave preferences
ServerEndPoint[] arr;
if (slot == NoSlot || (arr = map) == null) return Any(command, flags);
ServerEndPoint endpoint = arr[slot], testing;
// but: ^^^ is the MASTER slots; if we want a slave, we need to do some thinking
if (endpoint != null)
{
switch (flags)
{
case CommandFlags.DemandSlave:
return FindSlave(endpoint, command) ?? Any(command, flags);
case CommandFlags.PreferSlave:
testing = FindSlave(endpoint, command);
if (testing != null) return testing;
break;
case CommandFlags.DemandMaster:
return FindMaster(endpoint, command) ?? Any(command, flags);
case CommandFlags.PreferMaster:
testing = FindMaster(endpoint, command);
if (testing != null) return testing;
break;
}
if (endpoint.IsSelectable(command)) return endpoint;
}
return Any(command, flags);
}
示例12: Evaluate
/// <summary>
/// Evaluates this LuaScript against the given database, extracting parameters from the passed in object if any.
/// </summary>
public RedisResult Evaluate(IDatabase db, object ps = null, RedisKey? withKeyPrefix = null, CommandFlags flags = CommandFlags.None)
{
RedisKey[] keys;
RedisValue[] args;
ExtractParameters(ps, withKeyPrefix, out keys, out args);
return db.ScriptEvaluate(ExecutableScript, keys, args, flags);
}
示例13: GetMenuMask
public static CommandFlags GetMenuMask()
{
var pathToCheck = GetSelectedPath();
if (pathToCheck == _lastCheckedPath)
return _lastMenuMask;
_lastCheckedPath = pathToCheck;
_lastMenuMask = GetMenuMask(_lastCheckedPath);
return _lastMenuMask;
}
示例14: GitCommand
protected GitCommand(GitMenuPackage provider, int id, CommandFlags selection, string text)
: base(new CommandID(GuidList.GuidGitMenuCmdSet, id), text)
{
this.Selection = selection;
Package = provider;
}
示例15: Eval
protected object Eval(string script, bool async = false, CommandFlags flags = CommandFlags.FireAndForget)
{
object result = null;
var redisDatabase = GetRedisDatabase();
if (async)
redisDatabase.ScriptEvaluateAsync(script);
else
result = redisDatabase.ScriptEvaluate(script, null, null, flags);
return result;
}