当前位置: 首页>>代码示例>>C#>>正文


C# CommandEventArgs.GetBoolean方法代码示例

本文整理汇总了C#中CommandEventArgs.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# CommandEventArgs.GetBoolean方法的具体用法?C# CommandEventArgs.GetBoolean怎么用?C# CommandEventArgs.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommandEventArgs的用法示例。


在下文中一共展示了CommandEventArgs.GetBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnRestoreCommand

		public static void OnRestoreCommand(CommandEventArgs e)
		{
			if (e.Mobile == null || e.Mobile.Deleted)
			{
				return;
			}

			bool moveExisting = false, logging = true;

			if (e.Arguments.Length > 0)
			{
				moveExisting = e.GetBoolean(0);
			}

			if (e.Arguments.Length > 1)
			{
				logging = e.GetBoolean(1);
			}

			e.Mobile.SendMessage("Target a PlayerMobile to restore...");
			e.Mobile.BeginTarget<PlayerMobile>(
				(m, t) =>
				{
					int created, deleted, ignored, moved;
					RestoreState(t, moveExisting, logging, out created, out deleted, out ignored, out moved);

					e.Mobile.SendMessage(
						"Restore: {0:#,0} created, {1:#,0} deleted, {2:#,0} ignored, and {3:#,0} moved item states.",
						created,
						deleted,
						ignored,
						moved);
				},
				null);
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:35,代码来源:PlayerBackup.cs

示例2: Animate_OnCommand

 public static void Animate_OnCommand( CommandEventArgs e )
 {
     if ( e.Length == 6 )
     {
         e.Mobile.Animate( e.GetInt32( 0 ), e.GetInt32( 1 ), e.GetInt32( 2 ), e.GetBoolean( 3 ), e.GetBoolean( 4 ), e.GetInt32( 5 ) );
     }
     else
     {
         e.Mobile.SendMessage( "Format: Animate <action> <frameCount> <repeatCount> <forward> <repeat> <delay>" );
     }
 }
开发者ID:notsentient,项目名称:RunZHA,代码行数:11,代码来源:Handlers.cs

示例3: OnBackupCommand

		public static void OnBackupCommand(CommandEventArgs e)
		{
			if (e.Mobile == null || e.Mobile.Deleted)
			{
				return;
			}

			e.Mobile.SendMessage("Target a PlayerMobile to backup...");
			e.Mobile.BeginTarget<PlayerMobile>(
				(m, t) =>
				{
					int count, fails;
					BackupState(t, !e.GetBoolean(0), out count, out fails);

					if (fails > 0)
					{
						e.Mobile.SendMessage("Backup: {0:#,0} / {1:#,0} saved item states.", count - fails, count);
					}
					else
					{
						e.Mobile.SendMessage("Backup: {0:#,0} saved item states.", count);
					}
				},
				null);
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:25,代码来源:PlayerBackup.cs

示例4: SetGuarded_OnCommand

		private static void SetGuarded_OnCommand( CommandEventArgs e )
		{
			Mobile from = e.Mobile;

			if ( e.Length == 1 )
			{
				GuardedRegion reg = (GuardedRegion) from.Region.GetRegion( typeof( GuardedRegion ) );

				if ( reg == null )
				{
					from.SendMessage( "You are not in a guardable region." );
				}
				else
				{
					reg.Disabled = !e.GetBoolean( 0 );

					if ( reg.Disabled )
						from.SendMessage( "The guards in this region have been disabled." );
					else
						from.SendMessage( "The guards in this region have been enabled." );
				}
			}
			else
			{
				from.SendMessage( "Format: SetGuarded <true|false>" );
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:27,代码来源:GuardedRegion.cs

示例5: SetProfiles_OnCommand

		public static void SetProfiles_OnCommand( CommandEventArgs e )
		{
			if ( e.Length == 1 )
				Core.Profiling = e.GetBoolean( 0 );
			else
				Core.Profiling = !Core.Profiling;

			e.Mobile.SendMessage( "Profiling has been {0}.", Core.Profiling ? "enabled" : "disabled" );
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:9,代码来源:Profiling.cs

示例6: ConsoleListen_OnCommand

		public static void ConsoleListen_OnCommand( CommandEventArgs e )
		{
			if( e.Length == 1 )
			{
				SetConsoleListen( e.GetBoolean( 0 ) );
				e.Mobile.SendMessage( "Console speech output has been {0}.", ConsoleEnabled ? "enabled" : "disabled" );
			}
			else
			{
				e.Mobile.SendMessage( "Format: ConsoleListen <true | false >" );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:12,代码来源:WorldSpeechLogging.cs

示例7: SetSaves_OnCommand

		public static void SetSaves_OnCommand( CommandEventArgs e )
		{
			if ( e.Length == 1 )
			{
				m_SavesEnabled = e.GetBoolean( 0 );
				e.Mobile.SendMessage( "Saves have been {0}.", m_SavesEnabled ? "enabled" : "disabled" );
			}
			else
			{
				e.Mobile.SendMessage( "Format: SetSaves <true | false>" );
			}
		}
开发者ID:greeduomacro,项目名称:GoUO,代码行数:12,代码来源:AutoSave.cs

示例8: DragEffects_OnCommand

		public static void DragEffects_OnCommand( CommandEventArgs e )
		{
			if ( e.Length == 0 )
			{
				e.Mobile.SendMessage( "Drag effects are currently {0}.", Mobile.DragEffects ? "enabled" : "disabled" );
			}
			else
			{
				Mobile.DragEffects = e.GetBoolean( 0 );

				e.Mobile.SendMessage( "Drag effects have been {0}.", Mobile.DragEffects ? "enabled" : "disabled" );
			}
		}
开发者ID:nathanvy,项目名称:runuo,代码行数:13,代码来源:DragEffects.cs

示例9: SpeedBoost_OnCommand

        private static void SpeedBoost_OnCommand( CommandEventArgs e )
        {
            Mobile from = e.Mobile;

            if ( e.Length <= 1 )
            {
                if ( e.Length == 1 && !e.GetBoolean( 0 ) )
                {
                    from.Send( SpeedControl.Disable );
                    from.SendMessage( "Speed boost has been disabled." );
                }
                else
                {
                    from.Send( SpeedControl.MountSpeed );
                    from.SendMessage( "Speed boost has been enabled." );
                }
            }
            else
            {
                from.SendMessage( "Format: SpeedBoost [true|false]" );
            }
        }
开发者ID:notsentient,项目名称:RunZHA,代码行数:22,代码来源:Handlers.cs

示例10: SpeedBoost_OnCommand

		private static void SpeedBoost_OnCommand( CommandEventArgs e )
		{
			Mobile from = e.Mobile;
            if (from.NetState == null || from.NetState.Account == null) return;

            if (from.AccessLevel == AccessLevel.Player)
            {
                // only allow it if they are a pseudoseer with any permissions
                Mobile controllingMob = from.NetState.Account.GetPseudoSeerLastCharacter();
                if (controllingMob != null && controllingMob.Account != null)
                {
                    if (controllingMob.AccessLevel == AccessLevel.Player)
                    {
                        if (!(from is BaseCreature))
                        {
                            from.SendMessage("You do not have access to that command.");
                            return;
                        }
                        else
                        {
                            BaseCreature bc = (BaseCreature)from;
                            if (!PseudoSeerStone.AllowAllPossessedMobsSpeedBoost)
                            {
                                if (!PseudoSeerStone.AllowPseudoseerMobsSpeedBoost 
                                    || bc.PseudoSeerPermissions == null 
                                    || bc.PseudoSeerPermissions == String.Empty)
                                {
                                    from.SendMessage("You do not have access to that command.");
                                    return;
                                }
                                // otherwise they are a pseudoseer with permissions--allow speedboost
                            }
                            // otherwise they are possessing a mob, and all possessed mobs can have speedboost
                        }
                    }
                    // otherwise they are >= Counselor--allow speedboost
                }
                else
                {
                    from.SendMessage("You do not have access to that command.");
                    return;
                }
            }

			if ( e.Length <= 1 )
			{
				bool on = e.GetBoolean( 0 ) || e.ArgString.Trim().ToLower() == "on";
				if ( e.Length == 1 && !on )
				{
					from.Send( SpeedControl.Disable );
					from.SendMessage( "Speed boost has been disabled." );
				}
				else
				{
					from.Send( SpeedControl.MountSpeed );
					from.SendMessage( "Speed boost has been enabled." );
				}
			}
			else
			{
				from.SendMessage( "Format: SpeedBoost [true|false]" );
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:63,代码来源:Handlers.cs

示例11: SetDonations_OnCommand

 public static void SetDonations_OnCommand(CommandEventArgs e)
 {
     if (e.Length == 1)
     {
         ms_ClaimDonationsBlocked = !e.GetBoolean(0);//Note: true leads to donations not being blocked!
         e.Mobile.SendMessage("Donations have been {0}.", ms_ClaimDonationsBlocked ? "disabled" : "enabled");
         e.Mobile.SendMessage("Warning: Donations will be reactivated on server restart!");
     }
     else
     {
         e.Mobile.SendMessage("Donations are {0}.", ms_ClaimDonationsBlocked ? "disabled" : "enabled");
         e.Mobile.SendMessage("Format: SetDonations <true | false>");
     }
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:14,代码来源:Donation.cs

示例12: AutoRestart_OnCommand

		public static void AutoRestart_OnCommand( CommandEventArgs e )
		{
			if ( e.Length == 1 )
			{
				Enabled = e.GetBoolean( 0 );
				if ( Enabled )
				{
					m_RestartTime = DateTime.Now.Date;
					if ( m_RestartTime < DateTime.Now )
						m_RestartTime += RestartDay + RestartHour + RestartMinute;
				}
					
				e.Mobile.SendMessage( "Auto restarting has been {0}.", Enabled ? "enabled" : "disabled" );
			}
			else
			{
				e.Mobile.SendMessage( "Format: AutoRestart <true | false>" );
				e.Mobile.SendMessage( "Auto restarting is currently {0}.", Enabled ? "enabled" : "disabled" );
				return;
			}
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:21,代码来源:AutoRestartNew.cs

示例13: SaveAllQuests_OnCommand

		public static void SaveAllQuests_OnCommand( CommandEventArgs e )
		{
			Mobile m = e.Mobile;

			if ( e.Length > 1 )
			{
				m.SendMessage( "Syntax: SaveAllQuests [saveEnabled=true]" );
				return;
			}

			bool enable = ( e.Length == 1 ) ? e.GetBoolean( 0 ) : true;

			foreach ( MLQuest quest in m_Quests.Values )
				quest.SaveEnabled = enable;

			m.SendMessage( "Serialization for all quests is now {0}.", enable ? "enabled" : "disabled" );

			if ( AutoGenerateNew && !enable )
				m.SendMessage( "Please note that automatic generation of new quests is ON. All quests will be regenerated on the next server start." );
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:20,代码来源:MLQuestSystem.cs

示例14: SaveQuest_OnCommand

		public static void SaveQuest_OnCommand( CommandEventArgs e )
		{
			Mobile m = e.Mobile;

			if ( e.Length == 0 || e.Length > 2 )
			{
				m.SendMessage( "Syntax: SaveQuest <id> [saveEnabled=true]" );
				return;
			}

			Type index = ScriptCompiler.FindTypeByName( e.GetString( 0 ) );
			MLQuest quest;

			if ( index == null || !m_Quests.TryGetValue( index, out quest ) )
			{
				m.SendMessage( "Invalid quest type name." );
				return;
			}

			bool enable = ( e.Length == 2 ) ? e.GetBoolean( 1 ) : true;

			quest.SaveEnabled = enable;
			m.SendMessage( "Serialization for quest {0} is now {1}.", quest.GetType().Name, enable ? "enabled" : "disabled" );

			if ( AutoGenerateNew && !enable )
				m.SendMessage( "Please note that automatic generation of new quests is ON. This quest will be regenerated on the next server start." );
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:27,代码来源:MLQuestSystem.cs

示例15: ExecuteList

 public override void ExecuteList(CommandEventArgs e, ArrayList list)
 {
     e.Mobile.SendGump(new WarningGump(1060637, 30720, String.Format("You are about to insert {0} objects. This cannot be undone without a full server revert.<br><br>Continue?", list.Count), 0xFFC000, 420, 280, new WarningGumpCallback(OnConfirmCallback), new object[] { e, list, (e.Length < 1 || !e.GetBoolean(0)) }));
     this.AddResponse("Awaiting confirmation...");
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:5,代码来源:DesignInsert.cs


注:本文中的CommandEventArgs.GetBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。