Пример #1
0
        public PalettePosition Clone()
        {
            PalettePosition create = new PalettePosition();

            create.CopyFrom(this);
            return(create);
        }
Пример #2
0
        public void CopyFrom(PalettePosition other)
        {
            PalettePosition palettePosition = other;

            Dock      = palettePosition.Dock;
            DockIndex = palettePosition.DockIndex;
            DockLevel = palettePosition.DockLevel;
            Bounds    = palettePosition.Bounds;
            Open      = palettePosition.Open;
        }
Пример #3
0
 public override bool Equals(object obj)
 {
     if (obj is PalettePosition)
     {
         PalettePosition palettePosition = (PalettePosition)obj;
         if (Dock != palettePosition.Dock || DockLevel != palettePosition.DockLevel || DockIndex != palettePosition.DockIndex)
         {
             return(false);
         }
         // Open is deliberately not checked; there isn't really a default state for Open
         if (Dock == DockStyle.None && !Bounds.Equals(palettePosition.Bounds))
         {
             return(false);
         }
         // if Dock the contents of Bounds is pretty much undefined; therefore if it differs that does not count as different objects
         return(true);
     }
     return(false);
 }