public bool inSnapRange(Baceimg target,MouseEventArgs e) { if (mypos.X + e.X > target.getPos().X + target.getSize().Width && mypos.Y + e.Y < target.getPos().Y + target.getSize().Height && mypos.Y + e.Y > target.getPos().Y) { return true; } else { return false; } }
public void snapTo(Baceimg target) { mypos = new Point(target.getPos().X + target.getSize().Width, target.getPos().Y); snaping = true; }
/// <summary> /// instantate the object with the specified name /// </summary> /// <param name="name">the name fo the control you want.</param> private void instantateobject(string name) { Baceimg mybace = new Baceimg(10, 10); if (easypannels.Count == 0) { mybace = new Baceimg(10, 10); } else { mybace = new Baceimg(10, (easypannels.Count * easypannels[0].getSize().Height) + 10); } bool wassucsessfull = true; try { mybace.putInContainer(ref easydev); mybace.set_name(name); mybace.bgimage_set(getImageFromResourcess(name + ".png")); } catch (Exception) { wassucsessfull = false; System.Diagnostics.Debugger.Log(0, "1", "File '" + name + "' not found"); } finally { if (wassucsessfull) { mybace.giveRef(ref easypannels); mybace.setID(easypannels.Count); easypannels.Add(mybace); } } }