本文整理汇总了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" );
}
示例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 );
}
示例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));
}
示例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);
}
示例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);
}
}
}
示例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." );
}
示例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
}
}
示例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);
}
}
示例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\"> </span> " + HTMLHelper.HTMLEncode(ui.FullName);
}
}
break;
}
}
示例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();
}
示例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!");
}
示例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>" );
}
}
示例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));
}
}
示例15: Forum_OnCommand
public static void Forum_OnCommand( CommandEventArgs e )
{
string url = "http://www.defianceuo.com/forums/";
Mobile m = e.Mobile;
m.LaunchBrowser( url );
}