本文整理汇总了C#中CommandFunction类的典型用法代码示例。如果您正苦于以下问题:C# CommandFunction类的具体用法?C# CommandFunction怎么用?C# CommandFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommandFunction类属于命名空间,在下文中一共展示了CommandFunction类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddCommand
public void AddCommand(string Text, CommandFunction F)
{
Command.TextOnly temp = new Command.TextOnly(Text);
temp.OnClick = F;
commands.Add(temp);
RebuildWindow();
}
示例2: Command
public Command(string name, CommandFunction function)
{
this.Name = name;
this.Function = function;
CommandDispatcher.CommandList.Add(this.Name, this);
}
示例3: GetReplicationCommandType
public ReplicationCommandType GetReplicationCommandType(System.Data.IDbCommand cmd, CommandFunction fct)
{
switch (fct)
{
case CommandFunction.ExecuteNonQuery:
return ReplicationCommandType.Write;
case CommandFunction.ExecuteScalar:
case CommandFunction.ExecuteReader:
return ReplicationCommandType.Read;
}
return ReplicationCommandType.Read;
}
示例4: CommandButton
void CommandButton(CommandFunction func, string buttonLabel, ref float buttonIndex)
{
if(GUI.Button(new Rect(margin, buttonEndY + (buttonIndex*(buttonHeight+buttonGap)), buttonWidth, buttonHeight), buttonLabel, HighLogic.Skin.button))
{
if(!selectAll)
{
if(focusIndex < wingmen.Count)
{
func(wingmen[focusIndex], focusIndex);
}
}
else
{
for(int i = 0; i < wingmen.Count; i++)
{
func(wingmen[i], i);
}
}
}
buttonIndex++;
}
示例5: WrapCommandFunction
private bool WrapCommandFunction(Command command, CommandFunction function, bool doing)
{
try
{
m_currentCommnd = command;
return function(doing);
}
finally
{
m_currentCommnd = Command.Invalid;
}
}
示例6: CommandButton
void CommandButton(CommandFunction func, string buttonLabel, ref float buttonLine, float startY, float margin, float buttonGap, float buttonWidth, float buttonHeight, bool sendToWingmen, bool pressed, object data)
{
float yPos = startY + margin + ((buttonHeight + buttonGap) * buttonLine);
if(GUI.Button(new Rect(margin, yPos, buttonWidth, buttonHeight), buttonLabel, pressed ? HighLogic.Skin.box : HighLogic.Skin.button))
{
if(sendToWingmen)
{
if(wingmen.Count > 0)
{
foreach(var index in focusIndexes)
{
func(wingmen[index], index, data);
}
}
if(commandSelf)
{
foreach(var ai in vessel.FindPartModulesImplementing<BDModulePilotAI>())
{
func(ai, -1, data);
}
}
}
else
{
func(null, -1, null);
}
}
buttonLine++;
}
示例7: RegisterCommandEx
public static void RegisterCommandEx(string name, CommandFunction<CCommand, int[], bool> action)
{
CRegistery.RegisterDelegate(name, action);
}
示例8: RegisterCommand
/// <summary>
/// Add a command to the debugger with a specific name and help text.
/// </summary>
/// <param name="name">The name of the method in the debugger.</param>
/// <param name="help">The help text to display in the console for the function.</param>
/// <param name="function">The method to register.</param>
/// <param name="types">The types for the arguments.</param>
public void RegisterCommand(string name, string help, CommandFunction function, params CommandType[] types)
{
if (commands.ContainsKey(name)) return;
if (instantCommands.ContainsKey(name)) return;
commands.Add(name, new DebugCommand(function, types) { HelpDescription = help, Name = name });
}
示例9: RegisterInstantCommand
void RegisterInstantCommand(string name, string help, CommandFunction function, params CommandType[] types)
{
instantCommands.Add(name, new DebugCommand(function, types) { HelpDescription = help, Name = name });
}
示例10: RegisterInstantCommand
public void RegisterInstantCommand(CommandFunction function, params CommandType[] types) {
RegisterInstantCommand(function, types);
}
示例11: CommandType
CommandType(string nam, CommandFunction fun, int pos, int lvl, LogType logged, bool shown, bool removeinvis, bool removehide, bool removemed, bool usePara, bool mustSpellOut)
{
Name = nam;
Function = fun;
MinLevel = lvl;
LoggingType = logged;
Show = shown;
BreakInvisibility = removeinvis;
BreakHide = removehide;
BreakMeditate = removemed;
MinPosition = pos;
CanUseWhenParalyzed = usePara;
MustSpellOut = mustSpellOut;
}