- machatproject.zip
- MaChatproject
- Chat.sln
- Chat.suo
- ChatLibrary
- MaChat
- MagicLibrary
- AssemblyInfo.cs
- bin
- Debug
- Release
- Collections
- Common
- Controls
- Docking
- MagicLibrary.csproj
- MagicLibrary.csproj.user
- Menus
- obj
- Debug
- MagicLibrary.projdata
- temp
- TempPE
- Release
- MagicLibrary.projdata
- temp
- TempPE
- Resources
- ImagesCaptionIDE.bmp
- ImagesCaptionPlain.bmp
- ImagesMenuControl.bmp
- ImagesPopupMenu.bmp
- ImagesTabControl.bmp
- LibraryIcon.ico
- Win32
- Resources
- bin
- MaChat.ChatProxy.pl.resX
- MaChat.ChatProxy.resX
- MaChat.MainForm.pl.resX
- MaChat.MainForm.resX
- MaChat.OptionsDlg.pl.resX
- MaChat.OptionsDlg.resX
- obj
- Resources.vcproj
- Setup
- Setup.vdproj
- Setup
- ssetup.zip
- sSetup.msi
- lsetup.zip
- lSetup.msi
|
// *****************************************************************************
//
// (c) Crownwood Consulting Limited 2002
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Crownwood Consulting
// Limited, Haxey, North Lincolnshire, England and are supplied subject to
// licence terms.
//
// Magic Version 1.6 www.dotnetmagic.com
// *****************************************************************************
using System;
using System.Drawing;
using System.Windows.Forms;
using Crownwood.Magic.Win32;
using Crownwood.Magic.Common;
namespace Crownwood.Magic.Docking
{
public class HotZoneSequence : HotZone
{
// Instance fields
protected int _index;
protected ZoneSequence _zs;
public HotZoneSequence(Rectangle hotArea, Rectangle newSize, ZoneSequence zs, int index)
: base(hotArea, newSize)
{
_index = index;
_zs = zs;
}
public override bool ApplyChange(Point screenPos, Redocker parent)
{
// We are only called from the RedockerContent class
RedockerContent redock = parent as RedockerContent;
DockingManager dockingManager = redock.DockingManager;
bool becomeFloating = (_zs.State == State.Floating);
// Reduce flicker during transition
dockingManager.Container.SuspendLayout();
// Manageing Zones should remove display AutoHide windows
dockingManager.RemoveShowingAutoHideWindows();
switch(redock.DockingSource)
{
case RedockerContent.Source.RawContent:
{
// Perform State specific Restore actions
if (becomeFloating)
redock.Content.ContentBecomesFloating();
// Create a new Window to host Content
Window w = dockingManager.CreateWindowForContent(redock.Content);
// Add into Zone
_zs.Windows.Insert(_index, w);
}
break;
case RedockerContent.Source.WindowContent:
{
// Is the destination Zone in the Floating state?
if (becomeFloating)
{
foreach(Content c in redock.WindowContent.Contents)
c.ContentBecomesFloating();
}
else
{
if (redock.WindowContent.State == State.Floating)
{
foreach(Content c in redock.WindowContent.Contents)
c.ContentLeavesFloating();
}
}
// Check if the WindowContent source is in same Zone
if (redock.WindowContent.ParentZone == _zs)
{
// Find current position of source WindowContent
int currPos = _zs.Windows.IndexOf(redock.WindowContent);
// If current window is before the new position then the current
// window will disappear before the new one is inserted,so need to
// adjust down the new insertion point
if (currPos < _index)
_index--;
}
// Create a new Window to host Content
WindowContent wc = dockingManager.CreateWindowForContent(null) as WindowContent;
// Transfer content across
int count = redock.WindowContent.Contents.Count;
for(int index=0; index<count; index++)
{
Content c = redock.WindowContent.Contents[0];
// Remove from existing location
redock.WindowContent.Contents.RemoveAt(0);
// Add into new WindowContent host
wc.Contents.Add(c);
}
// Add into host into Zone
_zs.Windows.Insert(_index, wc);
}
break;
case RedockerContent.Source.ContentInsideWindow:
{
// Perform State specific Restore actions
if (becomeFloating)
redock.Content.ContentBecomesFloating();
else
{
if (redock.Content.ParentWindowContent.State == State.Floating)
redock.Content.ContentLeavesFloating();
}
// Remove Content from existing WindowContent
if (redock.Content.ParentWindowContent != null)
{
// Will removing the Content cause the WindowContent to die?
if (redock.Content.ParentWindowContent.Contents.Count == 1)
{
// Check if the WindowContent source is in same Zone
if (redock.Content.ParentWindowContent.ParentZone == _zs)
{
// Find current position of source WindowContent
int currPos = _zs.Windows.IndexOf(redock.Content.ParentWindowContent);
// If current window is before the new position then the current
// window will disappear before the new one is inserted,so need to
// adjust down the new insertion point
if (currPos < _index)
_index--;
}
}
redock.Content.ParentWindowContent.Contents.Remove(redock.Content);
}
// Create a new Window to host Content
Window w = dockingManager.CreateWindowForContent(redock.Content);
// Add into Zone
_zs.Windows.Insert(_index, w);
}
break;
case RedockerContent.Source.FloatingForm:
{
// Perform State specific Restore actions
if (!becomeFloating)
{
// Make every Content object in the Floating Zone
// record its current state as the Floating state
redock.FloatingForm.ExitFloating();
}
int count = redock.FloatingForm.Zone.Windows.Count;
for(int index=count-1; index>=0; index--)
{
// Remember the Window reference
Window w = redock.FloatingForm.Zone.Windows[index];
// Remove from floating collection
redock.FloatingForm.Zone.Windows.RemoveAt(index);
// Add into new ZoneSequence destination
_zs.Windows.Insert(_index, w);
}
}
break;
}
dockingManager.UpdateInsideFill();
// Reduce flicker during transition
dockingManager.Container.ResumeLayout();
return true;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Micheal is an independent consultant -
www.macmichal.pl.
He's main areas of interest are: DDD\CqRS, TDD, SaaS, Design Patterns, Architecture. He specializes in .Net/C# for the early beginning of it and T-SQL. He's a writer, blogger (
blog.macmichal.pl) and speaker.
In his spare time, he's climbing the mountains all over the Europe.