Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.09 KB | None | 0 0
  1.         private void AddElementsToGroup(
  2.             IDockGroup targetGroup,
  3.             bool alreadySplitted,
  4.             DockElementRef existingElement,
  5.             DockElementRef newElement,
  6.             DockArea dockArea)
  7.         {
  8.             if (alreadySplitted)
  9.             {
  10.                 RecalculateRatiosInGroup(targetGroup, 1 - newElement.Ratio);
  11.                 switch (dockArea)
  12.                 {
  13.                     case DockArea.Left:
  14.                     case DockArea.Top:
  15.                         targetGroup.ElementRefs.Insert(0, newElement);
  16.                         break;
  17.                     case DockArea.Right:
  18.                     case DockArea.Bottom:
  19.                         targetGroup.ElementRefs.Add(newElement);
  20.                         break;
  21.                     default:
  22.                         throw new NotImplementedException("Not yet supported.");
  23.                 }
  24.             }
  25.             else
  26.             {
  27.                 switch (dockArea)
  28.                 {
  29.                     case DockArea.Left:
  30.                     case DockArea.Top:
  31.                         targetGroup.ElementRefs.Add(newElement);
  32.                         targetGroup.ElementRefs.Add(existingElement);
  33.                         break;
  34.                     case DockArea.Right:
  35.                     case DockArea.Bottom:
  36.                         targetGroup.ElementRefs.Add(existingElement);
  37.                         targetGroup.ElementRefs.Add(newElement);
  38.                         break;
  39.                     default:
  40.                         throw new NotImplementedException("Not yet supported.");
  41.                 }
  42.             }
  43.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement