コード例 #1
0
ファイル: SyncFunctionCE.cs プロジェクト: ewin66/Robotics
 /// <summary>
 /// Initializes a new instance of AsyncFunctionCE for the asynchronous execution of a command
 /// </summary>
 /// <param name="commandName">The name of the command that the AsyncFunctionCE will execute</param>
 /// <param name="executerMethod">The method/function that will perform the command execution</param>
 /// <param name="parametersRequired">Indicates if the executer requires parameters</param>
 public SyncFunctionCE(string commandName, CommandExecuterMethod executerMethod, bool parametersRequired)
     : base(commandName)
 {
     if (executerMethod == null)
     {
         throw new ArgumentNullException();
     }
     this.executerMethod     = executerMethod;
     this.parametersRequired = parametersRequired;
 }
コード例 #2
0
ファイル: Module.cs プロジェクト: ewin66/Robotics
 /// <summary>
 /// Registers a method or function to work as a synchronous command executer
 /// </summary>
 /// <param name="commandName">The name of the command that the AsyncFunctionCE will execute</param>
 /// <param name="executerMethod">The method/function that will perform the command execution</param>
 /// <param name="parametersRequired">Indicates if the method or function requires parameters to be executed</param>
 /// <returns>Zero if the method or function was registered successfully, otherwise it returns the error number</returns>
 public int RegFuncForSCE(string commandName, CommandExecuterMethod executerMethod, bool parametersRequired)
 {
     try
     {
         SyncFunctionCE sce = new SyncFunctionCE(commandName, executerMethod, parametersRequired);
         cmdMan.CommandExecuters.Add(sce);
     }
     catch (Exception ex)
     {
         return(GetErrorCode(ex));
     }
     return(0);
 }
コード例 #3
0
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_strId">The id of the command</param>
 /// <param name="p_strName">The name of the command.</param>
 /// <param name="p_strDescription">The description of the command.</param>
 /// <param name="p_imgImage">The image of the command.</param>
 /// <param name="p_eehExecute">An <see cref="CommandExecuterMethod{T}"/> that will be
 /// perform the command work.</param>
 /// <param name="p_booCanExecute">Whether or not the command can be executed.</param>
 public Command(string p_strId, string p_strName, string p_strDescription, Image p_imgImage, CommandExecuterMethod <T> p_eehExecute, bool p_booCanExecute)
     : base(p_strId, p_strName, p_strDescription, p_imgImage, p_booCanExecute)
 {
     ExecuteMethod = p_eehExecute;
 }
コード例 #4
0
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_strName">The name of the command.</param>
 /// <param name="p_strDescription">The description of the command.</param>
 /// <param name="p_eehExecute">An <see cref="CommandExecuterMethod{T}"/> that will be
 /// perform the command work.</param>
 /// <param name="p_booCanExecute">Whether or not the command can be executed.</param>
 public Command(string p_strName, string p_strDescription, CommandExecuterMethod <T> p_eehExecute, bool p_booCanExecute)
     : this(null, p_strName, p_strDescription, null, p_eehExecute, p_booCanExecute)
 {
 }
コード例 #5
0
ファイル: Command.cs プロジェクト: etinquis/nexusmodmanager
		/// <summary>
		/// A simple constructor that initializes the object with the given values.
		/// </summary>
		/// <param name="p_strId">The id of the command</param>
		/// <param name="p_strName">The name of the command.</param>
		/// <param name="p_strDescription">The description of the command.</param>
		/// <param name="p_imgImage">The image of the command.</param>
		/// <param name="p_eehExecute">An <see cref="CommandExecuterMethod"/> that will be
		/// perform the command work.</param>
		/// <param name="p_booCanExecute">Whether or not the command can be executed.</param>
		public Command(string p_strId, string p_strName, string p_strDescription, Image p_imgImage, CommandExecuterMethod p_eehExecute, bool p_booCanExecute)
			: base(p_strId, p_strName, p_strDescription, p_imgImage, p_booCanExecute)
		{
			ExecuteMethod = p_eehExecute;
		}
コード例 #6
0
ファイル: Command.cs プロジェクト: etinquis/nexusmodmanager
		/// <summary>
		/// A simple constructor that initializes the object with the given values.
		/// </summary>
		/// <param name="p_strName">The name of the command.</param>
		/// <param name="p_strDescription">The description of the command.</param>
		/// <param name="p_eehExecute">An <see cref="CommandExecuterMethod"/> that will be
		/// perform the command work.</param>
		/// <param name="p_booCanExecute">Whether or not the command can be executed.</param>
		public Command(string p_strName, string p_strDescription, CommandExecuterMethod p_eehExecute, bool p_booCanExecute)
			: this(null, p_strName, p_strDescription, null, p_eehExecute, p_booCanExecute)
		{
		}
コード例 #7
0
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_strName">The name of the command.</param>
 /// <param name="p_strDescription">The description of the command.</param>
 /// <param name="p_booIsChecked">Whether the command is checked.</param>
 /// <param name="p_eehExecute">An <see cref="CommandExecuterMethod{T}"/> that will be
 /// perform the command work.</param>
 public CheckedCommand(string p_strName, string p_strDescription, bool p_booIsChecked, CommandExecuterMethod <T> p_eehExecute)
     : this(null, p_strName, p_strDescription, null, p_booIsChecked, p_eehExecute, true)
 {
 }
コード例 #8
0
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_strId">The id of the command</param>
 /// <param name="p_strName">The name of the command.</param>
 /// <param name="p_strDescription">The description of the command.</param>
 /// <param name="p_imgImage">The image of the command.</param>
 /// <param name="p_eehExecute">An <see cref="CommandExecuterMethod{T}"/> that will be
 /// perform the command work.</param>
 /// <param name="p_booCanExecute">Whether or not the command can be executed.</param>
 public CheckedCommand(string p_strId, string p_strName, string p_strDescription, Image p_imgImage, CommandExecuterMethod <T> p_eehExecute, bool p_booCanExecute)
     : this(p_strId, p_strName, p_strDescription, p_imgImage, false, p_eehExecute, p_booCanExecute)
 {
 }
コード例 #9
0
		/// <summary>
		/// A simple constructor that initializes the object with the given values.
		/// </summary>
		/// <param name="p_strName">The name of the command.</param>
		/// <param name="p_strDescription">The description of the command.</param>
		/// <param name="p_booIsChecked">Whether the command is checked.</param>
		/// <param name="p_eehExecute">An <see cref="CommandExecuterMethod"/> that will be
		/// perform the command work.</param>
		public CheckedCommand(string p_strName, string p_strDescription, bool p_booIsChecked, CommandExecuterMethod p_eehExecute)
			: this(null, p_strName, p_strDescription, null, p_booIsChecked, p_eehExecute, true)
		{
		}
コード例 #10
0
		/// <summary>
		/// A simple constructor that initializes the object with the given values.
		/// </summary>
		/// <param name="p_strId">The id of the command</param>
		/// <param name="p_strName">The name of the command.</param>
		/// <param name="p_strDescription">The description of the command.</param>
		/// <param name="p_imgImage">The image of the command.</param>
		/// <param name="p_booIsChecked">Whether the command is checked.</param>
		/// <param name="p_eehExecute">An <see cref="CommandExecuterMethod"/> that will be
		/// perform the command work.</param>
		/// <param name="p_booCanExecute">Whether or not the command can be executed.</param>
		public CheckedCommand(string p_strId, string p_strName, string p_strDescription, Image p_imgImage, bool p_booIsChecked, CommandExecuterMethod p_eehExecute, bool p_booCanExecute)
			: base(p_strId, p_strName, p_strDescription, p_imgImage, p_eehExecute, p_booCanExecute)
		{
			IsChecked = p_booIsChecked;
		}
コード例 #11
0
		/// <summary>
		/// A simple constructor that initializes the object with the given values.
		/// </summary>
		/// <param name="p_strId">The id of the command</param>
		/// <param name="p_strName">The name of the command.</param>
		/// <param name="p_strDescription">The description of the command.</param>
		/// <param name="p_imgImage">The image of the command.</param>
		/// <param name="p_eehExecute">An <see cref="CommandExecuterMethod"/> that will be
		/// perform the command work.</param>
		/// <param name="p_booCanExecute">Whether or not the command can be executed.</param>
		public CheckedCommand(string p_strId, string p_strName, string p_strDescription, Image p_imgImage, CommandExecuterMethod p_eehExecute, bool p_booCanExecute)
			: this(p_strId, p_strName, p_strDescription, p_imgImage, false, p_eehExecute, p_booCanExecute)
		{
		}
コード例 #12
0
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_strName">The name of the command.</param>
 /// <param name="p_strDescription">The description of the command.</param>
 /// <param name="p_eehExecute">An <see cref="CommandExecuterMethod"/> that will be
 /// perform the command work.</param>
 public Command(string p_strName, string p_strDescription, CommandExecuterMethod p_eehExecute)
     : this(null, p_strName, p_strDescription, null, p_eehExecute, true)
 {
 }
コード例 #13
0
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_strId">The id of the command</param>
 /// <param name="p_strName">The name of the command.</param>
 /// <param name="p_strDescription">The description of the command.</param>
 /// <param name="p_imgImage">The image of the command.</param>
 /// <param name="p_booIsChecked">Whether the command is checked.</param>
 /// <param name="p_eehExecute">An <see cref="CommandExecuterMethod"/> that will be
 /// perform the command work.</param>
 /// <param name="p_booCanExecute">Whether or not the command can be executed.</param>
 public CheckedCommand(string p_strId, string p_strName, string p_strDescription, Image p_imgImage, bool p_booIsChecked, CommandExecuterMethod p_eehExecute, bool p_booCanExecute)
     : base(p_strId, p_strName, p_strDescription, p_imgImage, p_eehExecute, p_booCanExecute)
 {
     IsChecked = p_booIsChecked;
 }