- 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.Xml;
using System.Windows.Forms;
using System.Runtime.Serialization;
using Crownwood.Magic.Docking;
using Crownwood.Magic.Collections;
namespace Crownwood.Magic.Collections
{
public class ManagerContentCollection : CollectionWithEvents
{
// Instance fields
protected DockingManager _manager;
public ManagerContentCollection(DockingManager manager)
{
// Must provide a valid manager instance
if (manager == null)
throw new ArgumentNullException("DockingManager");
// Default the state
_manager = manager;
}
public Content Add()
{
Content c = new Content(_manager);
// Use base class to process actual collection operation
base.List.Add(c as object);
return c;
}
// Should only ever be used by Serialization
public Content Add(Content c)
{
// Assign correct docking manager to object
c.DockingManager = _manager;
// Use base class to process actual collection operation
base.List.Add(c as object);
return c;
}
public Content Add(Control control)
{
Content c = new Content(_manager, control);
// Use base class to process actual collection operation
base.List.Add(c as object);
return c;
}
public Content Add(Control control, string title)
{
Content c = new Content(_manager, control, title);
// Use base class to process actual collection operation
base.List.Add(c as object);
return c;
}
public Content Add(Control control, string title, ImageList imageList, int imageIndex)
{
Content c = new Content(_manager, control, title, imageList, imageIndex);
// Use base class to process actual collection operation
base.List.Add(c as object);
return c;
}
public void Remove(Content value)
{
// Use base class to process actual collection operation
base.List.Remove(value as object);
}
public bool Contains(Content value)
{
// Use base class to process actual collection operation
return base.List.Contains(value as object);
}
public Content this[int index]
{
// Use base class to process actual collection operation
get { return (base.List[index] as Content); }
}
public Content this[string title]
{
get
{
// Search for a Content with a matching title
foreach(Content c in base.List)
if (c.Title == title)
return c;
return null;
}
}
public int SetIndex(int newIndex, Content value)
{
base.List.Remove(value);
base.List.Insert(newIndex, value);
return newIndex;
}
public int IndexOf(Content value)
{
// Find the 0 based index of the requested entry
return base.List.IndexOf(value);
}
public ContentCollection Copy()
{
ContentCollection clone = new ContentCollection();
// Copy each reference across
foreach(Content c in base.List)
clone.Add(c);
return clone;
}
}
}
|
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.