Skip to content

Commit

Permalink
Add code
Browse files Browse the repository at this point in the history
  • Loading branch information
Zekka committed Jul 8, 2018
1 parent 1a2c6e3 commit 4dde126
Show file tree
Hide file tree
Showing 227 changed files with 59,875 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Labyrinth3.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2037
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Labyrinth3", "Labyrinth3\Labyrinth3.csproj", "{B4700781-94F1-41A2-BBD5-4E2E887C66B0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B4700781-94F1-41A2-BBD5-4E2E887C66B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4700781-94F1-41A2-BBD5-4E2E887C66B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4700781-94F1-41A2-BBD5-4E2E887C66B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4700781-94F1-41A2-BBD5-4E2E887C66B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {72F14F84-CEDC-4E45-A381-C26253CFE7FA}
EndGlobalSection
EndGlobal
130 changes: 130 additions & 0 deletions Labyrinth3/Crownwood.Magic/Collections/CollectionWithEvents.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// *****************************************************************************
//
// (c) Crownwood Consulting Limited 2002-2003
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Crownwood Consulting
// Limited, Crownwood, Bracknell, Berkshire, England and are supplied subject
// to licence terms.
//
// Magic Version 1.7.4.0 www.dotnetmagic.com
// *****************************************************************************

using System.Collections;

namespace Crownwood.Magic.Collections
{
// Declare the event signatures
public delegate void CollectionClear();

public delegate void CollectionChange(int index, object value);

public class CollectionWithEvents : CollectionBase
{
// Instance fields
private int _suspendCount;

// Collection change events
public event CollectionClear Clearing;

public event CollectionClear Cleared;

public event CollectionChange Inserting;

public event CollectionChange Inserted;

public event CollectionChange Removing;

public event CollectionChange Removed;

public CollectionWithEvents()
{
// Default to not suspended
_suspendCount = 0;
}

// Do not generate change events until resumed
public void SuspendEvents()
{
_suspendCount++;
}

// Safe to resume change events.
public void ResumeEvents()
{
--_suspendCount;
}

// Are change events currently suspended?
public bool IsSuspended
{
get { return (_suspendCount > 0); }
}

// Overrides for generating events
protected override void OnClear()
{
if (!IsSuspended)
{
// Any attached event handlers?
if (Clearing != null)
Clearing();
}
}

protected override void OnClearComplete()
{
if (!IsSuspended)
{
// Any attached event handlers?
if (Cleared != null)
Cleared();
}
}

protected override void OnInsert(int index, object value)
{
if (!IsSuspended)
{
// Any attached event handlers?
if (Inserting != null)
Inserting(index, value);
}
}

protected override void OnInsertComplete(int index, object value)
{
if (!IsSuspended)
{
// Any attached event handlers?
if (Inserted != null)
Inserted(index, value);
}
}

protected override void OnRemove(int index, object value)
{
if (!IsSuspended)
{
// Any attached event handlers?
if (Removing != null)
Removing(index, value);
}
}

protected override void OnRemoveComplete(int index, object value)
{
if (!IsSuspended)
{
// Any attached event handlers?
if (Removed != null)
Removed(index, value);
}
}

protected int IndexOf(object value)
{
// Find the 0 based index of the requested entry
return base.List.IndexOf(value);
}
}
}
118 changes: 118 additions & 0 deletions Labyrinth3/Crownwood.Magic/Collections/ContentCollection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// *****************************************************************************
//
// (c) Crownwood Consulting Limited 2002-2003
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Crownwood Consulting
// Limited, Crownwood, Bracknell, Berkshire, England and are supplied subject
// to licence terms.
//
// Magic Version 1.7.4.0 www.dotnetmagic.com
// *****************************************************************************

using Crownwood.Magic.Docking;
using System;

namespace Crownwood.Magic.Collections
{
public class ContentCollection : CollectionWithEvents
{
public Content Add(Content value)
{
// Use base class to process actual collection operation
base.List.Add(value as object);

return value;
}

public void AddRange(Content[] values)
{
// Use existing method to add each array entry
foreach (Content page in values)
Add(page);
}

public void Remove(Content value)
{
// Use base class to process actual collection operation
base.List.Remove(value as object);
}

public void Insert(int index, Content value)
{
// Use base class to process actual collection operation
base.List.Insert(index, value as object);
}

public bool Contains(Content value)
{
// Use base class to process actual collection operation
return base.List.Contains(value as object);
}

public bool Contains(ContentCollection values)
{
foreach (Content c in values)
{
// Use base class to process actual collection operation
if (Contains(c))
return true;
}

return false;
}

public bool Contains(String value)
{
foreach (Content c in base.List)
if (c.Title.Equals(value))
return true;

return false;
}

public bool Contains(StringCollection values)
{
foreach (String s in values)
if (Contains(s))
return true;

return false;
}

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 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;
}
}
}
75 changes: 75 additions & 0 deletions Labyrinth3/Crownwood.Magic/Collections/HotZoneCollection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// *****************************************************************************
//
// (c) Crownwood Consulting Limited 2002-2003
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Crownwood Consulting
// Limited, Crownwood, Bracknell, Berkshire, England and are supplied subject
// to licence terms.
//
// Magic Version 1.7.4.0 www.dotnetmagic.com
// *****************************************************************************

using Crownwood.Magic.Docking;
using System.Drawing;

namespace Crownwood.Magic.Collections
{
public class HotZoneCollection : CollectionWithEvents
{
public HotZone Add(HotZone value)
{
// Use base class to process actual collection operation
base.List.Add(value as object);

return value;
}

public void AddRange(HotZone[] values)
{
// Use existing method to add each array entry
foreach (HotZone page in values)
Add(page);
}

public void Remove(HotZone value)
{
// Use base class to process actual collection operation
base.List.Remove(value as object);
}

public void Insert(int index, HotZone value)
{
// Use base class to process actual collection operation
base.List.Insert(index, value as object);
}

public bool Contains(HotZone value)
{
// Use base class to process actual collection operation
return base.List.Contains(value as object);
}

public HotZone this[int index]
{
// Use base class to process actual collection operation
get { return (base.List[index] as HotZone); }
}

public int IndexOf(HotZone value)
{
// Find the 0 based index of the requested entry
return base.List.IndexOf(value);
}

public HotZone Contains(Point pt)
{
foreach (HotZone hz in base.List)
{
if (hz.HotArea.Contains(pt))
return hz;
}

return null;
}
}
}
Loading

0 comments on commit 4dde126

Please sign in to comment.