• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CommandEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetSkill_OnCommand

		public static void GetSkill_OnCommand( CommandEventArgs arg )
		{
			if( arg.Length != 1 )
			{
				arg.Mobile.SendMessage( "GetSkill <skill name>" );
			}
			else
			{
				SkillName skill;
#if Framework_4_0
				if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
				{
					arg.Mobile.Target = new SkillTarget( skill );
				}
				else
				{
					arg.Mobile.SendMessage( "You have specified an invalid skill to get." );
				}
#else
				try
				{
					skill = (SkillName)Enum.Parse( typeof( SkillName ), arg.GetString( 0 ), true );
				}
				catch
				{
					arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
					return;
				}

				arg.Mobile.Target = new SkillTarget( skill );
#endif
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:33,代码来源:Skills.cs


示例17: HeaderActions_ActionPerformed

 private void HeaderActions_ActionPerformed(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "save")
     {
         queryEdit.Save(false);
     }
 }
开发者ID:KuduApps,项目名称:Kentico,代码行数:7,代码来源:CustomTable_Edit_Query_Edit.aspx.cs


示例18: HeaderActions_ActionPerformed

    /// <summary>
    /// Actions handler - saves the changes.
    /// </summary>
    protected void HeaderActions_ActionPerformed(object sender, CommandEventArgs e)
    {
        // Update the form object and its class
        BizFormInfo form = EditedObject as BizFormInfo;
        if ((form != null) && (mapControl != null))
        {
            if (plcMapping.Visible)
            {
                // Update mapping of the form class only if mapping dialog is visible
                DataClassInfo classInfo = DataClassInfoProvider.GetDataClassInfo(form.FormClassID);
                if (classInfo != null)
                {
                    classInfo.ClassContactOverwriteEnabled = ValidationHelper.GetBoolean(mapControl.GetValue("allowoverwrite"), false);
                    classInfo.ClassContactMapping = ValidationHelper.GetString(mapControl.GetValue("mappingdefinition"), string.Empty);
                    DataClassInfoProvider.SetDataClassInfo(classInfo);
                }
            }

            // Update the form
            form.FormLogActivity = chkLogActivity.Checked;
            BizFormInfoProvider.SetBizFormInfo(form);

            // Show save information
            ShowChangesSaved();
        }
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:29,代码来源:BizForm_Edit_OnlineMarketing.aspx.cs


示例19: button1_command

 protected void button1_command(object sender, CommandEventArgs e)
 {
     // string albumid = Session["albumid"].ToString();
         Session["status"] = "No change";
         Session["albumid"] = e.CommandName;
         Response.Redirect("upload.aspx?albumid=" + e.CommandName + "");
 }
开发者ID:roopamjain01,项目名称:get2gether-Social-networking-website,代码行数:7,代码来源:album.aspx.cs


示例20: HelpInfo_OnCommand

		private static void HelpInfo_OnCommand( CommandEventArgs e )
		{
			if( e.Length > 0 )
			{
				string arg = e.GetString( 0 ).ToLower();
				CommandInfo c;

				if( m_HelpInfos.TryGetValue( arg, out c ) )
				{
					Mobile m = e.Mobile;

					if( m.AccessLevel >= c.AccessLevel )
						m.SendGump( new CommandInfoGump( c ) );
					else
						m.SendMessage( "You don't have access to that command." );

					return;
				}
				else
					e.Mobile.SendMessage( String.Format( "Command '{0}' not found!", arg ) );
			}

			e.Mobile.SendGump( new CommandListGump( 0, e.Mobile, null ) );

		}
开发者ID:nathanvy,项目名称:runuo,代码行数:25,代码来源:HelpInfo.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CommandEventHandler类代码示例发布时间:2022-05-24
下一篇:
C# CommandDelegate类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap