本文整理汇总了C#中CommandManager类的典型用法代码示例。如果您正苦于以下问题:C# CommandManager类的具体用法?C# CommandManager怎么用?C# CommandManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommandManager类属于命名空间,在下文中一共展示了CommandManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
commandManager = new CommandManager();
interactiveMusic = new InteractiveMusic();
}
示例2: Players
public Players(CommandManager c)
{
this.c = c;
//CommandManager.AddTab(ParseTab, "help", "h");
c.AddCommand(TheEnd, null, "theend");
c.AddCommand(Position, "position", "pos", "coord", "coords", "cord");
c.AddCommand(Time, null, "time", "timeset", "settime");
c.AddCommand(Load, "load", "lag", "uptime", "l");
c.AddCommand(Die, "kill", "suicide", "killmyself", "kil", "death", "die");
c.AddCommand(Inbox.Read, "read");
c.AddCommand(Stat, "stat");
c.AddCommand(Donate, "donate", "donors", "donor", "doner", "donator", "dontae", "vip");
c.AddCommand(Motd, "motd", "welcome", "info");
c.AddCommand(Rules, "rulebook", "rules", "rule");
c.AddCommand(Version, "version", "ver");
c.AddCommand(Pardon, "pardon", "vote", "vot", "unban", "uban", "umbanned", "unbanned");
c.AddCommand(ToGreenRoom, "greenroom", "wait");
c.AddCommand(ToConstruct, "construct", "con", "cons");
c.AddCommand(ToHell, "hell", "hel");
c.AddCommand(ToRealWorld, "vanilla", "real", "back");
c.AddCommand(ToIsland, "island");
c.AddCommand(ToHardcore, "hardcore");
c.AddCommand(ToWarp, "warp");
c.AddCommand(LockChest, null, "lock", "lwc", "chest", "cprivate", "private", "lcpassword");
}
示例3: Application_Start
protected void Application_Start()
{
var cs = ConnectionSettings.Create();
var endpoint = new IPEndPoint(IPAddress.Loopback, 1113);
var con = EventStoreConnection.Create(endpoint);
con.ConnectAsync();
var credentials = new EventStore.ClientAPI.SystemData.UserCredentials("admin", "changeit");
var adapter = new EventStoreAdapter(endpoint, credentials);
ProjectionManager = new ProjectionManager(endpoint, credentials, adapter);
ProjectionManager.Run();
CommandManager = new CommandManager(con);
//var binder = new DefaultModelBinder();
//ModelBinders.Binders.Add(typeof(DateTime), binder);
//ModelBinders.Binders.Add(typeof(DateTime?), binder);
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
示例4: ConnectionManagerTester
/// <summary>
/// Constructor. Inicializa instancias de la clase ConnectionManagerTester
/// </summary>
public ConnectionManagerTester()
{
/*
* Primero se crea el CommandManager. Este gestiona los comandos de
* sistema como alive, busy, ready, etc. Ahorra trabajo.
* Adicionalmente se suscriben los eventos (apuntador a funcion)
* para manejar las notificaciones de la clase
*/
commandManager = new CommandManager();
commandManager.Started += new CommandManagerStatusChangedEventHandler(commandManager_Started);
commandManager.Stopped += new CommandManagerStatusChangedEventHandler(commandManager_Stopped);
commandManager.CommandReceived += new CommandReceivedEventHandler(commandManager_CommandReceived);
commandManager.ResponseReceived += new ResponseReceivedEventHandler(commandManager_ResponseReceived);
/*
* Ahora se inicializa el ConnectionManager. Bajo el esquema actual
* todas las aplicaciones son servidores y es el blackboard el que
* se conecta a ellas (asi solo es necesario configurar una
* aplicacion). Se le indica nombre del modulo, puerto de conexion
* y el gestor de comandos. El modulo y puerto deben ser
* configurados en el blackboard
*/
connectionManager = new ConnectionManager("TESTER", 2000, 2000, IPAddress.Loopback, commandManager);
connectionManager.Started += new ConnectionManagerStatusChangedEventHandler(connectionManager_Started);
connectionManager.Stopped += new ConnectionManagerStatusChangedEventHandler(connectionManager_Stopped);
connectionManager.ClientDisconnected += new TcpClientDisconnectedEventHandler(connectionManager_ClientDisconnected);
connectionManager.ClientConnected += new TcpClientConnectedEventHandler(connectionManager_ClientConnected);
// Configuro el reloj
sw = new System.Diagnostics.Stopwatch();
}
示例5: MoveTo
public MoveTo(CommandManager parent,Vector3 target)
{
m_target = target;
m_parent = parent;
//find the navagation agent and set the destination
m_parent.GetComponent<NavMeshAgent>().destination = m_target;
}
示例6: Create
public HttpResponseMessage Create(FileDto fileDto)
{
CommandManager cm = new CommandManager();
cm.Send(new CreateCommand(Guid.NewGuid(), fileDto.Name, fileDto.CreateDate));
return new HttpResponseMessage(HttpStatusCode.OK);
}
示例7: Help
public Help(CommandManager c)
{
this.c = c;
c.AddTab(ParseTab, "help", "h");
c.AddCommand(ParseCommandHelp, "help", "h");
c.AddCommand(ParseCommandChatHelp, "chathelp");
}
示例8: OnCommandEvent
void OnCommandEvent( CommandManager.CommandEventData data )
{
data.LockInput();
FrameRateUtility.StartCoroutine( delay, () =>
{
Application.Quit();
});
}
示例9: GetCommand_ThrowsIfNoCommandFound
public void GetCommand_ThrowsIfNoCommandFound()
{
// Arrange
CommandManager cm = new CommandManager();
// Act and Assert
ExceptionAssert.Throws<CommandLineException>(() => cm.GetCommand("NoCommandByThisName"), "Unknown command: 'NoCommandByThisName'");
}
示例10: PluginExample
public PluginExample()
{
this.cmdMan = new CommandManager();
Engine engine = new Engine();
this.cmdMan.CommandExecuters.Add(new FactorialCommandExecuter(engine));
this.cmdMan.CommandExecuters.Add(new StatusCommandExecuter(engine));
this.gui = new FrmPluginExample();
}
示例11: Start
// Use this for initialization
void Start()
{
renderer.material.SetTexture ("_MainTex", switchOff); //Die Standardtextur wird auf aus gestellt
switchState = false; //Die Abfrage wird Standardmässig auf aus gestellt
cm = GameObject.FindGameObjectWithTag("GameController").GetComponent<CommandManager>();
//Es wird das GameObjekt mit dem Tag "GameController" gesucht und die Daten die es
//dank des Scripts CommandManager sammelt werden hier eingebunden
}
示例12: getInstance
public static CommandManager getInstance()
{
if ( _instance == null )
{
_instance = new CommandManager();
}
return _instance;
}
示例13: Main
public static void Main()
{
ICommandManager commandManager = new CommandManager();
IUserInterface userInterface = new ConsoleInterface();
IRequester requester = new Requester();
var engine = new GameEngine(userInterface, commandManager, requester);
engine.Run();
}
示例14: CommandExecuter
/// <summary>
/// Initializes a new instance of CommandExecuter
/// </summary>
/// <param name="commandName">The name of the command that the CommandExecuter will execute</param>
/// <param name="commandManager">The CommandManager object that will handle the command executed by this CommandExecuter instance</param>
public CommandExecuter(string commandName, CommandManager commandManager)
{
this.commandName = commandName;
this.responseRequired = true;
SignatureBuilder sb = new SignatureBuilder();
sb.AddNewFromDelegate(new StringArrayEventHandler(this.DefaultParameterParser));
this.signature = sb.GenerateSignature(this.commandName);
//if (commandManager != null)
// commandManager.CommandExecuters.Add(this);
}
示例15: RegisterCommand_AddsCommandToDictionary
public void RegisterCommand_AddsCommandToDictionary()
{
// Arrange
CommandManager cm = new CommandManager();
ICommand mockCommand = new MockCommand();
// Act
cm.RegisterCommand(mockCommand);
// Assert
Assert.Equal(1, cm.GetCommands().Count());
}