public override void OnAfterLoad() { ctl.Click += new EventHandler( delegate(object sender, EventArgs e) { clickEvent.Raise(); } ); }
public override void OnAfterLoad() { ctl.Click += new EventHandler( delegate(object sender, EventArgs e) { clickEvent.Raise(); } ); if (HasConnector("image")) { ctl.Image = Image.FromStream(this["image"].GetValue <Stream>()); } base.OnAfterLoad(); }
public bool SetBlock(Player player, short x, short y, short z, byte type) { if (this[x, y, z] == type) { return(false); } BlockArgs e = new BlockArgs(player, x, y, z, type); BlockEvent.Raise(server, this, e); if (e.Abort) { return(false); } this[x, y, z] = type; Protocol.BlockPacket(x, y, z, type).Send(this); return(true); }
internal void PlayerSetBlock(Player player, short x, short y, short z, byte type) { byte before = this[x, y, z]; BlockArgs e = new BlockArgs(player, x, y, z, type); BlockEvent.Raise(server, this, e); if (before == this[x, y, z]) { if (e.Abort) { Protocol.BlockPacket(x, y, z, before).Send(player); } else { this[x, y, z] = type; Protocol.BlockPacket(x, y, z, type).Send(this, player); } } }
protected virtual void OnBlock(BlockArgs args) { BlockEvent.Raise(level.server, this, args); }
private void OnBlock(short x, short y, short z, byte action, byte type) { if (status != OnlineStatus.Ready) { return; } if (!Group.CanBuild) { SendBlock(x, y, z); return; } if (action >= 2) { new Message("&eUnknown block action.").Send(this); SendBlock(x, y, z); return; } Blocktype blocktype = Blocktype.FindById(type); if (blocktype == null) { new Message("&eUnknown blocktype.").Send(this); SendBlock(x, y, z); return; } if (!blocktype.Placeable) { new Message("&eUnplaceable blocktype.").Send(this); SendBlock(x, y, z); return; } if (y == level.Depth) { return; } if (x >= level.Width || y >= level.Depth || z >= level.Height) { new Message("&eInvalid block position.").Send(this); return; } byte block = bind[type]; if (action == 0) { block = 0x00; } byte before = level[x, y, z]; if (before == block) { if (bind[type] != type) { SendBlock(x, y, z); } return; } if (before == Blocktype.adminium.ID && !destroyAdminium) { Protocol.BlockPacket(x, y, z, 7).Send(this); return; } BlockArgs args = new BlockArgs(this, x, y, z, block); BlockEvent.Raise(server, this, args, type); if (!args.Abort) { InternalBlockEvent(this, args, (bind[type] != type)); } else if (level[x, y, z] == before) { SendBlock(x, y, z); } }