Ejemplo n.º 1
0
 public MethodCommand(string methodName, object instance, TypeConverterCollection converterCollection, string description = null)
 {
     method                   = instance.GetType().GetMethod(methodName);
     this.instance            = instance;
     this.converterCollection = converterCollection;
     this.description         = description;
 }
Ejemplo n.º 2
0
 public MethodCommand(MethodInfo method, object instance, TypeConverterCollection converterCollection, string description = null)
 {
     this.method              = method;
     this.instance            = instance;
     this.converterCollection = converterCollection;
     this.description         = description;
 }
Ejemplo n.º 3
0
        void Start()
        {
            Converters = new TypeConverterCollection(
                new StringToIntConverter(),
                new StringToFloatConverter(),
                new StringToBoolConverter());

            AddDefaultCommands();
        }
Ejemplo n.º 4
0
        public void AddCommand(string key, object instance, TypeConverterCollection converterCollection, string description)
        {
            MethodInfo method = instance.GetType().GetMethod(key);

            if (method == null)
            {
                Log("No method named \"{0}\" found.", key);
                return;
            }

            AddCommand(key, method, instance, converterCollection, description);
        }
Ejemplo n.º 5
0
 public void AddCommand(string key, MethodInfo method, object instance, TypeConverterCollection converterCollection, string description)
 {
     AddCommand(key, new MethodCommand(method, instance, converterCollection, description));
 }
Ejemplo n.º 6
0
        public void AddCommand(MethodInfo method, object instance, TypeConverterCollection converterCollection, string description)
        {
            string key = method.Name.ToLower();

            AddCommand(key, method, instance, converterCollection, description);
        }