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


C# CommandEventArgs类代码示例

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


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

示例1: Season_OnCommand

		private static void Season_OnCommand( CommandEventArgs e )
		{
			Mobile m = e.Mobile;

			if( e.Length == 1 )
			{
				string seasonType = e.GetString( 0 ).ToLower();
				SeasonList season;

				try
				{
					season = (SeasonList)Enum.Parse( typeof( SeasonList ), seasonType, true );
				}
				catch
				{
					m.SendMessage( "Usage: Season spring | summer | fall | winter | desolation" );
					return;
				}

				m.SendMessage( "Setting season to: " + seasonType + "." );
				SetSeason( m, season );
			}
			else
				m.SendMessage( "Usage: Season spring | summer | fall | winter | desolation" );
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:25,代码来源:SeasonCommand.cs

示例2: OnErrors

		private static void OnErrors( CommandEventArgs e )
		{
			if ( e.ArgString == null || e.ArgString == "" )
				ErrorsGump.SendTo( e.Mobile );
			else
				Report( e.ArgString + " - " + e.Mobile.Name );
		}
开发者ID:greeduomacro,项目名称:uodarktimes-1,代码行数:7,代码来源:Errors.cs

示例3: OnCommand

        public static void OnCommand(CommandEventArgs e)
        {
            if (s_Commands[e.Command.ToLower()] == null)
                return;

            ((TownHouseCommandHandler)s_Commands[e.Command.ToLower()])(new CommandInfo(e.Mobile, e.Command, e.ArgString, e.Arguments));
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:7,代码来源:RUOVersion.cs

示例4: ClaimDonations_OnCommand

 public static void ClaimDonations_OnCommand(CommandEventArgs e)
 {
     if (ms_ClaimDonationsBlocked)
         e.Mobile.SendMessage("[claimdonations deactivated. Please contact an Administrator.");
     else
         CheckDonations(e.Mobile);
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:7,代码来源:Donation.cs

示例5: OnCommand

        public static void OnCommand(CommandEventArgs arg)
        {
            Mobile m = arg.Mobile;

            string skillNames = string.Join(", ", Enum.GetNames(typeof(SkillName)));

            if (arg.Length != 1)
            {
                m.SendMessage("Usage: SetSkill <skill name>. List of skill names: {0}.", skillNames);
            }
            else
            {
                SkillName skillName;
                if (Enum.TryParse(arg.GetString(0), true, out skillName))
                {
                    Skill skill = m.Skills[skillName];
                    if (skill != null)
                    {
                        skill.Base = 0;
                        m.SendMessage("You've successfully reset your {0}.", skill.Name);
                    }
                }
                else
                {
                    m.SendMessage("You have specified an invalid skill to set. List of skill names: {0}.", skillNames);
                }
            }
        }
开发者ID:Vorpalstar,项目名称:runuo-custom-scripts,代码行数:28,代码来源:ResetSkill.cs

示例6: ValidateName_OnCommand

		public static void ValidateName_OnCommand( CommandEventArgs e )
		{
			if ( Validate( e.ArgString, 2, 16, true, true, true, 1, SpaceDashPeriodQuote ) )
				e.Mobile.SendMessage( 0x59, "That name is considered valid." );
			else
				e.Mobile.SendMessage( 0x22, "That name is considered invalid." );
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:7,代码来源:NameVerification.cs

示例7: Restart_OnCommand

		public static void Restart_OnCommand( CommandEventArgs e )
		{
			if ( m_Restarting )
			{	
				if ( e.Mobile != null )
					e.Mobile.SendMessage( "The server is already restarting." );
					
				return;
			}
			else
			{
				if ( e.Mobile != null )
					e.Mobile.SendMessage( "You have initiated server restart." );
				
				int minutes = (int)m_Delay.TotalMinutes;
				try 
				{ 
					minutes = int.Parse( e.Arguments[ 0 ] ); 					
					m_Delay = TimeSpan.FromMinutes( minutes );
				}
				catch {}
				
				if ( e.Mobile != null && ShowAdmin )
					World.Broadcast( 0x22, true, "A restart has been issued by {0}.", e.Mobile.Name );
				
				if ( e.Mobile != null )
					Console.WriteLine( "Server Restart command issued by {0}", e.Mobile.Name );
				
				count = 0; //set how many times we warned the players to none
				Enabled = true; //if auto restarts disabled bypass safeguard
				m_RestartTime = DateTime.Now; //restart now
			}
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:33,代码来源:AutoRestartNew.cs

示例8: HeaderActions_ActionPerformed

    void HeaderActions_ActionPerformed(object sender, CommandEventArgs e)
    {
        // Check the permissions
        if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.abtest", "Manage"))
        {
            ShowError(GetString("om.abtest.nomanagepermission"));
            return;
        }

        bool createAnother = ValidationHelper.GetBoolean(e.CommandArgument, false);

        // Create document
        int newNodeID = ucNewPage.Save(createAnother);
        if (newNodeID != 0)
        {
            // Refresh tree
            string script = null;
            if (createAnother)
            {
                int parentID = QueryHelper.GetInteger("nodeID", 0);
                if (parentID != 0)
                {
                    script = ScriptHelper.GetScript("RefreshTree(" + parentID + ", " + parentID + ");CreateAnother();");
                }
            }
            else
            {
                script = ScriptHelper.GetScript("RefreshTree(" + newNodeID + ", " + newNodeID + ");SelectNode(" + newNodeID + ");");
            }
            ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "Refresh", script);
        }
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:32,代码来源:NewPage.aspx.cs

示例9: memberListElem_GridOnAction

    protected void memberListElem_GridOnAction(object sender, CommandEventArgs args)
    {
        switch (args.CommandName.ToLower())
        {
            case "approve":
                lblInfo.Text = GetString("group.member.userhasbeenapproved");
                lblInfo.Visible = true;
                break;

            case "reject":
                lblInfo.Text = GetString("group.member.userhasbeenrejected");
                lblInfo.Visible = true;
                break;

            case "edit":
                int memberId = ValidationHelper.GetInteger(args.CommandArgument, 0);
                memberEditElem.MemberID = memberId;
                memberEditElem.GroupID = GroupID;
                plcList.Visible = false;
                plcEdit.Visible = true;
                memberEditElem.Visible = true;
                memberEditElem.ReloadData();

                GroupMemberInfo gmi = GroupMemberInfoProvider.GetGroupMemberInfo(memberId);
                if (gmi != null)
                {
                    UserInfo ui = UserInfoProvider.GetUserInfo(gmi.MemberUserID);
                    if (ui != null)
                    {
                        lblEditBack.Text = " <span class=\"TitleBreadCrumbSeparator\">&nbsp;</span> " + HTMLHelper.HTMLEncode(ui.FullName);
                    }
                }
                break;
        }
    }
开发者ID:v-jli,项目名称:jean0407large,代码行数:35,代码来源:Members.ascx.cs

示例10: btnChangeStatus_OnCommand

 protected void btnChangeStatus_OnCommand(object sender, CommandEventArgs e)
 {
     Database db=new Database();
     db.AddParameter("@id", e.CommandArgument.ToString());
     db.ExecuteNonQuery("update FileComment set Status=1-Status where [email protected]");
     LoadData();
 }
开发者ID:samercs,项目名称:ArchiveSystem,代码行数:7,代码来源:FileCommentList.aspx.cs

示例11: Execute

        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;
            PlayerMobile target = obj as PlayerMobile;

            if (target != null)
            {
                if (e.Length != 1)
                {
                    e.Mobile.SendAsciiMessage("Format:");
                    e.Mobile.SendAsciiMessage("Squelch int minutes");
                    return;
                }

                if (target.CurrentSquelchTimer != null)
                {
                    target.CurrentSquelchTimer.Stop();
                    target.CurrentSquelchTimer = null;
                }

                target.Squelched = true;
                int index = e.GetInt32(0);
                from.SendAsciiMessage("You squelched {0} for {1} minute{2}", target.Name, index, index == 1 ? "" : "s");
                target.SendAsciiMessage("You have been squelched for {0} minute{1}", index, index == 1 ? "" : "s");
                new SquelchDelayTimer(target, TimeSpan.FromMinutes(index)).Start();
            }
            else
                from.SendAsciiMessage("This only works on players!");
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:29,代码来源:Squelch.cs

示例12: btnDelete_OnCommand

    /// <summary>
    /// Handles delete button action - deletes user favorite.
    /// </summary>
    protected void btnDelete_OnCommand(object sender, CommandEventArgs e)
    {
        // Check permissions
        if (!IsAvailable(ForumContext.CurrentForum, ForumActionType.Attachment))
        {
            ShowError(GetString("ForumNewPost.PermissionDenied"));
            return;
        }

        if (e.CommandName == "delete")
        {
            int attachmentId = ValidationHelper.GetInteger(e.CommandArgument, 0);

            // Get forum attachment info
            ForumAttachmentInfo fai = ForumAttachmentInfoProvider.GetForumAttachmentInfo(attachmentId);
            if (fai != null)
            {
                // Delete attachment
                ForumAttachmentInfoProvider.DeleteForumAttachmentInfo(fai);
            }

            //Reload page
            URLHelper.Redirect(RequestContext.CurrentURL);
        }
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:28,代码来源:AttachmentList.ascx.cs

示例13: 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

示例14: HandleAdminCommand

		public void HandleAdminCommand(CommandEventArgs e)
		{
			if (e.Mobile != null && !e.Mobile.Deleted && e.Mobile is PlayerMobile)
			{
				SuperGump.Send(new EquipmentSetsAdminUI((PlayerMobile)e.Mobile));
			}
		}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:7,代码来源:SystemOpts.cs

示例15: Forum_OnCommand

		public static void Forum_OnCommand( CommandEventArgs e )
		{
			string url = "http://www.defianceuo.com/forums/";

			Mobile m = e.Mobile;
			m.LaunchBrowser( url );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:7,代码来源:ForumCommand.cs


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