本文整理汇总了C#中AvalonDock.ResizingPanel类的典型用法代码示例。如果您正苦于以下问题:C# ResizingPanel类的具体用法?C# ResizingPanel怎么用?C# ResizingPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResizingPanel类属于AvalonDock命名空间,在下文中一共展示了ResizingPanel类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Anchor
/// <summary>
/// Anchor a dockable pane to a border
/// </summary>
/// <param name="paneToAnchor"></param>
/// <param name="anchor"></param>
public void Anchor(DockablePane paneToAnchor, AnchorStyle anchor)
{
//ensure that content property is not empty
EnsureContentNotEmpty();
if (Content == null)
return;
//remove the pane from its original children collection
FrameworkElement parentElement = paneToAnchor.Parent as FrameworkElement;
if (anchor == AnchorStyle.None)
anchor = AnchorStyle.Right;
//Change anchor border according to FlowDirection
if (FlowDirection == FlowDirection.RightToLeft)
{
if (anchor == AnchorStyle.Right)
anchor = AnchorStyle.Left;
else if (anchor == AnchorStyle.Left)
anchor = AnchorStyle.Right;
}
//parentElement should be a DockingManager or a ResizingPanel
if (parentElement is ContentControl)
{
((ContentControl)parentElement).Content = null;
}
//and insert in the top level panel if exist
ResizingPanel toplevelPanel = Content as ResizingPanel;
if (toplevelPanel != null && toplevelPanel.Children.Count == 0)
{
Content = null;
toplevelPanel = null;
}
Orientation requestedOrientation =
(anchor == AnchorStyle.Bottom || anchor == AnchorStyle.Top) ? Orientation.Vertical : Orientation.Horizontal;
//if toplevel panel contains only one child then just override the orientation
//as requested
if (toplevelPanel != null && toplevelPanel.Children.Count == 1)
toplevelPanel.Orientation = requestedOrientation;
if (toplevelPanel == null ||
toplevelPanel.Orientation != requestedOrientation)
{
//if toplevel panel doesn't exist or it has not the correct orientation
//we have to create a new one and set it as content of docking manager
toplevelPanel = new ResizingPanel();
toplevelPanel.Orientation = requestedOrientation;
FrameworkElement contentElement = Content as FrameworkElement;
_allowRefreshContents = false;
Content = null;
if (anchor == AnchorStyle.Left ||
anchor == AnchorStyle.Top)
{
toplevelPanel.Children.Add(paneToAnchor);
toplevelPanel.InsertChildRelativeTo(contentElement, paneToAnchor, true);
}
else
{
toplevelPanel.Children.Add(paneToAnchor);
toplevelPanel.InsertChildRelativeTo(contentElement, paneToAnchor, false);
}
_allowRefreshContents = true;
Content = toplevelPanel;
}
else
{
//here we have a docking manager content with the right orientation
//so we have only to insert new child at correct position
if (anchor == AnchorStyle.Left ||
anchor == AnchorStyle.Top)
{
//add new child before first one (prepend)
toplevelPanel.InsertChildRelativeTo(paneToAnchor, toplevelPanel.Children[0] as FrameworkElement, false);
}
else
{
//add new child after last one (append)
toplevelPanel.InsertChildRelativeTo(paneToAnchor, toplevelPanel.Children[toplevelPanel.Children.Count - 1] as FrameworkElement, true);
}
}
//Refresh anchor style
DockablePane paneToAnchorAsDockablePane = paneToAnchor as DockablePane;
//.........这里部分代码省略.........
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:101,代码来源:DockingManager.cs
示例2: SaveLayout
//void SaveLayout(XmlWriter xmlWriter, DocumentPaneResizingPanel panelToSerialize)
//{
// xmlWriter.WriteStartElement("DocumentPanePlaceHolder");
// //List<DockableContent> listOfFoundContents = new List<DockableContent>();
// //FindContents<DockableContent>(listOfFoundContents, panelToSerialize);
// var listOfFoundContents = new LogicalTreeAdapter(panelToSerialize).Descendants().Where(i => i.Item is DockableContent).Select(i => i.Item);
// foreach (DockableContent content in listOfFoundContents)
// {
// SaveLayout(xmlWriter, content);
// }
// xmlWriter.WriteEndElement();
//}
void SaveLayout(XmlWriter xmlWriter, ResizingPanel panelToSerialize)
{
if (panelToSerialize is DocumentPaneResizingPanel)
xmlWriter.WriteStartElement("DocumentPaneResizingPanel");
else
xmlWriter.WriteStartElement("ResizingPanel");
//if (!double.IsInfinity(ResizingPanel.GetResizeWidth(panelToSerialize)))
// xmlWriter.WriteAttributeString("ResizeWidth", XmlConvert.ToString(ResizingPanel.GetResizeWidth(panelToSerialize)));
//if (!double.IsInfinity(ResizingPanel.GetResizeHeight(panelToSerialize)))
// xmlWriter.WriteAttributeString("ResizeHeight", XmlConvert.ToString(ResizingPanel.GetResizeHeight(panelToSerialize)));
xmlWriter.WriteAttributeString("ResizeWidth", ResizingPanel.GetResizeWidth(panelToSerialize).ToString());
xmlWriter.WriteAttributeString("ResizeHeight", ResizingPanel.GetResizeHeight(panelToSerialize).ToString());
xmlWriter.WriteAttributeString("EffectiveSize", new SizeConverter().ConvertToInvariantString(ResizingPanel.GetEffectiveSize(panelToSerialize)));
xmlWriter.WriteAttributeString("Orientation", Convert.ToString(panelToSerialize.Orientation));
foreach (UIElement child in panelToSerialize.Children)
{
if (child is DockablePane)
SaveLayout(xmlWriter, child as DockablePane);
else if (child is DocumentPane)
SaveLayout(xmlWriter, child as DocumentPane);
//else if (child is DocumentPaneResizingPanel)
// SaveLayout(xmlWriter, child as DocumentPaneResizingPanel);
else if (child is ResizingPanel)
SaveLayout(xmlWriter, child as ResizingPanel);
}
xmlWriter.WriteEndElement();
}
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:44,代码来源:DockingManager.cs
示例3: UpdateAnchorStyle
/// <summary>
/// Update the <see cref="DockablePane.Anchor"/> property relative to the <see cref="DocumentContent"/> object
/// </summary>
/// <param name="panel"></param>
/// <returns></returns>
/// <remarks>Traverse the logical tree starting from root <see cref="ResizingPanel"/> and set property <see cref="DockablePane.Anchor"/> of dockable pane found.</remarks>
void UpdateAnchorStyle(ResizingPanel panel)
{
AnchorStyle currentAnchor = panel.Orientation == Orientation.Horizontal ? AnchorStyle.Left : AnchorStyle.Top;
bool foundDocumentContent = false;
foreach (FrameworkElement child in panel.Children)
{
if (child is ResizingPanel)
{
if (!foundDocumentContent &&
GetMainDocumentPane(child as ResizingPanel) != null)
{
foundDocumentContent = true;
currentAnchor = panel.Orientation == Orientation.Horizontal ? AnchorStyle.Right : AnchorStyle.Bottom;
UpdateAnchorStyle(child as ResizingPanel);
}
else
ForceAnchorStyle(child as ResizingPanel, currentAnchor);
}
else if (child is DocumentPane)
{
foundDocumentContent = true;
currentAnchor = panel.Orientation == Orientation.Horizontal ? AnchorStyle.Right : AnchorStyle.Bottom;
}
else if (child is DockablePane)
{
(child as DockablePane).Anchor = currentAnchor;
}
}
}
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:36,代码来源:DockingManager.cs
示例4: ForceAnchorStyle
/// <summary>
/// Called by <see cref="UpdateAnchorStyle"/> whene a <see cref="DocumentContent"/> object has been found
/// </summary>
/// <param name="panel"></param>
/// <param name="forcedAnchor"></param>
void ForceAnchorStyle(ResizingPanel panel, AnchorStyle forcedAnchor)
{
foreach (FrameworkElement child in panel.Children)
{
if (child is ResizingPanel)
{
ForceAnchorStyle((child as ResizingPanel), forcedAnchor);
}
else if ((child is DockablePane))
{
((DockablePane)child).Anchor = forcedAnchor;
}
}
}
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:19,代码来源:DockingManager.cs
示例5: RestoreResizingPanel
ResizingPanel RestoreResizingPanel(XmlElement mainElement, DockableContent[] actualContents, DocumentContent[] actualDocuments, ref DocumentPane mainDocumentPane)
{
ResizingPanel panel = null;
if (mainElement.Name == "DocumentPaneResizingPanel")
panel = new DocumentPaneResizingPanel();
else
panel = new ResizingPanel();
if (mainElement.HasAttribute("Orientation"))
panel.Orientation = (Orientation)Enum.Parse(typeof(Orientation), mainElement.GetAttribute("Orientation"));
if (mainElement.HasAttribute("ResizeWidth"))
ResizingPanel.SetResizeWidth(panel, (GridLength)GLConverter.ConvertFromInvariantString(mainElement.GetAttribute("ResizeWidth")));
if (mainElement.HasAttribute("ResizeHeight"))
ResizingPanel.SetResizeHeight(panel, (GridLength)GLConverter.ConvertFromInvariantString(mainElement.GetAttribute("ResizeHeight")));
if (mainElement.HasAttribute("EffectiveSize"))
ResizingPanel.SetEffectiveSize(panel, (Size)(new SizeConverter()).ConvertFromInvariantString(mainElement.GetAttribute("EffectiveSize")));
foreach (XmlElement childElement in mainElement.ChildNodes)
{
if (childElement.Name == "ResizingPanel" ||
childElement.Name == "DocumentPaneResizingPanel")
{
var childPanel = RestoreResizingPanel(childElement, actualContents, actualDocuments, ref mainDocumentPane);
if (childPanel.Children.Count > 0)
{
panel.Children.Add(childPanel);
}
else
{
Debug.WriteLine("Found empty ResizingPanel in stored layout, it will be discarded.");
}
}
#region Restore DockablePane
else if (childElement.Name == "DockablePane")
{
var pane = RestoreDockablePaneLayout(childElement, actualContents, actualDocuments);
//restore dockable panes even if no contents are inside (an hidden content could refer this pane in SaveStateAndPosition)
panel.Children.Add(pane);
}
#endregion
#region Restore Contents inside a DocumentPane
else if (childElement.Name == "DocumentPane")
{
var documentPane = RestoreDocumentPaneLayout(childElement, actualContents, actualDocuments);
bool isMainDocumentPane = false;
if (childElement.HasAttribute("IsMain"))
isMainDocumentPane = XmlConvert.ToBoolean(childElement.GetAttribute("IsMain"));
if (documentPane.Items.Count > 0 ||
isMainDocumentPane)
panel.Children.Add(documentPane);
if (isMainDocumentPane)
{
if (mainDocumentPane != null)
throw new InvalidOperationException("Main document pane is set more than one time");
mainDocumentPane = documentPane;
}
}
#endregion
}
return panel;
}
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:71,代码来源:DockingManager.cs
示例6: ClearEmptyPanels
internal void ClearEmptyPanels(ResizingPanel panelToClear)
{
if (panelToClear == null)
return;
foreach (var childPanel in panelToClear.Children.OfType<ResizingPanel>().ToArray())
{
if (childPanel.Children.Count == 0)
{
panelToClear.RemoveChild(childPanel);
}
else
{
ClearEmptyPanels(childPanel);
}
}
}
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:17,代码来源:DockingManager.cs
示例7: FindPaneInPanel
bool? FindPaneInPanel(ResizingPanel panel, Pane paneToFind)
{
foreach (UIElement child in panel.Children)
{
if (child == paneToFind)
return true;
else if (child is DockablePane)
return null;
else if (child is ResizingPanel)
{
bool? found = FindPaneInPanel(child as ResizingPanel, paneToFind);
if (found.HasValue && found.Value)
return true;
}
}
return false;
}
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:18,代码来源:DockingManager.cs
示例8: GetMainDocumentPane
/// <summary>
/// Returns the main document pane
/// </summary>
/// <param name="parentPanel"></param>
/// <returns></returns>
internal static DocumentPane GetMainDocumentPane(ResizingPanel parentPanel)
{
foreach (UIElement child in parentPanel.Children)
{
if (child is DocumentPane)
return child as DocumentPane;
if (child is ResizingPanel)
{
DocumentPane foundDocPane = GetMainDocumentPane(child as ResizingPanel);
if (foundDocPane != null)
return foundDocPane;
}
}
return null;
}
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:22,代码来源:DockingManager.cs
示例9: IsPanelContainingDocumentPane
internal static bool IsPanelContainingDocumentPane(ResizingPanel parentPanel)
{
foreach (UIElement child in parentPanel.Children)
{
if (child is DocumentPane)
return true;
if (child is ResizingPanel)
{
bool foundDocPane = IsPanelContainingDocumentPane(child as ResizingPanel);
if (foundDocPane)
return foundDocPane;
}
}
return false;
}
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:16,代码来源:DockingManager.cs
示例10: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.GuestBookerStartWindow = ((Guest_Booker_Studio.MainWindow)(target));
return;
case 2:
this.Pgrid = ((System.Windows.Controls.Grid)(target));
return;
case 3:
this.Part_Title = ((System.Windows.Controls.Grid)(target));
#line 19 "..\..\..\MainWindow.xaml"
this.Part_Title.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Part_Title_DoubleClick);
#line default
#line hidden
return;
case 4:
this.minimizeButton = ((System.Windows.Controls.Button)(target));
#line 39 "..\..\..\MainWindow.xaml"
this.minimizeButton.Click += new System.Windows.RoutedEventHandler(this.minimizeButton_Click);
#line default
#line hidden
return;
case 5:
this.restoreMaximizeButton = ((System.Windows.Controls.Button)(target));
#line 42 "..\..\..\MainWindow.xaml"
this.restoreMaximizeButton.Click += new System.Windows.RoutedEventHandler(this.restoreMaximizeButton_Click);
#line default
#line hidden
return;
case 6:
this.closeButton = ((System.Windows.Controls.Button)(target));
#line 45 "..\..\..\MainWindow.xaml"
this.closeButton.Click += new System.Windows.RoutedEventHandler(this.closeButton_Click);
#line default
#line hidden
return;
case 7:
this.dockManager = ((AvalonDock.DockingManager)(target));
return;
case 8:
this.vPanel = ((AvalonDock.ResizingPanel)(target));
return;
case 9:
this.hPanel = ((AvalonDock.ResizingPanel)(target));
return;
case 10:
this.WorkAreaWindow = ((Guest_Booker_Studio.Pages.Generic.InnerWindow)(target));
return;
case 11:
this.ApplicationExplorerPane = ((AvalonDock.DockablePane)(target));
return;
case 12:
this.ApplicationExplorer = ((Guest_Booker_Studio.Presentation.Controls.CustomerExplorerControl)(target));
return;
case 13:
this.mainWindowStatusBarMessage = ((System.Windows.Controls.TextBlock)(target));
return;
}
this._contentLoaded = true;
}
开发者ID:jacobmodayil,项目名称:GuestBookerStudio,代码行数:69,代码来源:MainWindow.g.i.cs
示例11: activatePlugin
public bool activatePlugin( string PluginFile, ref List<IPlugin> Plugins )
{
Assembly asm = null;
try
{
// FIXME: check only for valid .net assemblies with manifest
asm = Assembly.LoadFile( PluginFile );
if ( asm == null )
return false;
}
catch ( Exception e )
{
}
Type PluginClass = null;
int i = 0;
// iterate through all types in assembly
// !! FIXME: for debug only
//foreach ( Type type in asm.GetTypes() )
//{
//PluginClass = type;
// !! FIXME: for debug only
//if ( PluginClass is IRenderEngine )
// if a rendering able plugin was found
//{
try
{
// create an instance of rendering plugin
//IRenderEngine tplugin = Activator.CreateInstance( PluginClass ) as IRenderEngine;
IRenderEngine tplugin = (IRenderEngine) new RayCaster( dsm, anim_man );
ModelOrientationControl orientationControl = new ModelOrientationControl(tplugin,wm);
var dockPane = new DockablePane();
dockPane.Items.Add( new DockableContent()
{
Name = "orientationContent",
Title = "Orientation",
Content = orientationControl
} );
var resHorizontalPanel = new ResizingPanel()
{
Orientation = Orientation.Horizontal
};
resHorizontalPanel.Children.Add( dockPane );
//resHorizontalPanel.Children.Add( logDockPane);
this.wm.DockingManager.Content = resHorizontalPanel;
var ccc = this.wm.DockingManager.Content;
if ( tplugin != null )
Plugins.Add( tplugin );
// setup a new RenderWindow
RenderWindow renderWindow = new RenderWindow();
renderWindow.RenderEngine = tplugin;
//var renderingDataset = dsm.getRenderingDatasetRef();
//renderWindow.SetRenderingDataset( ref renderingDataset );
OpenGLWindow glWindow = new OpenGLWindow();
glWindow.SetRenderingMethod( tplugin );
renderWindow.GlWindows.Add( glWindow );
this.rwm.RenderWindows.Add( renderWindow );
// setup marching cubes opengl window
IRenderEngine marchingCubesPlugin = (IRenderEngine) new MarchingCubes( dsm );
if ( marchingCubesPlugin != null )
Plugins.Add( marchingCubesPlugin );
// setup a new RenderWindow
RenderWindow renderWindow2 = new RenderWindow();
renderWindow2.RenderEngine = marchingCubesPlugin;
OpenGLWindow glWindow2 = new OpenGLWindow();
glWindow2.SetRenderingMethod( marchingCubesPlugin );
renderWindow2.GlWindows.Add( glWindow2 );
//this.rwm.RenderWindows.Add(renderWindow2);
wm.Register( this.rwm );
}
//}
catch ( Exception e )
{
MessageBox.Show( "Shit happened during plugin registration: " + PluginFile + e.Message );
}
//.........这里部分代码省略.........
开发者ID:msup,项目名称:RayEngine,代码行数:101,代码来源:PluginManager.cs
示例12: MainWindowViewModel
public MainWindowViewModel(DockingManager dockingManager, ResizingPanel horizontalResizingPanel, ResizingPanel verticalResizingPanel, DockablePane tabsPane)
{
this.dockingManager = dockingManager;
dockingManager.ActiveDocumentChanged += delegate(object sender, EventArgs args)
{
this.UpdateViews();
};
this.toolboxControl = new ToolboxControl();
this.InitialiseToolbox();
this.horizontalResizingPanel = horizontalResizingPanel;
this.verticalResizingPanel = verticalResizingPanel;
this.tabsPane = tabsPane;
this.dockableContents = new Dictionary<ContentTypes, DockableContent>();
this.ViewToolbox();
string disableDebugViewOutputValue = ConfigurationManager.AppSettings["DisableDebugViewOutput"];
if (!string.IsNullOrEmpty(disableDebugViewOutputValue))
{
this.disableDebugViewOutput = bool.Parse(disableDebugViewOutputValue);
}
}
开发者ID:yinqunjun,项目名称:WorkflowFoundation.40.45.Development,代码行数:26,代码来源:MainWindowViewModel.cs
示例13: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.mnuFlipContent = ((System.Windows.Controls.MenuItem)(target));
#line 12 "..\..\Window5.xaml"
this.mnuFlipContent.Click += new System.Windows.RoutedEventHandler(this.ShowDockingManager_Click);
#line default
#line hidden
return;
case 2:
this.TestContainer = ((System.Windows.Controls.ContentControl)(target));
return;
case 3:
this._dockingManager = ((AvalonDock.DockingManager)(target));
#line 16 "..\..\Window5.xaml"
this._dockingManager.Loaded += new System.Windows.RoutedEventHandler(this._dockingManager_Loaded);
#line default
#line hidden
return;
case 4:
this.content1 = ((AvalonDock.DockableContent)(target));
return;
case 5:
this.content2 = ((AvalonDock.DockableContent)(target));
return;
case 6:
this.content3 = ((AvalonDock.DockableContent)(target));
return;
case 7:
this.bottomPanel = ((AvalonDock.ResizingPanel)(target));
return;
case 8:
this.ShowMeFirst = ((AvalonDock.DockableContent)(target));
return;
case 9:
this.ShowMeSecond = ((AvalonDock.DockableContent)(target));
return;
case 10:
this.AlsoShowMeSecond = ((AvalonDock.DockableContent)(target));
return;
}
this._contentLoaded = true;
}
开发者ID:Reticulatas,项目名称:AvalonDock,代码行数:48,代码来源:Window5.g.cs
示例14: Register
public void Register( RenderWindowManager rwm )
{
this.rwm = rwm;
//var tabItem = new TabItem();
//tabItem.Header = "Pokus";
// var tabItems = TabControl.Items;
var resHorizontalPanel = new ResizingPanel()
{
Orientation = Orientation.Horizontal
};
var resVerticalPanel = new ResizingPanel()
{
Orientation = Orientation.Vertical
};
/*
OpenGLWindow tempGLWin = rwm.RenderWindows[0].GlWindows[0];
var wfh = new WindowsFormsHost();
wfh.Child = tempGLWin;
var dockPane = new DockablePane();
var documentPane = new DocumentPane();
dockPane.Items.Add( new DockableContent()
{
Name = "classesContent",
Title = "Classes"
} );
*/
var dockPane = new DockablePane();
var documentPane = new DocumentPane();
foreach ( var openglWindow in rwm.RenderWindows )
{
var formHost = new WindowsFormsHost()
{
Child = openglWindow.GlWindows[0]
};
documentPane.Items.Add
(
new DocumentContent()
{
Content = formHost,
Title = "a"
}
);
}
//var a = new DocumentContent();
//a.Content = wfh;
//a.Title = "Raycast";
//documentPane.Items.Add( a );
//documentPane.Items.Add( new DocumentContent()
//{
// Title = "My Document!"
//} );
//dockPane.Items.Add( new DockableContent()
//{
// Name = "classesContent",
// Title = "Logs",
//} );
//var logDockPane = new DockablePane();
//logDockPane.Items.Add( new DockableContent()
//{
// Name = "classesContent",
// Title = "Logs",
//}
//);
//resVerticalPanel.Children.Add( logDockPane );
ResizingPanel XXX = DockingManager.Content as ResizingPanel;
XXX.Children.Add( dockPane );
XXX.Children.Add( documentPane );
//resHorizontalPanel.Children.Add( logDockPane);
DockingManager.Content = XXX;
}
开发者ID:msup,项目名称:RayEngine,代码行数:92,代码来源:WindowManager.cs
注:本文中的AvalonDock.ResizingPanel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论