本文整理汇总了C#中Rank.Can方法的典型用法代码示例。如果您正苦于以下问题:C# Rank.Can方法的具体用法?C# Rank.Can怎么用?C# Rank.Can使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rank
的用法示例。
在下文中一共展示了Rank.Can方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectRank
public void SelectRank( Rank rank ) {
Rank = rank;
if( rank == null ) {
comboBox.SelectedIndex = -1;
Visible = false;
} else {
comboBox.SelectedIndex = rank.GetLimitIndex( Permission );
Visible = rank.Can( Permission );
}
}
示例2: SelectRank
void SelectRank( Rank rank ) {
if( rank == null ) {
if( vRanks.SelectedIndex != -1 ) {
vRanks.ClearSelected();
return;
}
DisableRankOptions();
return;
}
if( vRanks.SelectedIndex != rank.Index ) {
vRanks.SelectedIndex = rank.Index;
return;
}
selectedRank = rank;
tRankName.Text = rank.Name;
ApplyColor( bColorRank, ParseToIndex( rank.Color ) );
tPrefix.Text = rank.Prefix;
foreach( var box in permissionLimitBoxes.Values ) {
box.SelectRank( rank );
}
xReserveSlot.Checked = rank.ReservedSlot;
xKickIdle.Checked = rank.IdleKickTimer > 0;
nKickIdle.Value = rank.IdleKickTimer;
nKickIdle.Enabled = xKickIdle.Checked;
xAntiGrief.Checked = (rank.AntiGriefBlocks > 0 && rank.AntiGriefSeconds > 0);
nAntiGriefBlocks.Value = rank.AntiGriefBlocks;
nAntiGriefBlocks.Enabled = xAntiGrief.Checked;
nAntiGriefSeconds.Value = rank.AntiGriefSeconds;
nAntiGriefSeconds.Enabled = xAntiGrief.Checked;
xDrawLimit.Checked = (rank.DrawLimit > 0);
nDrawLimit.Value = rank.DrawLimit;
nCopyPasteSlots.Value = rank.CopySlots;
nFillLimit.Value = rank.FillLimit;
xAllowSecurityCircumvention.Checked = rank.AllowSecurityCircumvention;
foreach( ListViewItem item in vPermissions.Items ) {
item.Checked = rank.Permissions[item.Index];
if( item.Checked ) {
item.Font = bold;
} else {
item.Font = vPermissions.Font;
}
}
foreach( ListViewItem item in vPermissions.Items ) {
CheckPermissionConsistency( (Permission)item.Tag, item.Checked );
}
xDrawLimit.Enabled = rank.Can( Permission.Draw ) || rank.Can( Permission.CopyAndPaste );
nDrawLimit.Enabled = xDrawLimit.Checked;
xAllowSecurityCircumvention.Enabled = rank.Can( Permission.ManageWorlds ) || rank.Can( Permission.ManageZones );
gRankOptions.Enabled = true;
lPermissions.Enabled = true;
vPermissions.Enabled = true;
bDeleteRank.Enabled = true;
bRaiseRank.Enabled = (selectedRank != RankManager.HighestRank);
bLowerRank.Enabled = (selectedRank != RankManager.LowestRank);
}
示例3: SelectRank
void SelectRank( Rank rank ) {
if( rank == null ) {
if( vRanks.SelectedIndex != -1 ) {
vRanks.ClearSelected();
return;
}
DisableRankOptions();
return;
}
if( vRanks.SelectedIndex != rank.Index ) {
vRanks.SelectedIndex = rank.Index;
return;
}
selectedRank = rank;
tRankName.Text = rank.Name;
ApplyColor( bColorRank, fCraft.Color.ParseToIndex( rank.Color ) );
tPrefix.Text = rank.Prefix;
cKickLimit.SelectedIndex = rank.GetLimitIndex( Permission.Kick );
cBanLimit.SelectedIndex = rank.GetLimitIndex( Permission.Ban );
cPromoteLimit.SelectedIndex = rank.GetLimitIndex( Permission.Promote );
cDemoteLimit.SelectedIndex = rank.GetLimitIndex( Permission.Demote );
cMaxHideFrom.SelectedIndex = rank.GetLimitIndex( Permission.Hide );
cFreezeLimit.SelectedIndex = rank.GetLimitIndex( Permission.Freeze );
cMuteLimit.SelectedIndex = rank.GetLimitIndex( Permission.Mute );
cBringLimit.SelectedIndex = rank.GetLimitIndex( Permission.Bring );
xReserveSlot.Checked = rank.ReservedSlot;
xKickIdle.Checked = rank.IdleKickTimer > 0;
nKickIdle.Value = rank.IdleKickTimer;
nKickIdle.Enabled = xKickIdle.Checked;
xAntiGrief.Checked = ( rank.AntiGriefBlocks > 0 && rank.AntiGriefSeconds > 0 );
nAntiGriefBlocks.Value = rank.AntiGriefBlocks;
nAntiGriefBlocks.Enabled = xAntiGrief.Checked;
nAntiGriefSeconds.Value = rank.AntiGriefSeconds;
nAntiGriefSeconds.Enabled = xAntiGrief.Checked;
xDrawLimit.Checked = ( rank.DrawLimit > 0 );
nDrawLimit.Value = rank.DrawLimit;
xAllowSecurityCircumvention.Checked = rank.AllowSecurityCircumvention;
foreach( ListViewItem item in vPermissions.Items ) {
item.Checked = rank.Permissions[item.Index];
if( item.Checked ) {
item.Font = bold;
} else {
item.Font = vPermissions.Font;
}
}
cKickLimit.Enabled = rank.Can( Permission.Kick );
cBanLimit.Enabled = rank.Can( Permission.Ban );
cPromoteLimit.Enabled = rank.Can( Permission.Promote );
cDemoteLimit.Enabled = rank.Can( Permission.Demote );
cMaxHideFrom.Enabled = rank.Can( Permission.Hide );
cFreezeLimit.Enabled = rank.Can( Permission.Freeze );
cMuteLimit.Enabled = rank.Can( Permission.Mute );
cBringLimit.Enabled = rank.Can( Permission.Bring );
xDrawLimit.Enabled = rank.Can( Permission.Draw ) || rank.Can( Permission.CopyAndPaste );
nDrawLimit.Enabled = xDrawLimit.Checked;
xAllowSecurityCircumvention.Enabled = rank.Can( Permission.ManageWorlds ) || rank.Can( Permission.ManageZones );
gRankOptions.Enabled = true;
lPermissions.Enabled = true;
vPermissions.Enabled = true;
bDeleteRank.Enabled = true;
bRaiseRank.Enabled = ( selectedRank != RankManager.HighestRank );
bLowerRank.Enabled = ( selectedRank != RankManager.LowestRank );
}