Controller.RemoveViewCommand C# (CSharp) Method

RemoveViewCommand() public method

public RemoveViewCommand ( IView view, string commandNames ) : void
view IView
commandNames string
return void
    public virtual void RemoveViewCommand(IView view, string[] commandNames)
    {
        lock (mSyncRoot)
        {
            if (mViewCmdMap.ContainsKey(view))
            {
                List<string> list = null;
                if (mViewCmdMap.TryGetValue(view, out list))
                {
                    for (int i = 0; i < commandNames.Length; i++)
                    {
                        if (!list.Contains(commandNames[i])) continue;
                        list.Remove(commandNames[i]);
                    }
                }
            }
        }
    }
}

Usage Example

Example #1
0
 static int RemoveViewCommand(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         Controller obj  = (Controller)ToLua.CheckObject <Controller>(L, 1);
         IView      arg0 = (IView)ToLua.CheckObject <IView>(L, 2);
         string[]   arg1 = ToLua.CheckStringArray(L, 3);
         obj.RemoveViewCommand(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }