Example #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         ContentWindows.Dispose();
         if (DockManager != null)
         {
             DockManager.RemoveFloatWindow(this);
         }
         m_dockManager = null;
     }
     base.Dispose(disposing);
 }
Example #2
0
        public void SetContentWindowIndex(ContentWindow cw, int index)
        {
            int oldIndex = ContentWindows.IndexOf(cw);

            if (oldIndex == -1)
            {
                throw(new ArgumentException(ResourceHelper.GetString("FloatWindow.SetContentWindowIndex.InvalidContentWindow")));
            }

            if (index < 0 || index > ContentWindows.Count - 1)
            {
                if (index != -1)
                {
                    throw(new ArgumentOutOfRangeException(ResourceHelper.GetString("FloatWindow.SetContentWindowIndex.InvalidIndex")));
                }
            }

            if (oldIndex == index)
            {
                return;
            }
            if (oldIndex == ContentWindows.Count - 1 && index == -1)
            {
                return;
            }

            ContentWindows.Remove(cw);
            if (index == -1)
            {
                ContentWindows.Add(cw);
            }
            else if (oldIndex < index)
            {
                ContentWindows.AddAt(cw, index - 1);
            }
            else
            {
                ContentWindows.AddAt(cw, index);
            }

            RefreshContentWindows();
        }