示例#1
0
        public void DelegateTest()
        {
            ConsoleDelegate d = ConsoleMethod;

            //ConsoleDelegate t = new ConsoleDelegate("sada");
            d("Something");
            //Assert.AreEqual("", 1);
        }
示例#2
0
 /// <summary>
 ///     Parancs regisztráló függvény.
 /// </summary>
 public void RegisterHandler(string command, ConsoleDelegate method)
 {
     if (ConsoleMethodMap.ContainsKey(command))
     {
         ConsoleMethodMap[command].Method += method;
     }
     else
     {
         ConsoleMethodMap.Add(command, new ConsoleMethod(method));
     }
 }
示例#3
0
        /// <summary>
        ///     Parancs eltávolító függvény.
        /// </summary>
        public void RemoveHandler(string command, ConsoleDelegate method)
        {
            if (ConsoleMethodMap.ContainsKey(command))
            {
                ConsoleMethodMap[command].Method -= method;

                if (ConsoleMethodMap[command].Method.IsNull())
                {
                    ConsoleMethodMap.Remove(command);
                }
            }
        }
示例#4
0
 public ConsoleMethod(ConsoleDelegate method)
 {
     Method = method;
 }
示例#5
0
        /// <summary>
        ///     Parancs eltávolító függvény.
        /// </summary>
        public static void RemoveHandler(string command, ConsoleDelegate method)
        {
            if(ConsoleMethodMap.ContainsKey(command))
            {
                ConsoleMethodMap[command].Method -= method;

                if(ConsoleMethodMap[command].Method.IsNull())
                    ConsoleMethodMap.Remove(command);
            }
        }
示例#6
0
 /// <summary>
 ///     Parancs regisztráló függvény.
 /// </summary>
 public static void RegisterHandler(string command, ConsoleDelegate method)
 {
     if(ConsoleMethodMap.ContainsKey(command))
         ConsoleMethodMap[command].Method += method;
     else
         ConsoleMethodMap.Add(command, new ConsoleMethod(method));
 }
示例#7
0
 public ConsoleMethod(ConsoleDelegate method)
 {
     Method = method;
 }