// Autodesk.AutoCAD.Ribbon.RibbonPaletteSet
using System;
using System.Windows;
using System.Windows.Controls;
using Autodesk.AutoCAD.Windows;
using Autodesk.Internal.Windows;
public void ResizeControl()
{
if (RibbonControl.RibbonOrientation == Orientation.Horizontal)
{
Size deviceIndependentSize = DeviceIndependentSize;
deviceIndependentSize.Height = RibbonControl.ActualHeight + ((DocumentSwitchControl != null && DocumentSwitchControl.Visibility == Visibility.Visible) ? DocumentSwitchControl.Height : 0.0);
DeviceIndependentSize = deviceIndependentSize;
}
else if (base.Dock != 0)
{
if ((base.Style & PaletteSetStyles.SingleColDock) == 0)
{
if (RibbonControl.AutoHideMode == RibbonAutoHideMode.None)
{
RibbonControl.Width = DeviceIndependentSize.Width;
}
else
{
RibbonControl.Width = double.NaN;
}
return;
}
if (RibbonControl.AutoHideMode != 0)
{
RibbonControl.Width = double.NaN;
}
Size deviceIndependentSize2 = DeviceIndependentSize;
if (RibbonControl.AutoHideMode != 0)
{
deviceIndependentSize2.Width = RibbonControl.ActualWidth;
if (mDockedOriginalSize.Width == 0.0)
{
mDockedOriginalSize = DeviceIndependentSize;
}
}
else
{
if (mDockedOriginalSize.Width != 0.0)
{
deviceIndependentSize2.Width = mDockedOriginalSize.Width;
}
mDockedOriginalSize.Width = 0.0;
}
DeviceIndependentSize = deviceIndependentSize2;
}
else
{
Size deviceIndependentSize3 = DeviceIndependentSize;
deviceIndependentSize3.Width = Math.Max(deviceIndependentSize3.Width - base.PaletteSize.Width, 0.0);
deviceIndependentSize3.Height = Math.Max(deviceIndependentSize3.Height - base.PaletteSize.Height, 0.0);
if (RibbonControl.AutoHideMode != 0)
{
RibbonControl.Width = double.NaN;
RibbonControl.InvalidateVisual();
}
Size deviceIndependentSize4 = DeviceIndependentSize;
if (RibbonControl.AutoHideMode != 0)
{
deviceIndependentSize4.Width = RibbonControl.ActualWidth + deviceIndependentSize3.Width;
if (mOriginalSize.Width == 0.0)
{
mOriginalSize = DeviceIndependentSize;
}
}
else
{
if (mOriginalSize.Width != 0.0)
{
deviceIndependentSize4.Width = mOriginalSize.Width;
}
mOriginalSize.Width = 0.0;
}
DeviceIndependentSize = deviceIndependentSize4;
}
if (base.Dock != 0)
{
base.Dock = base.DockEnabled;
}
RecalculateDockSiteLayout();
}