/// <summary> /// /// </summary> /// <param name="strGameCommand"></param> /// <param name="iAccessLevel"></param> /// <param name="eventGameCommand"></param> public GameCommandHandler Register(string strGameCommand, AccessLevel accessLevel, DelegateGameCommandCall delegateGameCommandCall) { return(Register(strGameCommand, true, accessLevel, delegateGameCommandCall)); }
/// <summary> /// /// </summary> /// <param name="strGameCommand"></param> /// <param name="iAccessLevel"></param> /// <param name="eventGameCommand"></param> public GameCommandHandler Register( string strGameCommand, AccessLevel accessLevel, DelegateGameCommandCall delegateGameCommandCall ) { return Register( strGameCommand, true, accessLevel, delegateGameCommandCall ); }
/// <summary> /// /// </summary> /// <param name="strGameCommand"></param> /// <param name="caseIgnore"></param> /// <param name="accessLevel"></param> /// <param name="delegateGameCommandCall"></param> /// <returns></returns> public GameCommandHandler Register(string strGameCommand, bool bIgnoreCase, AccessLevel accessLevel, DelegateGameCommandCall delegateGameCommandCall) { if (strGameCommand == null || strGameCommand == string.Empty) { throw new Exception("GameCommandManager.Register(...) - strGameCommand == null || strGameCommand == string.Empty error!"); } GameCommandHandler gameCommand = null; if (bIgnoreCase == true) { string strIgnoreCase = strGameCommand.ToLower(); gameCommand = m_GameCommandsIgnoreCase.GetValue(strIgnoreCase); if (gameCommand == null) { gameCommand = new GameCommandHandler(); gameCommand.GameCommand = strGameCommand; gameCommand.IgnoreCase = bIgnoreCase; gameCommand.AccessLevel = accessLevel; m_GameCommandsIgnoreCase.Add(strIgnoreCase, gameCommand); } } else { gameCommand = m_GameCommandsInvariant.GetValue(strGameCommand); if (gameCommand == null) { gameCommand = new GameCommandHandler(); gameCommand.GameCommand = strGameCommand; gameCommand.IgnoreCase = bIgnoreCase; gameCommand.AccessLevel = accessLevel; m_GameCommandsInvariant.Add(strGameCommand, gameCommand); } } if (delegateGameCommandCall != null) { gameCommand.ThreadGameCommandCall += new EventHandler <GameCommandEventArgs>(delegateGameCommandCall); } return(gameCommand); }
/// <summary> /// /// </summary> /// <param name="strGameCommand"></param> /// <param name="caseIgnore"></param> /// <param name="accessLevel"></param> /// <param name="delegateGameCommandCall"></param> /// <returns></returns> public GameCommandHandler Register( string strGameCommand, bool bIgnoreCase, AccessLevel accessLevel, DelegateGameCommandCall delegateGameCommandCall ) { if ( strGameCommand == null || strGameCommand == string.Empty ) throw new Exception( "GameCommandManager.Register(...) - strGameCommand == null || strGameCommand == string.Empty error!" ); GameCommandHandler gameCommand = null; if ( bIgnoreCase == true ) { string strIgnoreCase = strGameCommand.ToLower(); gameCommand = m_GameCommandsIgnoreCase.GetValue( strIgnoreCase ); if ( gameCommand == null ) { gameCommand = new GameCommandHandler(); gameCommand.GameCommand = strGameCommand; gameCommand.IgnoreCase = bIgnoreCase; gameCommand.AccessLevel = accessLevel; m_GameCommandsIgnoreCase.Add( strIgnoreCase, gameCommand ); } } else { gameCommand = m_GameCommandsInvariant.GetValue( strGameCommand ); if ( gameCommand == null ) { gameCommand = new GameCommandHandler(); gameCommand.GameCommand = strGameCommand; gameCommand.IgnoreCase = bIgnoreCase; gameCommand.AccessLevel = accessLevel; m_GameCommandsInvariant.Add( strGameCommand, gameCommand ); } } if ( delegateGameCommandCall != null ) gameCommand.ThreadGameCommandCall += new EventHandler<GameCommandEventArgs>( delegateGameCommandCall ); return gameCommand; }