本文整理汇总了C#中IDockContent类的典型用法代码示例。如果您正苦于以下问题:C# IDockContent类的具体用法?C# IDockContent怎么用?C# IDockContent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDockContent类属于命名空间,在下文中一共展示了IDockContent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginDragContent
public void BeginDragContent(IDockContent content)
{
if (!InitDrag(content as Control, DragSource.Content))
return;
Content_BeginDrag(content);
}
示例2: FloatingWindow
/// <summary>
/// Constructor used when window is created as consequence to user interaction.
/// </summary>
/// <param name="root">Parent dock panel</param>
/// <param name="content">Content to host</param>
/// <param name="origin">Origin, position on screen</param>
/// <param name="size">Size of window</param>
public FloatingWindow(DockPanel root, IDockContent content, Point origin, Size size)
: this(root)
{
Left = origin.X;
Top = origin.Y;
Width = size.Width;
Height = size.Height;
if (content is TabLayout)
{
DockedContent = (TabLayout)content;
}
else
{
DockedContent = new TabLayout(Root);
DockedContent.Dock(null, content, DockTo.Center);
}
foreach (DockContent subContent in DockedContent.Children)
{
subContent.Settings.DockState = DockState.Floating;
}
Content = DockedContent;
Binding b = new Binding("Header");
b.Source = DockedContent;
SetBinding(Window.TitleProperty, b);
}
示例3: DockPane
protected internal DockPane(IDockContent content, FloatWindow floatWindow, bool show)
{
if (floatWindow == null)
throw new ArgumentNullException("floatWindow");
InternalConstruct(content, DockState.Float, false, Rectangle.Empty, floatWindow.NestedPanes.GetDefaultPreviousPane(this), DockAlignment.Right, 0.5, show);
}
示例4: DockPane
protected internal DockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, double proportion,
bool show)
{
if (previousPane == null)
throw (new ArgumentNullException("previousPane"));
InternalConstruct(content, previousPane.DockState, false, Rectangle.Empty, previousPane, alignment, proportion, show);
}
示例5: Add
internal int Add(IDockContent content)
{
#if DEBUG
if (DockPane != null)
throw new InvalidOperationException();
#endif
if (Contains(content))
return IndexOf(content);
return InnerList.Add(content);
}
示例6: ControlInfo
public ControlInfo(string name, string description, string id, Sce.Atf.Applications.StandardControlGroup group, object imageKey, IDockContent dockContent, IControlHostClient client)
{
Requires.NotNullOrEmpty(id, "id");
Requires.NotNull(dockContent, "dockContent");
Requires.NotNull(client, "client");
DockContent = dockContent;
dockContent.PropertyChanged += DockContent_PropertyChanged;
Name = name;
Description = description;
Id = id;
Group = group;
ImageSourceKey = imageKey;
Client = client;
}
示例7: AddAt
internal void AddAt(IDockContent content, IDockContent before)
{
#if DEBUG
if (DockPane != null)
throw new InvalidOperationException();
#endif
if (!Contains(before))
return;
if (Contains(content))
return;
AddAt(content, IndexOf(before));
}
示例8: InternalConstruct
private void InternalConstruct(IDockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
{
if (dockState == DockState.Hidden || dockState == DockState.Unknown)
throw new ArgumentException(Strings.DockPane_SetDockState_InvalidState);
if (content == null)
throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent);
if (content.DockHandler.DockPanel == null)
throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel);
SuspendLayout();
SetStyle(ControlStyles.Selectable, false);
m_isFloat = (dockState == DockState.Float);
m_contents = new DockContentCollection();
m_displayingContents = new DockContentCollection(this);
m_dockPanel = content.DockHandler.DockPanel;
m_dockPanel.AddPane(this);
m_splitter = new SplitterControl(this);
m_nestedDockingStatus = new NestedDockingStatus(this);
m_captionControl = DockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(this);
m_tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this);
Controls.AddRange(new Control[] { m_captionControl, m_tabStripControl });
DockPanel.SuspendLayout(true);
if (flagBounds)
FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds);
else if (prevPane != null)
DockTo(prevPane.NestedPanesContainer, prevPane, alignment, proportion);
SetDockState(dockState);
if (show)
content.DockHandler.Pane = this;
else if (this.IsFloat)
content.DockHandler.FloatPane = this;
else
content.DockHandler.PanelPane = this;
ResumeLayout();
DockPanel.ResumeLayout(true, true);
}
示例9: RemoveContent
internal void RemoveContent(IDockContent content)
{
if (content == null)
throw(new ArgumentNullException());
if (Contents.Contains(content))
{
Contents.Remove(content);
OnContentRemoved(new DockContentEventArgs(content));
}
}
示例10: DocumentsToArray
public IDockContent[] DocumentsToArray()
{
int count = DocumentsCount;
IDockContent[] documents = new IDockContent[count];
int i = 0;
foreach (IDockContent content in Documents)
{
documents[i] = content;
i++;
}
return documents;
}
示例11: CreateTab
protected override AutoHideStripBase.Tab CreateTab(IDockContent content)
{
return new TabVS2003(content);
}
示例12: CreateDockPane
public DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment,
double proportion, bool show)
{
return new DockPane(content, prevPane, alignment, proportion, show);
}
示例13: return
/// <summary>
/// Return the content's parent as an IDockLayout</summary>
/// <param name="content">The docked content whose parent is requested</param>
/// <returns>The parent as IDockLayout</returns>
IDockLayout IDockLayout.FindParentLayout(IDockContent content)
{
return (content is DockContent && Children.Contains((DockContent)content)) ? this : null;
}
示例14: Dock
/// <summary>
/// Dock the new content next to content</summary>
/// <param name="nextTo">Dock content to add new content next to</param>
/// <param name="newContent">New content to be docked</param>
/// <param name="dockTo">Side of nextTo content where new content should be docked</param>
public void Dock(IDockContent nextTo, IDockContent newContent, DockTo dockTo)
{
TabLayout tabLayout = newContent as TabLayout;
if (tabLayout != null)
{
IEnumerator<DockContent> contentEnumerator = tabLayout.Children.GetEnumerator();
while (contentEnumerator.MoveNext())
{
DockContent content = contentEnumerator.Current;
tabLayout.RemoveItem(content);
AddOneItem((DockContent)nextTo, content);
contentEnumerator = tabLayout.Children.GetEnumerator();
}
}
else
{
AddOneItem((DockContent)nextTo, newContent as DockContent);
}
Focus();
UpdateLayout();
}
示例15: Undock
/// <summary>
/// Undock given content</summary>
/// <param name="content">Content to undock</param>
public void Undock(IDockContent content)
{
foreach (IDockContent contentItem in Children)
{
if (content == contentItem)
{
RemoveItem(content as DockContent);
if (Parent is IDockLayout && Children.Count == 0)
{
((IDockLayout)Parent).Undock((IDockLayout)this);
}
break;
}
}
}