예제 #1
0
 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;
     }
 }
예제 #2
0
 public void snapTo(Baceimg target)
 {
     mypos = new Point(target.getPos().X + target.getSize().Width, target.getPos().Y);
     snaping = true;
 }
예제 #3
0
        /// <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);
                }
            }
        }