本文整理汇总了C#中Server.Item.OnDoubleClick方法的典型用法代码示例。如果您正苦于以下问题:C# Item.OnDoubleClick方法的具体用法?C# Item.OnDoubleClick怎么用?C# Item.OnDoubleClick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Item
的用法示例。
在下文中一共展示了Item.OnDoubleClick方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
public virtual void Use( Item item )
{
if ( item == null || item.Deleted )
return;
DisruptiveAction();
if ( m_Spell != null && !m_Spell.OnCasterUsingObject( item ) )
return;
object root = item.RootParent;
bool okay = false;
if ( !Utility.InUpdateRange( this, item.GetWorldLocation() ) )
item.OnDoubleClickOutOfRange( this );
else if ( !CanSee( item ) )
item.OnDoubleClickCantSee( this );
else if ( !item.IsAccessibleTo( this ) )
{
Region reg = Region.Find( item.GetWorldLocation(), item.Map );
if ( reg == null || !reg.SendInaccessibleMessage( item, this ) )
item.OnDoubleClickNotAccessible( this );
}
else if ( !CheckAlive( false ) )
item.OnDoubleClickDead( this );
else if ( item.InSecureTrade )
item.OnDoubleClickSecureTrade( this );
else if ( !AllowItemUse( item ) )
okay = false;
else if ( !item.CheckItemUse( this, item ) )
okay = false;
else if ( root != null && root is Mobile && ((Mobile)root).IsSnoop( this ) )
item.OnSnoop( this );
else if ( m_Region.OnDoubleClick( this, item ) )
okay = true;
if ( okay )
{
if ( !item.Deleted )
item.OnItemUsed( this, item );
if ( !item.Deleted )
item.OnDoubleClick( this );
}
}
示例2: Open
public void Open( Mobile from, Item item )
{
if(item is BaseBook)
{
from.CloseGump(typeof(BookGump));
from.SendGump(new BookGump(from, (BaseBook)item));
}
else // item is Runebook
item.OnDoubleClick(from);
}