Subversion Repositories SoapBoxCore

Compare Revisions

Ignore whitespace Rev 11 → Rev 12

/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.HighScores/Workbench/MainMenu/ViewMenu.cs
31,7 → 31,7
/// <summary>
/// Add a menu item to the view menu to launch the HighScores "Pad"
/// </summary>
[Export("/Workbench/MainMenu/ViewMenu", typeof(IMenuItem))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.MainMenu.ViewMenu, typeof(IMenuItem))]
class ViewMenuHighScores : AbstractMenuItem
{
public ViewMenuHighScores()
45,10 → 45,10
ToolTip = Resources.Strings.Workbench_MainMenu_View_HighScores_ToolTip;
}
 
[Import("/Workbench/LayoutManager", typeof(ILayoutManager))]
[Import(SoapBox.Core.Services.Layout.LayoutManager, typeof(ILayoutManager))]
private Lazy<ILayoutManager> layoutManager { get; set; }
 
[Import("/Workbench/Pads/HighScores")]
[Import(CompositionPoints.Workbench.Pads.HighScores, typeof(HighScores))]
private Lazy<HighScores> highScoresPad { get; set; }
 
protected override void Run()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.HighScores/CompositionPoints.cs
New file
0,0 → 1,38
#region "SoapBox.Demo License"
/// <header module="SoapBox.Demo">
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Demo.
///
/// GNU Lesser General Public License Usage
/// SoapBox Demo is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Demo is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Demo. If not, see <http://www.gnu.org/licenses/>.
/// </header>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace SoapBox.Demo.HighScores.CompositionPoints
{
public static class Workbench
{
public static class Pads
{
public const string HighScores = "CompositionPoints.Workbench.Pads.HighScores";
}
}
}
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.HighScores/Pads/HighScores.cs
40,19 → 40,21
 
namespace SoapBox.Demo.HighScores
{
[Export("/Workbench/Pads", typeof(IPad))]
[Export("/Workbench/Pads/HighScores", typeof(HighScores))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.Pads, typeof(IPad))]
[Export(CompositionPoints.Workbench.Pads.HighScores, typeof(HighScores))]
[Pad(Name = HighScores.PAD_NAME)]
class HighScores : AbstractPad
{
public const string PAD_NAME = "HighScores";
 
private readonly string FILE_NAME = Path.Combine(AppEnvironment.UserFileDirectory(), "HighScores.dat");
 
[ImportingConstructor]
public HighScores([Import("/Services/LoggingService", typeof(ILoggingService))] ILoggingService l
)
public HighScores([Import(SoapBox.Core.Services.Logging.LoggingService, typeof(ILoggingService))] ILoggingService l)
{
logger = l;
 
Name = "HighScores";
Name = PAD_NAME;
Title = Resources.Strings.Pads_HighScores_Title;
 
Stream stream = null;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.HighScores/Pads/HighScoresView.xaml.cs
25,10 → 25,11
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows;
using SoapBox.Core;
 
namespace SoapBox.Demo.HighScores
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class HighScoresView : ResourceDictionary
{
public HighScoresView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.HighScores/SoapBox.Demo.HighScores.csproj
64,6 → 64,7
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CompositionPoints.cs" />
<Compile Include="Pads\HighScore.cs" />
<Compile Include="Pads\HighScores.cs" />
<Compile Include="Pads\HighScoresView.xaml.cs">
92,6 → 93,7
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.HighScores/Properties/AssemblyInfo.cs
51,5 → 51,5
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.HighScores/PinBall/GameOverCommand.cs
35,18 → 35,12
/// This extends the basic pinball table by saving the score and
/// level attained to a log when the game is over.
/// </summary>
[Export("/PinBall/GameOverCommands", typeof(IExecutableCommand))]
[Export(SoapBox.Demo.PinBall.ExtensionPoints.PinBall.GameOverCommands, typeof(IExecutableCommand))]
class GameOverCommand : AbstractExtension, IExecutableCommand
{
[ImportingConstructor]
public GameOverCommand(
[Import("/Workbench/Pads/HighScores", typeof(HighScores))] HighScores highScores)
{
m_highScores = highScores;
}
[Import(CompositionPoints.Workbench.Pads.HighScores, typeof(HighScores))]
private Lazy<HighScores> highScores { get; set; }
 
private HighScores m_highScores = null;
 
/// <summary>
/// Registers the high scores with the HighScores ViewModel
/// </summary>
59,7 → 53,7
PinBallTable table = args[0] as PinBallTable;
if (table != null)
{
m_highScores.LogNewHighScore(String.Empty, table.Score, table.Level);
highScores.Value.LogNewHighScore(String.Empty, table.Score, table.Level);
}
}
}
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.Setup/SoapBox.Demo.Setup.vdproj
28,7 → 28,7
"Entry"
{
"MsmKey" = "8:_0D30F42AA1BF4CAD68CF0F68CA2E2B31"
"OwnerKey" = "8:_8E480031C5768A3B50E7DDD1CC6FB6B2"
"OwnerKey" = "8:_F7FC1D3D80B38971FAF5D41E0DE86C62"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
57,38 → 57,32
}
"Entry"
{
"MsmKey" = "8:_4365DD127F0B3709BC90660E1580951F"
"OwnerKey" = "8:_E96755324F944975A46F1C2AB887C641"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_5F824C2444B3EDF75FB5370DA7D73623"
"MsmKey" = "8:_4998B8EEEC27365C0BF8E33D86ED87DA"
"OwnerKey" = "8:_942E1D2EEC554C75BF76BB55043FF9D9"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_5F824C2444B3EDF75FB5370DA7D73623"
"MsmKey" = "8:_4998B8EEEC27365C0BF8E33D86ED87DA"
"OwnerKey" = "8:_D02DE4459D56481A95C2B97B80E55CAF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_8C0CE1246298491E8E5275A1B8DA38A1"
"OwnerKey" = "8:_UNDEFINED"
"MsmKey" = "8:_49F449422B863967212A03EED66734FB"
"OwnerKey" = "8:_E96755324F944975A46F1C2AB887C641"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_8E480031C5768A3B50E7DDD1CC6FB6B2"
"OwnerKey" = "8:_942E1D2EEC554C75BF76BB55043FF9D9"
"MsmKey" = "8:_6C40477CE279D0FBB5C74CC42E8F9B5B"
"OwnerKey" = "8:_26742559BF8E4A89AAD993EF50B16BCF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_8E480031C5768A3B50E7DDD1CC6FB6B2"
"OwnerKey" = "8:_D02DE4459D56481A95C2B97B80E55CAF"
"MsmKey" = "8:_8C0CE1246298491E8E5275A1B8DA38A1"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
219,12 → 213,6
}
"Entry"
{
"MsmKey" = "8:_E096C0D8181F8D0E827FCD918FC8A3E3"
"OwnerKey" = "8:_26742559BF8E4A89AAD993EF50B16BCF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_E722170DB899223E1D900E51A2E765E0"
"OwnerKey" = "8:_A1AD242006F6A82DB7AF09B95BC051FB"
"MsmSig" = "8:_UNDEFINED"
303,6 → 291,18
}
"Entry"
{
"MsmKey" = "8:_F7FC1D3D80B38971FAF5D41E0DE86C62"
"OwnerKey" = "8:_942E1D2EEC554C75BF76BB55043FF9D9"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_F7FC1D3D80B38971FAF5D41E0DE86C62"
"OwnerKey" = "8:_D02DE4459D56481A95C2B97B80E55CAF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_FCA971AF249640AF813AD5FA6FA86316"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
328,7 → 328,7
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_4365DD127F0B3709BC90660E1580951F"
"OwnerKey" = "8:_49F449422B863967212A03EED66734FB"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
370,13 → 370,13
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_8E480031C5768A3B50E7DDD1CC6FB6B2"
"OwnerKey" = "8:_F7FC1D3D80B38971FAF5D41E0DE86C62"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_5F824C2444B3EDF75FB5370DA7D73623"
"OwnerKey" = "8:_4998B8EEEC27365C0BF8E33D86ED87DA"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
406,7 → 406,7
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_E096C0D8181F8D0E827FCD918FC8A3E3"
"OwnerKey" = "8:_6C40477CE279D0FBB5C74CC42E8F9B5B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
530,7 → 530,7
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:AdvanceMath, Version=2.0.0.35371, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:AdvanceMath, Version=2.0.0.40248, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_0D30F42AA1BF4CAD68CF0F68CA2E2B31"
553,7 → 553,7
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:TRUE"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
588,20 → 588,20
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4365DD127F0B3709BC90660E1580951F"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4998B8EEEC27365C0BF8E33D86ED87DA"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:AvalonDock, Version=1.2.2681.0, Culture=neutral, PublicKeyToken=85a1e0ada7ec13e4, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:AdvanceMath, Version=2.0.0.40248, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_4365DD127F0B3709BC90660E1580951F"
"_4998B8EEEC27365C0BF8E33D86ED87DA"
{
"Name" = "8:AvalonDock.dll"
"Name" = "8:AdvanceMath.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:AvalonDock.dll"
"SourcePath" = "8:AdvanceMath.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_980FCFBE379243608A076BD67BAD8829"
619,20 → 619,20
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5F824C2444B3EDF75FB5370DA7D73623"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_49F449422B863967212A03EED66734FB"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:AdvanceMath, Version=2.0.0.35371, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:AvalonDock, Version=1.2.2691.0, Culture=neutral, PublicKeyToken=85a1e0ada7ec13e4, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_5F824C2444B3EDF75FB5370DA7D73623"
"_49F449422B863967212A03EED66734FB"
{
"Name" = "8:AdvanceMath.dll"
"Name" = "8:AvalonDock.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:AdvanceMath.dll"
"SourcePath" = "8:AvalonDock.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_980FCFBE379243608A076BD67BAD8829"
650,20 → 650,20
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_8E480031C5768A3B50E7DDD1CC6FB6B2"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_6C40477CE279D0FBB5C74CC42E8F9B5B"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Physics2DDotNet, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:NLog, Version=1.0.0.505, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_8E480031C5768A3B50E7DDD1CC6FB6B2"
"_6C40477CE279D0FBB5C74CC42E8F9B5B"
{
"Name" = "8:Physics2DDotNet.dll"
"Name" = "8:NLog.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Physics2DDotNet.dll"
"SourcePath" = "8:NLog.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_980FCFBE379243608A076BD67BAD8829"
708,7 → 708,7
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:TRUE"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
774,20 → 774,20
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_E096C0D8181F8D0E827FCD918FC8A3E3"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_E722170DB899223E1D900E51A2E765E0"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:NLog, Version=1.0.0.505, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:System.ComponentModel.Composition, Version=2009.22.10.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_E096C0D8181F8D0E827FCD918FC8A3E3"
"_E722170DB899223E1D900E51A2E765E0"
{
"Name" = "8:NLog.dll"
"Name" = "8:System.ComponentModel.Composition.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:NLog.dll"
"SourcePath" = "8:System.ComponentModel.Composition.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_980FCFBE379243608A076BD67BAD8829"
805,20 → 805,20
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_E722170DB899223E1D900E51A2E765E0"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F7FC1D3D80B38971FAF5D41E0DE86C62"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:System.ComponentModel.Composition, Version=2009.22.10.0, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:Physics2DDotNet, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_E722170DB899223E1D900E51A2E765E0"
"_F7FC1D3D80B38971FAF5D41E0DE86C62"
{
"Name" = "8:System.ComponentModel.Composition.dll"
"Name" = "8:Physics2DDotNet.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.ComponentModel.Composition.dll"
"SourcePath" = "8:Physics2DDotNet.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_980FCFBE379243608A076BD67BAD8829"
903,23 → 903,23
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:SoapBox Core Pin Ball Demo"
"ProductCode" = "8:{9DA2B28F-56A9-4473-8510-B83B482AD2BB}"
"PackageCode" = "8:{0EFAEB91-87BF-4AA8-B803-B7CD911BB330}"
"ProductCode" = "8:{DEB3B890-0D6C-4B12-A4C2-8CE4C9C2A3A7}"
"PackageCode" = "8:{719783F0-6A25-444D-979B-00FD92F743AE}"
"UpgradeCode" = "8:{1245DED9-4D93-48F9-A076-A12D8E3343B1}"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:09.11.04"
"ProductVersion" = "8:09.11.11"
"Manufacturer" = "8:SoapBox Automation"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
"ARPHELPLINK" = "8:http://soapboxcore.com/"
"Title" = "8:SoapBox Core Pin Ball Demo"
"Subject" = "8:"
"ARPCONTACT" = "8:SoapBox Automation"
"Keywords" = "8:"
"ARPCOMMENTS" = "8:"
"ARPURLINFOABOUT" = "8:"
"ARPURLINFOABOUT" = "8:http://soapboxautomation.com/"
"ARPPRODUCTICON" = "8:"
"ARPIconIndex" = "3:0"
"SearchPath" = "8:"
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/CompositionPoints.cs
New file
0,0 → 1,30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace SoapBox.Demo.PinBall.CompositionPoints
{
public static class PinBall
{
public const string PinBallTable = "CompositionPoints.PinBall.PinBallTable";
public const string OptionsPad = "CompositionPoints.PinBall.OptionsPad";
}
 
public static class Workbench
{
public static class Pads
{
public const string Instructions = "CompositionPoints.Workbench.Pads.Instructions";
}
 
public static class StatusBar
{
public const string BallCounterHeading = "CompositionPoints.Workbench.StatusBar.BallCounterHeading";
public const string BallCounterText = "CompositionPoints.Workbench.StatusBar.BallCounterText";
public const string BallsScoreSeparator = "CompositionPoints.Workbench.StatusBar.BallsScoreSeparator";
public const string ScoreDisplayHeading = "CompositionPoints.Workbench.StatusBar.ScoreDisplayHeading";
public const string ScoreDisplayText = "CompositionPoints.Workbench.StatusBar.ScoreDisplayText";
}
}
}
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/PinBallTableView.xaml.cs
30,10 → 30,11
using System.Windows.Input;
using System.Windows.Media;
using SoapBox.Core.Arena;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallTableView : ResourceDictionary
{
public PinBallTableView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLevel/PinBallLevelTriggerView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallLevelTriggerView : ResourceDictionary
{
public PinBallLevelTriggerView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLevel/PinBallLevelDisplayView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallLevelDisplayView : ResourceDictionary
{
public PinBallLevelDisplayView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLevel/PinBallLevelTrigger.cs
36,7 → 36,7
public const float WIDTH = PinBall.PIN_BALL_RADIUS * 2f * 1.2f;
public const float HEIGHT = PinBall.PIN_BALL_RADIUS * 4f;
 
public PinBallLevelTrigger(IPinBallTable table, Point startingPoint)
public PinBallLevelTrigger(PinBallTable table, Point startingPoint)
{
m_table = table;
 
49,7 → 49,7
Sprite = new PinBallLevelTriggerSprite();
}
 
private IPinBallTable m_table = null;
private PinBallTable m_table = null;
private PinBallRectangularSensor m_sensor = null;
 
void m_sensor_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLevel/PinBallLevelDisplay.cs
36,7 → 36,7
public const float WIDTH = 200f;
public const float HEIGHT = 110f;
 
public PinBallLevelDisplay(IPinBallTable table, Point startingPoint)
public PinBallLevelDisplay(PinBallTable table, Point startingPoint)
{
InitialX = (float)startingPoint.X;
InitialY = (float)startingPoint.Y;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallKicker/PinBallKickerView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallKickerView : ResourceDictionary
{
public PinBallKickerView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallPartition/PinBallPartitionView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallPartitionView : ResourceDictionary
{
public PinBallPartitionView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallSensor/PinBallCircularSensor.cs
45,7 → 45,7
private readonly float m_SensorRadius = PinBall.PIN_BALL_RADIUS;
#endregion
 
public PinBallCircularSensor(IPinBallTable table, Point startingPoint, float sensorRadius)
public PinBallCircularSensor(PinBallTable table, Point startingPoint, float sensorRadius)
{
m_table = table;
m_StartingPoint = startingPoint;
56,7 → 56,7
}
}
 
private IPinBallTable m_table = null;
private PinBallTable m_table = null;
private Point m_StartingPoint;
 
private void OnUpdate(object sender, EventArgs e)
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallSensor/PinBallRectangularSensor.cs
45,7 → 45,7
private readonly float m_SensorRadius = PinBall.PIN_BALL_RADIUS;
#endregion
 
public PinBallRectangularSensor(IPinBallTable table, Point p1, Point p2)
public PinBallRectangularSensor(PinBallTable table, Point p1, Point p2)
{
m_table = table;
m_width = (float)Math.Abs(p2.X - p1.X);
58,7 → 58,7
}
}
 
public PinBallRectangularSensor(IPinBallTable table, float x, float y, float width, float height, float angle)
public PinBallRectangularSensor(PinBallTable table, float x, float y, float width, float height, float angle)
{
m_table = table;
m_width = width;
75,7 → 75,7
private float m_height;
private float m_angle;
private Point m_center;
private IPinBallTable m_table = null;
private PinBallTable m_table = null;
 
private void OnUpdate(object sender, EventArgs e)
{
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallTableEdge/PinBallTableEdgeView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallTableEdgeView : ResourceDictionary
{
public PinBallTableEdgeView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallTableEdge/PinBallTableEdge.cs
41,7 → 41,7
{
public const int SIDE_WIDTH = 10;
 
public PinBallTableEdge(IPinBallTable table,
public PinBallTableEdge(PinBallTable table,
PinBallTableSide side)
{
Friction = PinBallTable.HARD_SURFACE_FRICTION;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBall/PinBall.cs
33,7 → 33,7
{
public const float PIN_BALL_RADIUS = 20.0f;
 
public PinBall(IPinBallTable table, Point startingPoint)
public PinBall(PinBallTable table, Point startingPoint)
{
Mass = 1.8f;
Friction = 0.0001f;
46,7 → 46,7
Sprite = new PinBallSprite();
}
 
private IPinBallTable m_table = null;
private PinBallTable m_table = null;
 
private readonly ArenaVector m_impulseSum = new ArenaVector();
 
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBall/PinBallView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallView : ResourceDictionary
{
public PinBallView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallBottomBumper/PinBallBottomBumperView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallBottomBumperView : ResourceDictionary
{
public PinBallBottomBumperView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallBottomBumper/PinBallBottomBumper.cs
43,7 → 43,7
public const float Y_DIMENSION1 = 34f; // y dimension between center of bottom and middle corners
public const float Y_DIMENSION2 = 140f; // y dimension between center of bottom and top corners
 
public PinBallBottomBumper(IPinBallTable table,
public PinBallBottomBumper(PinBallTable table,
PinBallBottomBumperSide side)
{
m_side = side;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallBottomBumper/PinBallBottomBumperSprite.cs
35,7 → 35,7
{
float m_sideMultiplier = 1f;
 
public PinBallBottomBumperSprite(IPinBallTable table,
public PinBallBottomBumperSprite(PinBallTable table,
PinBallBottomBumperSide side)
{
// the left side is on the negative X side, right side is positive X
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallRoundedTop/PinBallRoundedTop.cs
31,7 → 31,7
{
public class PinBallRoundedTop : AbstractArenaStationaryBody
{
public PinBallRoundedTop(IPinBallTable table)
public PinBallRoundedTop(PinBallTable table)
{
Friction = 0.0001f;
Restitution = 0.000001f; // lower is a harder (less bouncy) surface
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallRoundedTop/PinBallRoundedTopSprite.cs
33,7 → 33,7
{
public class PinBallRoundedTopSprite : AbstractSprite
{
public PinBallRoundedTopSprite(IPinBallTable table)
public PinBallRoundedTopSprite(PinBallTable table)
{
GeometryGroup sprite = new GeometryGroup();
PathFigure pf = new PathFigure();
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallRoundedTop/PinBallRoundedTopView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallRoundedTopView : ResourceDictionary
{
public PinBallRoundedTopView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/Pin/PinView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinView : ResourceDictionary
{
public PinView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallBottomRamp/PinBallBottomRamp.cs
41,7 → 41,7
public const float MIDDLE_GAP = PinBall.PIN_BALL_RADIUS * 4f;
public const float BOTTOM_POSITION = -PinBallTable.TABLE_DIMENSION_Y/2f + PinBallReturnRamp.HEIGHT + PinBall.PIN_BALL_RADIUS * 2f;
 
public PinBallBottomRamp(IPinBallTable table,
public PinBallBottomRamp(PinBallTable table,
PinBallBottomRampSide side)
{
Friction = PinBallTable.HARD_SURFACE_FRICTION;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallBottomRamp/PinBallBottomRampSprite.cs
33,7 → 33,7
{
public class PinBallBottomRampSprite : AbstractSprite
{
public PinBallBottomRampSprite(IPinBallTable table,
public PinBallBottomRampSprite(PinBallTable table,
PinBallBottomRampSide side)
{
// the left side is on the negative X side, right side is positive X
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallBottomRamp/PinBallBottomRampView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallBottomRampView : ResourceDictionary
{
public PinBallBottomRampView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallFlipperMount/PinBallFlipperMountView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallFlipperMountView : ResourceDictionary
{
public PinBallFlipperMountView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallFlipperMount/PinBallFlipperMount.cs
37,7 → 37,7
 
public class PinBallFlipperMount : AbstractArenaStationaryBody
{
public PinBallFlipperMount(IPinBallTable table,
public PinBallFlipperMount(PinBallTable table,
PinBallFlipperMountSide side)
{
Friction = PinBallTable.HARD_SURFACE_FRICTION;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallFlipperMount/PinBallFlipperMountSprite.cs
33,7 → 33,7
{
public class PinBallFlipperMountSprite : AbstractSprite
{
public PinBallFlipperMountSprite(IPinBallTable table,
public PinBallFlipperMountSprite(PinBallTable table,
PinBallFlipperMountSide side,
float angle)
{
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallStop/PinBallStopController.cs
33,7 → 33,7
class PinBallStopController
{
public PinBallStopController(
IPinBallTable table,
PinBallTable table,
PinBallStop pinBallStop,
PinBallCircularSensor ballPresentSensor,
PinBallRectangularSensor launcherOccupiedSensor,
73,7 → 73,7
new PropertyChangedEventHandler(sensors_PropertyChanged);
 
}
private IPinBallTable m_table = null;
private PinBallTable m_table = null;
private PinBallStop m_pinBallStop = null;
private PinBallCircularSensor m_ballPresentSensor = null;
private PinBallRectangularSensor m_launcherOccupiedSensor = null;
91,7 → 91,7
 
if ((sender is PinBallRectangularSensor && e.PropertyName == m_RectangularSensor_ActiveName) ||
(sender is PinBallCircularSensor && e.PropertyName == m_CircularSensor_ActiveName) ||
(sender is IPinBallTable && e.PropertyName == m_IPinBallTable_BallsName))
(sender is PinBallTable && e.PropertyName == m_IPinBallTable_BallsName))
{
m_pinBallStop.Release =
m_ballPresentSensor.Active
106,6 → 106,6
static readonly string m_CircularSensor_ActiveName =
NotifyPropertyChangedHelper.GetPropertyName<PinBallCircularSensor>(o => o.Active);
static readonly string m_IPinBallTable_BallsName =
NotifyPropertyChangedHelper.GetPropertyName<IPinBallTable>(o => o.Balls);
NotifyPropertyChangedHelper.GetPropertyName<PinBallTable>(o => o.Balls);
}
}
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallStop/PinBallStopView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallStopView : ResourceDictionary
{
public PinBallStopView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallTarget/PinBallTargetView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallTargetView : ResourceDictionary
{
public PinBallTargetView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallBonus/PinBallBonusView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallBonusView : ResourceDictionary
{
public PinBallBonusView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallBonus/PinBallBonus.cs
36,7 → 36,7
{
public const float RADIUS = PinBall.PIN_BALL_RADIUS * 1.2f;
 
public PinBallBonus(IPinBallTable table, Point startingPoint)
public PinBallBonus(PinBallTable table, Point startingPoint)
{
InitialX = (float)startingPoint.X;
InitialY = (float)startingPoint.Y;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallReturnRamp/PinBallReturnRampView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallReturnRampView : ResourceDictionary
{
public PinBallReturnRampView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallReturnRamp/PinBallReturnRamp.cs
33,7 → 33,7
{
public const float HEIGHT = 80f;
public PinBallReturnRamp(IPinBallTable table)
public PinBallReturnRamp(PinBallTable table)
{
Friction = PinBallTable.HARD_SURFACE_FRICTION;
Restitution = PinBallTable.HARD_SURFACE_RESTITUTION;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallReturnRamp/PinBallReturnRampSprite.cs
31,7 → 31,7
{
public class PinBallReturnRampSprite : AbstractSprite
{
public PinBallReturnRampSprite(IPinBallTable table)
public PinBallReturnRampSprite(PinBallTable table)
{
PathFigure pf = new PathFigure();
// start in the bottom left corner
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallFlipper/PinBallFlipperView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallFlipperView : ResourceDictionary
{
public PinBallFlipperView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLauncher/PinBallLauncherCasing.cs
34,7 → 34,7
 
public class PinBallLauncherCasing : AbstractArenaStationaryBody
{
public PinBallLauncherCasing(IPinBallTable table)
public PinBallLauncherCasing(PinBallTable table)
{
Friction = 0.1f;
Restitution = 0.01f;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLauncher/PinBallLauncherGuideSprite.cs
34,7 → 34,7
 
public class PinBallLauncherGuideSprite : AbstractSprite
{
public PinBallLauncherGuideSprite(IPinBallTable table)
public PinBallLauncherGuideSprite(PinBallTable table)
{
Rect rect = new Rect(new Point(table.DimensionX / 2f - PinBallLauncher.LAUNCHER_WIDTH - PinBallTableEdge.SIDE_WIDTH, -table.DimensionY/2f + 70f),
new Point(table.DimensionX / 2f - PinBallLauncher.LAUNCHER_WIDTH, table.DimensionY/2f - 350f));
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLauncher/PinBallLauncherView.xaml.cs
26,10 → 26,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallLauncherView : ResourceDictionary
{
public PinBallLauncherView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLauncher/PinBallLauncherCasingSprite.cs
37,7 → 37,7
public const float WALL_THICKNESS = 5f;
public const float BALL_DEPRESSION_DEPTH = 10f;
 
public PinBallLauncherCasingSprite(IPinBallTable table)
public PinBallLauncherCasingSprite(PinBallTable table)
{
float topCasingWidth = (PinBallLauncher.LAUNCHER_WIDTH-PinBallLauncher.PLUNGER_WIDTH)/2f;
 
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLauncher/PinBallLauncherPlunger.cs
34,7 → 34,7
 
public class PinBallLauncherPlunger : AbstractArenaDynamicBody
{
public PinBallLauncherPlunger(IPinBallTable table)
public PinBallLauncherPlunger(PinBallTable table)
{
m_table = table;
Mass = 25f;
46,7 → 46,7
Sprite = new PinBallLauncherPlungerSprite(this);
}
 
private IPinBallTable m_table;
private PinBallTable m_table;
 
public override void OnUpdate()
{
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLauncher/PinBallLauncherGuide.cs
34,7 → 34,7
 
public class PinBallLauncherGuide : AbstractArenaStationaryBody
{
public PinBallLauncherGuide(IPinBallTable table)
public PinBallLauncherGuide(PinBallTable table)
{
Friction = PinBallTable.HARD_SURFACE_FRICTION;
Restitution = 0.5f;
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLauncher/PinBallLauncher.cs
46,7 → 46,7
}
private Collection<IArenaBody> m_Bodies = new Collection<IArenaBody>();
 
public PinBallLauncher(IPinBallTable table)
public PinBallLauncher(PinBallTable table)
{
m_Bodies.Add(new PinBallLauncherCasing(table));
m_plunger = new PinBallLauncherPlunger(table);
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/ArenaBodies/PinBallLauncher/PinBallLauncherFlipper.cs
28,7 → 28,7
{
public class PinBallLauncherFlipper : PinBallFlipper
{
public PinBallLauncherFlipper(IPinBallTable table)
public PinBallLauncherFlipper(PinBallTable table)
: base( table.DimensionX / 2f - PinBallLauncher.LAUNCHER_WIDTH + PinBallFlipper.CENTER_TO_CENTER/2f - PinBallFlipper.WIDE_WIDTH*2.4f, //x
table.DimensionY / 2f - 279f, //y
0, //angle
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Arena/PinBallTable.cs
32,10 → 32,13
 
namespace SoapBox.Demo.PinBall
{
[Export("/Workbench/Documents", typeof(IDocument))] // so the Workbench can save/restore
[Export("/PinBall/PinBallTable", typeof(IPinBallTable))] // so the new View Menu item can refer to it
public class PinBallTable : AbstractArena, IPinBallTable
[Export(SoapBox.Core.ExtensionPoints.Workbench.Documents, typeof(IDocument))] // so the Workbench can save/restore
[Export(CompositionPoints.PinBall.PinBallTable, typeof(PinBallTable))] // so the new View Menu item can refer to it
[Document(Name = PinBallTable.DOCUMENT_NAME)]
public class PinBallTable : AbstractArena, IPartImportsSatisfiedNotification
{
public const string DOCUMENT_NAME = "PinBallTable";
 
public const float HARD_SURFACE_FRICTION = 0.00001f;
public const float HARD_SURFACE_RESTITUTION = 0.2f;
 
64,18 → 67,16
 
[ImportingConstructor]
public PinBallTable(
[Import("/Services/LoggingService", typeof(ILoggingService))] ILoggingService l,
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/PinBall/GameOverCommands", typeof(IExecutableCommand))] IEnumerable<IExecutableCommand> gameOverCommands,
[Import("/Workbench/StatusBar/BallCounterHeading", typeof(BallCounterHeading))] BallCounterHeading ballCounterHeading,
[Import("/Workbench/StatusBar/BallCounterText", typeof(BallCounterText))] BallCounterText ballCounterText,
[Import("/Workbench/StatusBar/BallsScoreSeparator", typeof(BallsScoreSeparator))] BallsScoreSeparator ballsScoreSeparator,
[Import("/Workbench/StatusBar/ScoreDisplayHeading", typeof(ScoreDisplayHeading))] ScoreDisplayHeading scoreDisplayHeading,
[Import("/Workbench/StatusBar/ScoreDisplayText", typeof(ScoreDisplayText))] ScoreDisplayText scoreDisplayText)
[Import(CompositionPoints.Workbench.StatusBar.BallCounterHeading, typeof(BallCounterHeading))] BallCounterHeading ballCounterHeading,
[Import(CompositionPoints.Workbench.StatusBar.BallCounterText, typeof(BallCounterText))] BallCounterText ballCounterText,
[Import(CompositionPoints.Workbench.StatusBar.BallsScoreSeparator, typeof(BallsScoreSeparator))] BallsScoreSeparator ballsScoreSeparator,
[Import(CompositionPoints.Workbench.StatusBar.ScoreDisplayHeading, typeof(ScoreDisplayHeading))] ScoreDisplayHeading scoreDisplayHeading,
[Import(CompositionPoints.Workbench.StatusBar.ScoreDisplayText, typeof(ScoreDisplayText))] ScoreDisplayText scoreDisplayText)
{
logger = l;
 
m_gameOverCommands = extensionService.Sort(gameOverCommands);
// IDocument properties
Name = DOCUMENT_NAME;
Title = Resources.Strings.Arena_PinBallTable_Title;
 
// Init the ball counter (status bar)
m_ballCounterText = ballCounterText;
191,10 → 192,6
 
#region "Customizable"
 
// IDocument properties
Name = "PinBallTable";
Title = Resources.Strings.Arena_PinBallTable_Title;
 
PinBallRoundedTop top = new PinBallRoundedTop(this);
AddArenaBody(top, 6f); // use a bigger grid spacing to improve performance
 
255,12 → 252,24
PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(PinBallTable_PropertyChanged);
}
 
[Import(SoapBox.Core.Services.Logging.LoggingService, typeof(ILoggingService))]
private ILoggingService logger { get; set; }
 
private BallCounterText m_ballCounterText = null;
private ScoreDisplayText m_scoreDisplayText = null;
 
[Import(SoapBox.Core.Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.PinBall.GameOverCommands, typeof(IExecutableCommand), AllowRecomposition=true)]
private IEnumerable<IExecutableCommand> gameOverCommands { get; set; }
 
private IList<IExecutableCommand> m_gameOverCommands = null;
 
public void OnImportsSatisfied()
{
m_gameOverCommands = extensionService.Sort(gameOverCommands);
}
 
#region "Kickers"
 
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Pads/Instructions.cs
30,13 → 30,16
 
namespace SoapBox.Demo.PinBall
{
[Export("/Workbench/Pads", typeof(IPad))]
[Export("/Workbench/Pads/Instructions", typeof(Instructions))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.Pads, typeof(IPad))]
[Export(CompositionPoints.Workbench.Pads.Instructions, typeof(Instructions))]
[Pad(Name = Instructions.PAD_NAME)]
class Instructions : AbstractPad
{
public const string PAD_NAME = "Instructions";
 
public Instructions()
{
Name = "Instructions";
Name = PAD_NAME;
Title = Resources.Strings.Pads_Instructions_Title;
}
 
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Pads/InstructionsView.xaml.cs
25,10 → 25,11
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class InstructionsView : ResourceDictionary
{
public InstructionsView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Resources/Strings.Designer.cs
196,6 → 196,15
}
/// <summary>
/// Looks up a localized string similar to _Pin Ball Table.
/// </summary>
public static string Workbench_MainMenu_View_PinBallTable {
get {
return ResourceManager.GetString("Workbench_MainMenu_View_PinBallTable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Balls: .
/// </summary>
public static string Workbench_StatusBar_BallCounter_Balls {
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Resources/Strings.resx
162,6 → 162,9
<data name="Workbench_MainMenu_Help_Instructions" xml:space="preserve">
<value>_Instructions</value>
</data>
<data name="Workbench_MainMenu_View_PinBallTable" xml:space="preserve">
<value>_Pin Ball Table</value>
</data>
<data name="Workbench_StatusBar_BallCounter_Balls" xml:space="preserve">
<value>Balls: </value>
</data>
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Options/PinBallOptions.cs
30,16 → 30,25
 
namespace SoapBox.Demo.PinBall
{
[Export("/Workbench/Tools/OptionsDialog/OptionsItems", typeof(IOptionsItem))]
class PinBallOptions : AbstractOptionsItem
[Export(SoapBox.Core.ExtensionPoints.Options.OptionsDialog.OptionsItems, typeof(IOptionsItem))]
class PinBallOptions : AbstractOptionsItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public PinBallOptions(
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/PinBall/PinBallOptionItems", typeof(IOptionsItem))] IEnumerable<IOptionsItem> items,
[Import("/PinBall/PinBallOptionsPad", typeof(PinBallOptionsPad))] PinBallOptionsPad pad)
public PinBallOptions()
{
Header = Resources.Strings.Options_PinBallOptions_Header;
}
 
[Import(SoapBox.Core.Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.PinBall.PinBallOptionItems, typeof(IOptionsItem), AllowRecomposition=true)]
private IEnumerable<IOptionsItem> items { get; set; }
 
[Import(CompositionPoints.PinBall.OptionsPad, typeof(PinBallOptionsPad))]
private PinBallOptionsPad pad { get; set; }
 
public void OnImportsSatisfied()
{
Items = extensionService.Sort(items);
Pad = pad;
}
50,14 → 59,19
/// that is the "General" one, which is the same options pad as the
/// parent in the tree. This just mimics that.
/// </summary>
[Export("/PinBall/PinBallOptionItems", typeof(IOptionsItem))]
class PinBallOptionsGeneral : AbstractOptionsItem
[Export(ExtensionPoints.PinBall.PinBallOptionItems, typeof(IOptionsItem))]
class PinBallOptionsGeneral : AbstractOptionsItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public PinBallOptionsGeneral(
[Import("/PinBall/PinBallOptionsPad", typeof(PinBallOptionsPad))] PinBallOptionsPad pad)
public PinBallOptionsGeneral()
{
Header = Resources.Strings.Options_PinBallOptions_General;
}
 
[Import(CompositionPoints.PinBall.OptionsPad, typeof(PinBallOptionsPad))]
private PinBallOptionsPad pad { get; set; }
 
public void OnImportsSatisfied()
{
Pad = pad;
}
}
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Options/PinBallOptionsPadView.xaml.cs
25,10 → 25,11
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows;
using SoapBox.Core;
 
namespace SoapBox.Demo.PinBall
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(SoapBox.Core.ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class PinBallOptionsPadView : ResourceDictionary
{
public PinBallOptionsPadView()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Options/PinBallOptionsPad.cs
31,7 → 31,7
 
namespace SoapBox.Demo.PinBall
{
[Export("/PinBall/PinBallOptionsPad", typeof(PinBallOptionsPad))]
[Export(CompositionPoints.PinBall.OptionsPad, typeof(PinBallOptionsPad))]
class PinBallOptionsPad : AbstractOptionsPad
{
public PinBallOptionsPad()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Properties/AssemblyInfo.cs
51,5 → 51,5
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/ExtensionPoints.cs
New file
0,0 → 1,36
#region "SoapBox.Demo License"
/// <header module="SoapBox.Demo">
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Demo.
///
/// GNU Lesser General Public License Usage
/// SoapBox Demo is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Demo is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Demo. If not, see <http://www.gnu.org/licenses/>.
/// </header>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace SoapBox.Demo.PinBall.ExtensionPoints
{
public static class PinBall
{
public const string GameOverCommands = "ExtensionPoints.PinBall.GameOverCommands";
public const string PinBallOptionItems = "ExtensionPoints.PinBall.PinBallOptionItems";
}
}
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/SoapBox.Demo.PinBall.csproj
171,7 → 171,8
<DependentUpon>PinView.xaml</DependentUpon>
</Compile>
<Compile Include="Arena\ArenaBodies\Pin\PinSprite.cs" />
<Compile Include="Arena\IPinBallTable.cs" />
<Compile Include="CompositionPoints.cs" />
<Compile Include="ExtensionPoints.cs" />
<Compile Include="Options\PinBallOptions.cs" />
<Compile Include="Options\PinBallOptionsPad.cs" />
<Compile Include="Options\PinBallOptionsPadView.xaml.cs">
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/App/StartupCommands/StartupCommand.cs
35,20 → 35,20
/// <summary>
/// This just makes sure that when we startup, the Pin Ball Table is always visible
/// </summary>
[Export("/App/StartupCommands", typeof(IExecutableCommand))]
[Export(SoapBox.Core.ExtensionPoints.Host.StartupCommands, typeof(IExecutableCommand))]
class StartupCommand : AbstractExtension, IExecutableCommand
{
 
[Import("/App/MainWindow", typeof(Window))]
[Import(SoapBox.Core.CompositionPoints.Host.MainWindow, typeof(Window))]
private Lazy<Window> mainWindow { get; set; }
 
[Import("/Workbench/LayoutManager", typeof(ILayoutManager))]
[Import(SoapBox.Core.Services.Layout.LayoutManager, typeof(ILayoutManager))]
private Lazy<ILayoutManager> layoutManager { get; set; }
 
[Import("/PinBall/PinBallTable", typeof(IPinBallTable))]
private Lazy<IPinBallTable> pinBallTable { get; set; }
[Import(CompositionPoints.PinBall.PinBallTable, typeof(PinBallTable))]
private Lazy<PinBallTable> pinBallTable { get; set; }
 
[Import("/Workbench/Pads/Instructions", typeof(Instructions))]
[Import(CompositionPoints.Workbench.Pads.Instructions, typeof(Instructions))]
private Lazy<Instructions> instructionsPad { get; set; }
 
public void Run(params object[] args)
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Workbench/StatusBar/ScoreDisplay.cs
31,8 → 31,8
 
namespace SoapBox.Demo.PinBall
{
[Export("/Workbench/StatusBar", typeof(IStatusBarItem))]
[Export("/Workbench/StatusBar/BallsScoreSeparator", typeof(BallsScoreSeparator))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
[Export(CompositionPoints.Workbench.StatusBar.BallsScoreSeparator, typeof(BallsScoreSeparator))]
public class BallsScoreSeparator : AbstractStatusBarSeparator
{
public BallsScoreSeparator()
43,8 → 43,8
}
}
 
[Export("/Workbench/StatusBar", typeof(IStatusBarItem))]
[Export("/Workbench/StatusBar/ScoreDisplayHeading", typeof(ScoreDisplayHeading))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
[Export(CompositionPoints.Workbench.StatusBar.ScoreDisplayHeading, typeof(ScoreDisplayHeading))]
public class ScoreDisplayHeading : AbstractStatusBarLabel
{
public ScoreDisplayHeading()
56,8 → 56,8
}
}
 
[Export("/Workbench/StatusBar", typeof(IStatusBarItem))]
[Export("/Workbench/StatusBar/ScoreDisplayText", typeof(ScoreDisplayText))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
[Export(CompositionPoints.Workbench.StatusBar.ScoreDisplayText, typeof(ScoreDisplayText))]
public class ScoreDisplayText : AbstractStatusBarLabel
{
public ScoreDisplayText()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Workbench/StatusBar/PlaceHolder.cs
30,8 → 30,10
 
namespace SoapBox.Demo.PinBall
{
[Export("/Workbench/StatusBar", typeof(IStatusBarItem))]
[Export("/Workbench/StatusBar/PlaceHolder", typeof(PlaceHolder))]
/// <summary>
/// This only exists so that the status bar always has something in it.
/// </summary>
[Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
public class PlaceHolder : AbstractStatusBarLabel
{
public PlaceHolder()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Workbench/StatusBar/BallCounter.cs
31,8 → 31,8
 
namespace SoapBox.Demo.PinBall
{
[Export("/Workbench/StatusBar", typeof(IStatusBarItem))]
[Export("/Workbench/StatusBar/BallCounterHeading", typeof(BallCounterHeading))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
[Export(CompositionPoints.Workbench.StatusBar.BallCounterHeading, typeof(BallCounterHeading))]
public class BallCounterHeading : AbstractStatusBarLabel
{
public BallCounterHeading()
44,8 → 44,8
}
}
 
[Export("/Workbench/StatusBar", typeof(IStatusBarItem))]
[Export("/Workbench/StatusBar/BallCounterText", typeof(BallCounterText))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem))]
[Export(CompositionPoints.Workbench.StatusBar.BallCounterText, typeof(BallCounterText))]
public class BallCounterText : AbstractStatusBarLabel
{
public BallCounterText()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Workbench/MainMenu/HelpMenu.cs
31,7 → 31,7
 
namespace SoapBox.Demo.PinBall
{
[Export("/Workbench/MainMenu/HelpMenu", typeof(IMenuItem))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.MainMenu.HelpMenu, typeof(IMenuItem))]
class HelpMenuInstructions : AbstractMenuItem
{
public HelpMenuInstructions()
40,10 → 40,10
Header = Resources.Strings.Workbench_MainMenu_Help_Instructions;
}
 
[Import("/Workbench/Pads/Instructions", typeof(Instructions))]
private Lazy<IPad> instructionsPad { get; set; }
[Import(CompositionPoints.Workbench.Pads.Instructions, typeof(Instructions))]
private Lazy<Instructions> instructionsPad { get; set; }
 
[Import("/Workbench/LayoutManager", typeof(ILayoutManager))]
[Import(SoapBox.Core.Services.Layout.LayoutManager, typeof(ILayoutManager))]
private Lazy<ILayoutManager> layoutManager { get; set; }
 
protected override void Run()
53,7 → 53,7
}
}
 
[Export("/Workbench/MainMenu/HelpMenu", typeof(IMenuItem))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.MainMenu.HelpMenu, typeof(IMenuItem))]
class HelpMenuAbout : AbstractMenuItem
{
public HelpMenuAbout()
62,7 → 62,7
Header = Resources.Strings.Workbench_MainMenu_Help_About;
}
 
[Import("/App/MainWindow")]
[Import(SoapBox.Core.CompositionPoints.Host.MainWindow)]
private Lazy<Window> mainWindowExport { get; set; }
 
protected override void Run()
/trunk/SoapBox/SoapBox.Demo/SoapBox.Demo.PinBall/Workbench/MainMenu/ViewMenu.cs
32,30 → 32,27
/// <summary>
/// Add a menu item to the view menu to launch the PinBallTable "document"
/// </summary>
[Export("/Workbench/MainMenu/ViewMenu", typeof(IMenuItem))]
[Export(SoapBox.Core.ExtensionPoints.Workbench.MainMenu.ViewMenu, typeof(IMenuItem))]
class ViewMenuPinBallTable : AbstractMenuItem
{
[ImportingConstructor]
public ViewMenuPinBallTable(
[Import("/PinBall/PinBallTable")] IPinBallTable table)
public ViewMenuPinBallTable()
{
m_PinBallTable = table;
ID = table.ID;
Header = table.Title;
 
ID = "PinBallTable";
InsertRelativeToID = "ToolBars";
BeforeOrAfter = RelativeDirection.Before;
Header = Resources.Strings.Workbench_MainMenu_View_PinBallTable;
}
 
[Import("/Workbench/LayoutManager", typeof(ILayoutManager))]
[Import(SoapBox.Core.Services.Layout.LayoutManager, typeof(ILayoutManager))]
private Lazy<ILayoutManager> layoutManager { get; set; }
 
private readonly IPinBallTable m_PinBallTable = null;
[Import(CompositionPoints.PinBall.PinBallTable)]
private Lazy<PinBallTable> table { get; set; }
 
protected override void Run()
{
base.Run();
layoutManager.Value.ShowDocument(m_PinBallTable);
layoutManager.Value.ShowDocument(table.Value);
}
}
 
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Properties/AssemblyInfo.cs
51,5 → 51,5
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Workbench/WorkBenchView.xaml.cs
47,11 → 47,11
/// <summary>
/// Interaction logic for WorkBenchView.xaml
/// </summary>
[Export("/App/MainWindow", typeof(Window))]
[Export(CompositionPoints.Host.MainWindow, typeof(Window))]
public partial class WorkBenchView : Window
{
[ImportingConstructor]
public WorkBenchView([Import("/Workbench")] Workbench vm)
public WorkBenchView([Import(CompositionPoints.Workbench.ViewModel)] Workbench vm)
{
InitializeComponent();
 
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Workbench/Workbench.cs
37,46 → 37,123
using System.Collections.ObjectModel;
using System.Windows.Media.Imaging;
using System.IO;
using System.ComponentModel;
 
namespace SoapBox.Core.Workbench
{
[Export("/Workbench")]
public class Workbench
[Export(CompositionPoints.Workbench.ViewModel)]
public class Workbench : AbstractViewModel, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public Workbench(
[Import("/Services/LoggingService", typeof(ILoggingService))] ILoggingService l,
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/MainMenu", typeof(IMenuItem))] IEnumerable<IMenuItem> menu,
[ImportMany("/Workbench/ToolBars", typeof(IToolBar))] IEnumerable<IToolBar> toolBars,
[ImportMany("/Workbench/StatusBar", typeof(IStatusBarItem))] IEnumerable<IStatusBarItem> statusBar,
[Import("/Workbench/LayoutManager", typeof(ILayoutManager))] ILayoutManager layoutManager,
[ImportMany("/Workbench/Pads", typeof(IPad))] IEnumerable<IPad> pads,
[ImportMany("/Workbench/Documents", typeof(IDocument))] IEnumerable<IDocument> documents)
[Import(Services.Logging.LoggingService, typeof(ILoggingService))]
private ILoggingService logger { get; set; }
 
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[Import(Services.Layout.LayoutManager, typeof(ILayoutManager))]
public ILayoutManager LayoutManager { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.MainMenu.Self, typeof(IMenuItem), AllowRecomposition = true)]
private IEnumerable<IMenuItem> menu { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.ToolBars, typeof(IToolBar), AllowRecomposition = true)]
private IEnumerable<IToolBar> toolBars { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.StatusBar, typeof(IStatusBarItem), AllowRecomposition=true)]
private IEnumerable<IStatusBarItem> statusBar { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.Pads, typeof(IPad), AllowRecomposition = true)]
private IEnumerable<Lazy<IPad,IPadMeta>> pads { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.Documents, typeof(IDocument), AllowRecomposition = true)]
private IEnumerable<Lazy<IDocument,IDocumentMeta>> documents { get; set; }
 
public void OnImportsSatisfied()
{
logger = l;
 
// when this is called, all imports that could be satisfied have been satisfied.
MainMenu = extensionService.Sort(menu);
StatusBar = extensionService.Sort(statusBar);
ToolBars = extensionService.Sort(toolBars);
LayoutManager.Loaded -= LayoutManager_Loaded; // in case this is a recompose
LayoutManager.Loaded += new EventHandler(LayoutManager_Loaded);
}
 
LayoutManager = layoutManager;
LayoutManager.Loaded += delegate(object sender, EventArgs e)
void LayoutManager_Loaded(object sender, EventArgs e)
{
logger.Info("Restoring layout...");
LayoutManager.RestoreLayout(pads, documents);
logger.Info("Layout restored.");
}
 
#region "MainMenu"
 
public IEnumerable<IMenuItem> MainMenu
{
get
{
return m_MainMenu;
}
private set
{
if (m_MainMenu != value)
{
logger.Info("Restoring layout...");
LayoutManager.RestoreLayout(pads, documents);
logger.Info("Layout restored.");
};
m_MainMenu = value;
NotifyPropertyChanged(m_MainMenuArgs);
}
}
}
private IEnumerable<IMenuItem> m_MainMenu = null;
static readonly PropertyChangedEventArgs m_MainMenuArgs =
NotifyPropertyChangedHelper.CreateArgs<Workbench>(o => o.MainMenu);
 
private ILoggingService logger { get; set; }
#endregion
 
public IEnumerable<IMenuItem> MainMenu { get; set; }
public IEnumerable<IStatusBarItem> StatusBar { get; set; }
public IEnumerable<IToolBar> ToolBars { get; set; }
#region "StatusBar"
 
public ILayoutManager LayoutManager { get; set; }
public IEnumerable<IStatusBarItem> StatusBar
{
get
{
return m_StatusBar;
}
private set
{
if (m_StatusBar != value)
{
m_StatusBar = value;
NotifyPropertyChanged(m_StatusBarArgs);
}
}
}
private IEnumerable<IStatusBarItem> m_StatusBar = null;
static readonly PropertyChangedEventArgs m_StatusBarArgs =
NotifyPropertyChangedHelper.CreateArgs<Workbench>(o => o.StatusBar);
 
#endregion
 
#region "ToolBars"
 
public IEnumerable<IToolBar> ToolBars
{
get
{
return m_ToolBars;
}
set
{
if (m_ToolBars != value)
{
m_ToolBars = value;
NotifyPropertyChanged(m_ToolBarsArgs);
}
}
}
private IEnumerable<IToolBar> m_ToolBars = null;
static readonly PropertyChangedEventArgs m_ToolBarsArgs =
NotifyPropertyChangedHelper.CreateArgs<Workbench>(o => o.ToolBars);
 
#endregion
 
public void OnClosing(object sender, EventArgs e)
{
logger.Info("Saving layout...");
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Workbench/MainMenu/ToolsMenu.cs
38,19 → 38,26
 
namespace SoapBox.Core.Workbench
{
[Export("/Workbench/MainMenu", typeof(IMenuItem))]
class ToolsMenu : AbstractMenuItem
[Export(ExtensionPoints.Workbench.MainMenu.Self, typeof(IMenuItem))]
class ToolsMenu : AbstractMenuItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public ToolsMenu(
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/MainMenu/ToolsMenu", typeof(IMenuItem))] IEnumerable<IMenuItem> menu)
public ToolsMenu()
{
ID = "Tools";
Header = Resources.Strings.Workbench_MainMenu_Tools;
Items = extensionService.Sort(menu);
InsertRelativeToID = "View";
BeforeOrAfter = RelativeDirection.After;
}
 
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.MainMenu.ToolsMenu, typeof(IMenuItem), AllowRecomposition=true)]
private IEnumerable<IMenuItem> menu { get; set; }
 
public void OnImportsSatisfied()
{
Items = extensionService.Sort(menu);
}
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Workbench/MainMenu/EditMenu.cs
38,19 → 38,26
 
namespace SoapBox.Core.Workbench
{
[Export("/Workbench/MainMenu", typeof(IMenuItem))]
class EditMenu : AbstractMenuItem
[Export(ExtensionPoints.Workbench.MainMenu.Self, typeof(IMenuItem))]
class EditMenu : AbstractMenuItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public EditMenu(
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/MainMenu/EditMenu", typeof(IMenuItem))] IEnumerable<IMenuItem> menu)
public EditMenu()
{
ID = "Edit";
Header = Resources.Strings.Workbench_MainMenu_Edit;
Items = extensionService.Sort(menu);
InsertRelativeToID = "File";
BeforeOrAfter = RelativeDirection.After;
}
 
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.MainMenu.EditMenu, typeof(IMenuItem), AllowRecomposition=true)]
private IEnumerable<IMenuItem> menu { get; set; }
 
public void OnImportsSatisfied()
{
Items = extensionService.Sort(menu);
}
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Workbench/MainMenu/WindowMenu.cs
38,19 → 38,26
 
namespace SoapBox.Core.Workbench
{
[Export("/Workbench/MainMenu", typeof(IMenuItem))]
class WindowMenu : AbstractMenuItem
[Export(ExtensionPoints.Workbench.MainMenu.Self, typeof(IMenuItem))]
class WindowMenu : AbstractMenuItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public WindowMenu(
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/MainMenu/WindowMenu", typeof(IMenuItem))] IEnumerable<IMenuItem> menu)
public WindowMenu()
{
ID = "Window";
Header = Resources.Strings.Workbench_MainMenu_Window;
Items = extensionService.Sort(menu);
InsertRelativeToID = "Tools";
BeforeOrAfter = RelativeDirection.After;
}
 
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.MainMenu.WindowMenu, typeof(IMenuItem), AllowRecomposition=true)]
private IEnumerable<IMenuItem> menu { get; set; }
 
public void OnImportsSatisfied()
{
Items = extensionService.Sort(menu);
}
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Workbench/MainMenu/HelpMenu.cs
39,19 → 39,26
 
namespace SoapBox.Core.Workbench
{
[Export("/Workbench/MainMenu", typeof(IMenuItem))]
class HelpMenu : AbstractMenuItem
[Export(ExtensionPoints.Workbench.MainMenu.Self, typeof(IMenuItem))]
class HelpMenu : AbstractMenuItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public HelpMenu(
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/MainMenu/HelpMenu", typeof(IMenuItem))] IEnumerable<IMenuItem> menu)
public HelpMenu()
{
ID = "Help";
Header = Resources.Strings.Workbench_MainMenu_Help;
Items = extensionService.Sort(menu);
InsertRelativeToID = "Window";
BeforeOrAfter = RelativeDirection.After;
}
 
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.MainMenu.HelpMenu, typeof(IMenuItem), AllowRecomposition=true)]
private IEnumerable<IMenuItem> menu { get; set; }
 
public void OnImportsSatisfied()
{
Items = extensionService.Sort(menu);
}
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Workbench/MainMenu/ViewMenu.cs
38,20 → 38,27
 
namespace SoapBox.Core.Workbench
{
[Export("/Workbench/MainMenu", typeof(IMenuItem))]
class ViewMenu : AbstractMenuItem
[Export(ExtensionPoints.Workbench.MainMenu.Self, typeof(IMenuItem))]
class ViewMenu : AbstractMenuItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public ViewMenu(
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/MainMenu/ViewMenu", typeof(IMenuItem))] IEnumerable<IMenuItem> menu)
public ViewMenu()
{
ID = "View";
Header = Resources.Strings.Workbench_MainMenu_View;
Items = extensionService.Sort(menu);
InsertRelativeToID = "Edit";
BeforeOrAfter = RelativeDirection.After;
}
 
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.MainMenu.ViewMenu, typeof(IMenuItem), AllowRecomposition=true)]
private IEnumerable<IMenuItem> menu { get; set; }
 
public void OnImportsSatisfied()
{
Items = extensionService.Sort(menu);
}
}
 
/// <summary>
85,17 → 92,23
}
}
 
[Export("/Workbench/MainMenu/ViewMenu", typeof(IMenuItem))]
class ViewMenuToolBars : AbstractMenuItem
[Export(ExtensionPoints.Workbench.MainMenu.ViewMenu, typeof(IMenuItem))]
class ViewMenuToolBars : AbstractMenuItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public ViewMenuToolBars(
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/ToolBars", typeof(IToolBar))] IEnumerable<IToolBar> toolBars)
public ViewMenuToolBars()
{
ID = "ToolBars";
Header = Resources.Strings.Workbench_MainMenu_View_ToolBars;
}
 
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.ToolBars, typeof(IToolBar), AllowRecomposition=true)]
private IEnumerable<IToolBar> toolBars { get; set; }
 
public void OnImportsSatisfied()
{
// have to convert the ToolBars into MenuItems
IList<IToolBar> sortedToolBars = extensionService.Sort(toolBars);
List<IMenuItem> toolBarMenuItems = new List<IMenuItem>();
105,7 → 118,6
}
Items = extensionService.Sort(toolBarMenuItems);
}
 
}
 
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Workbench/Workbench/MainMenu/FileMenu.cs
42,22 → 42,28
 
namespace SoapBox.Core.Workbench
{
[Export("/Workbench/MainMenu", typeof(IMenuItem))]
class FileMenu : AbstractMenuItem
[Export(ExtensionPoints.Workbench.MainMenu.Self, typeof(IMenuItem))]
class FileMenu : AbstractMenuItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public FileMenu(
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/MainMenu/FileMenu", typeof(IMenuItem))] IEnumerable<IMenuItem> menu
)
public FileMenu()
{
ID = "File";
Header = Resources.Strings.Workbench_MainMenu_File;
}
 
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.Workbench.MainMenu.FileMenu, typeof(IMenuItem), AllowRecomposition=true)]
private IEnumerable<IMenuItem> menu { get; set; }
 
public void OnImportsSatisfied()
{
Items = extensionService.Sort(menu);
}
}
 
[Export("/Workbench/MainMenu/FileMenu", typeof(IMenuItem))]
[Export(ExtensionPoints.Workbench.MainMenu.FileMenu, typeof(IMenuItem))]
class FileMenuExit : AbstractMenuItem
{
public FileMenuExit()
68,7 → 74,10
SetIconFromBitmap(Resources.Images.Workbench_Command_Exit);
}
 
[Import("/App/MainWindow")]
// This has to be a Lazy import because we're instantiated
// when the Workbench itself is instantiated, so the Workbench
// isn't finished being constructed yet.
[Import(CompositionPoints.Host.MainWindow, typeof(Window))]
private Lazy<Window> mainWindowExport { get; set; }
 
protected override void Run()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Arena/Arena/AbstractArenaView.xaml.cs
36,10 → 36,11
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using SoapBox.Core;
 
namespace SoapBox.Core.Arena
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractArenaView : ResourceDictionary
{
public AbstractArenaView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Arena/Arena/ArenaBodies/AbstractArenaBodyView.xaml.cs
33,10 → 33,11
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Shapes;
using SoapBox.Core;
 
namespace SoapBox.Core.Arena
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractArenaBodyView : ResourceDictionary
{
public AbstractArenaBodyView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Arena/Properties/AssemblyInfo.cs
32,8 → 32,8
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
 
 
// For Unit Testing
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Logging/Services/LoggingService/NLogLoggingService.cs
37,7 → 37,7
 
namespace SoapBox.Core
{
[Export("/Services/LoggingService", typeof(ILoggingService))]
[Export(Services.Logging.LoggingService, typeof(ILoggingService))]
class NLogLoggingService : ILoggingService
{
Logger log;
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Logging/Properties/AssemblyInfo.cs
32,5 → 32,5
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Options/Workbench/MainMenu/ToolsMenu.cs
42,24 → 42,22
/// <summary>
/// Adds the Options Dialog to the tools menu
/// </summary>
[Export("/Workbench/MainMenu/ToolsMenu", typeof(IMenuItem))]
[Export(ExtensionPoints.Workbench.MainMenu.ToolsMenu, typeof(IMenuItem))]
class ToolsMenuOptions : AbstractMenuItem
{
[ImportingConstructor]
public ToolsMenuOptions(
[Import("/Workbench/Tools/OptionsDialog", typeof(OptionsDialog))] OptionsDialog optionsDialog)
public ToolsMenuOptions()
{
ID = "Options";
Header = Resources.Strings.Workbench_MainMenu_Tools_Options;
SetIconFromBitmap(Resources.Images.Workbench_MainMenu_ToolsMenu_Options);
m_optionsDialog = optionsDialog;
}
 
private OptionsDialog m_optionsDialog = null;
[Import(CompositionPoints.Options.OptionsDialog, typeof(OptionsDialog))]
private OptionsDialog optionsDialog { get; set; }
 
protected override void Run()
{
m_optionsDialog.ShowDialog();
optionsDialog.ShowDialog();
}
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Options/Options/OptionsDialog.cs
42,17 → 42,11
/// Inheriting from AbstractOptionsItem is just a hack
/// because it makes it easy to set the Items property.
/// </summary>
[Export("/Workbench/Tools/OptionsDialog", typeof(OptionsDialog))]
class OptionsDialog : AbstractOptionsItem
[Export(CompositionPoints.Options.OptionsDialog, typeof(OptionsDialog))]
class OptionsDialog : AbstractOptionsItem, IPartImportsSatisfiedNotification
{
[ImportingConstructor]
public OptionsDialog(
[Import("/Services/LoggingService", typeof(ILoggingService))] ILoggingService l,
[Import("/Services/ExtensionService")] IExtensionService extensionService,
[ImportMany("/Workbench/Tools/OptionsDialog/OptionsItems", typeof(IOptionsItem))] IEnumerable<IOptionsItem> items)
public OptionsDialog()
{
logger = l;
Items = extensionService.Sort(items);
OptionChanged += new EventHandler(OptionsDialog_OptionChanged);
}
 
61,9 → 55,21
m_dirtyCondition.SetCondition(true);
}
 
[Import(Services.Logging.LoggingService, typeof(ILoggingService))]
private ILoggingService logger { get; set; }
 
[Import("/App/MainWindow")]
[Import(Services.Host.ExtensionService)]
private IExtensionService extensionService { get; set; }
 
[ImportMany(ExtensionPoints.Options.OptionsDialog.OptionsItems, typeof(IOptionsItem), AllowRecomposition=true)]
private IEnumerable<IOptionsItem> items { get; set; }
 
public void OnImportsSatisfied()
{
Items = extensionService.Sort(items);
}
 
[Import(CompositionPoints.Host.MainWindow)]
private Lazy<Window> mainWindowExport { get; set; }
 
/// <summary>
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Options/Properties/AssemblyInfo.cs
32,5 → 32,5
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Host/Properties/AssemblyInfo.cs
51,5 → 51,5
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Host/App.xaml.cs
46,14 → 46,14
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
public partial class App : Application, IPartImportsSatisfiedNotification
{
private CompositionContainer _container;
 
/// <summary>
/// Main WPF startup window for the application
/// </summary>
[Import("/App/MainWindow", typeof(Window))]
[Import(CompositionPoints.Host.MainWindow, typeof(Window))]
public new Window MainWindow
{
get { return base.MainWindow; }
65,7 → 65,7
/// all added to the application resources.
/// These get imported before the Views.
/// </summary>
[ImportMany("/App/Styles", typeof(ResourceDictionary))]
[ImportMany(ExtensionPoints.Host.Styles, typeof(ResourceDictionary), AllowRecomposition=true)]
private IEnumerable<ResourceDictionary> Styles { get; set; }
 
/// <summary>
74,26 → 74,26
/// In general these should be full of DataTemplates for
/// displaying ViewModel classes.
/// </summary>
[ImportMany("/App/ApplicationResources", typeof(ResourceDictionary))]
[ImportMany(ExtensionPoints.Host.Views, typeof(ResourceDictionary), AllowRecomposition=true)]
private IEnumerable<ResourceDictionary> Views { get; set; }
 
/// <summary>
/// Hosts a logging service
/// </summary>
[Import("/Services/LoggingService",typeof(ILoggingService))]
[Import(Services.Logging.LoggingService,typeof(ILoggingService))]
public ILoggingService logger { get; set; }
 
/// <summary>
/// This imports any commands that are supposed to run when
/// the application starts.
/// </summary>
[ImportMany("/App/StartupCommands", typeof(IExecutableCommand))]
[ImportMany(ExtensionPoints.Host.StartupCommands, typeof(IExecutableCommand), AllowRecomposition=true)]
private IEnumerable<IExecutableCommand> StartupCommands { get; set; }
 
/// <summary>
/// We need this to sort ordered extentions, like the startup commands
/// </summary>
[Import("/Services/ExtensionService")]
[Import(Services.Host.ExtensionService)]
private IExtensionService ExtensionService { get; set; }
 
protected override void OnStartup(StartupEventArgs e)
110,27 → 110,7
 
// Now we can use logger
logger.InfoWithFormat("Composition complete...({0} milliseconds)", stopWatch.ElapsedMilliseconds);
// Add the imported resource dictionaries
// to the application resources
foreach (ResourceDictionary r in Styles)
{
this.Resources.MergedDictionaries.Add(r);
}
foreach (ResourceDictionary r in Views)
{
this.Resources.MergedDictionaries.Add(r);
}
 
// Run all the startup commands
IList<IExecutableCommand> commands = ExtensionService.Sort(StartupCommands);
foreach (IExecutableCommand cmd in commands)
{
logger.Info("Running startup command " + cmd.ID + "...");
cmd.Run();
logger.Info("Startup command " + cmd.ID + " completed.");
}
 
logger.Info("Showing Main Window...");
MainWindow.Show();
}
157,7 → 137,6
{
var catalog = new AggregateCatalog();
catalog.Catalogs.Add(new DirectoryCatalog("."));
//catalog.Catalogs.Add(new AssemblyCatalog(System.Reflection.Assembly.GetExecutingAssembly()));
 
_container = new CompositionContainer(catalog);
 
172,5 → 151,39
}
return true;
}
 
private bool m_startupCommandsRun = false;
 
public void OnImportsSatisfied()
{
// Add the imported resource dictionaries
// to the application resources
this.Resources.MergedDictionaries.Clear(); // in case of recompose
logger.Info("Importing Styles...");
foreach (ResourceDictionary r in Styles)
{
this.Resources.MergedDictionaries.Add(r);
}
logger.Info("Importing Views...");
foreach (ResourceDictionary r in Views)
{
this.Resources.MergedDictionaries.Add(r);
}
 
if (!m_startupCommandsRun) // Don't run on recomposition
{
m_startupCommandsRun = true;
// Run all the startup commands
IList<IExecutableCommand> commands = ExtensionService.Sort(StartupCommands);
foreach (IExecutableCommand cmd in commands)
{
logger.Info("Running startup command " + cmd.ID + "...");
cmd.Run();
logger.Info("Startup command " + cmd.ID + " completed.");
}
}
}
 
 
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Layout/Properties/AssemblyInfo.cs
32,5 → 32,5
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Layout/Layout/LayoutManagerView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core.Layout
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class LayoutManagerView : ResourceDictionary
{
public LayoutManagerView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Layout/Layout/LayoutManager.cs
43,7 → 43,7
 
namespace SoapBox.Core.Layout
{
[Export("/Workbench/LayoutManager", typeof(ILayoutManager))]
[Export(Services.Layout.LayoutManager, typeof(ILayoutManager))]
public class LayoutManager : ILayoutManager
{
private readonly string PADS_SAVEFILE = Path.Combine(AppEnvironment.UserFileDirectory(), "PadsSave.txt");
240,6 → 240,9
List<string> padNamesList = new List<string>();
foreach (IPad pad in Pads)
{
// We have to save all the pad names that have ever been
// shown even if they're hidden now or else the layout
// manager won't remember where they are when shown again.
padNamesList.Add(pad.Name);
}
 
269,18 → 272,18
/// <param name="pads">A collection of all possible Pads</param>
/// <param name="docs">A collection of all possible Documents</param>
public void RestoreLayout(
IEnumerable<IPad> pads,
IEnumerable<IDocument> docs)
IEnumerable<Lazy<IPad,IPadMeta>> pads,
IEnumerable<Lazy<IDocument,IDocumentMeta>> docs)
{
if (File.Exists(PADS_SAVEFILE))
{
string padNames = File.ReadAllText(PADS_SAVEFILE);
List<string> padNamesList = padNames.Split(new char[] { ',' }).ToList();
foreach (IPad p in pads)
foreach (var p in pads)
{
if (padNamesList.Contains(p.Name))
if (padNamesList.Contains(p.Metadata.Name))
{
ShowPad(p);
ShowPad(p.Value);
}
}
}
289,11 → 292,11
{
string docNames = File.ReadAllText(DOCS_SAVEFILE);
List<string> docNamesList = docNames.Split(new char[] { ',' }).ToList();
foreach (IDocument d in docs)
foreach (var d in docs)
{
if (docNamesList.Contains(d.Name))
if (docNamesList.Contains(d.Metadata.Name))
{
ShowDocument(d);
ShowDocument(d.Value);
}
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Properties/AssemblyInfo.cs
32,5 → 32,5
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2009.11.04.0")]
[assembly: AssemblyFileVersion("2009.11.04.0")]
[assembly: AssemblyVersion("2009.11.11.0")]
[assembly: AssemblyFileVersion("2009.11.11.0")]
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/ExtensionPoints.cs
New file
0,0 → 1,70
#region "SoapBox.Core License"
/// <header module="SoapBox.Core">
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Core.
///
/// Commercial Usage
/// Licensees holding valid SoapBox Automation Commercial licenses may use
/// this file in accordance with the SoapBox Automation Commercial License
/// Agreement provided with the Software or, alternatively, in accordance
/// with the terms contained in a written agreement between you and
/// SoapBox Automation Inc.
///
/// GNU Lesser General Public License Usage
/// SoapBox Core is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Core is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Core. If not, see <http://www.gnu.org/licenses/>.
/// </header>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace SoapBox.Core.ExtensionPoints
{
public static class Host
{
public const string Styles = "ExtensionPoints.Host.Styles";
public const string Views = "ExtensionPoints.Host.Views";
public const string StartupCommands = "ExtensionPoints.Host.StartupCommands";
}
public static class Workbench
{
public const string ToolBars = "ExtensionPoints.Workbench.ToolBars";
public const string StatusBar = "ExtensionPoints.Workbench.StatusBar";
public const string Pads = "ExtensionPoints.Workbench.Pads";
public const string Documents = "ExtensionPoints.Workbench.Documents";
 
public static class MainMenu
{
public const string Self = "ExtensionPoints.Workbench.MainMenu";
public const string FileMenu = "ExtensionPoints.Workbench.MainMenu.FileMenu";
public const string EditMenu = "ExtensionPoints.Workbench.MainMenu.EditMenu";
public const string ViewMenu = "ExtensionPoints.Workbench.MainMenu.ViewMenu";
public const string ToolsMenu = "ExtensionPoints.Workbench.MainMenu.ToolsMenu";
public const string WindowMenu = "ExtensionPoints.Workbench.MainMenu.WindowMenu";
public const string HelpMenu = "ExtensionPoints.Workbench.MainMenu.HelpMenu";
}
}
 
public static class Options
{
public static class OptionsDialog
{
public const string OptionsItems = "ExtensionPoints.Options.OptionsDialog.OptionsItems";
}
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/SoapBox.Core.Contracts.csproj
55,11 → 55,13
</ItemGroup>
<ItemGroup>
<Compile Include="App\Startup\IExecutableCommand.cs" />
<Compile Include="CompositionPoints.cs" />
<Compile Include="Conditions\AbstractCondition.cs" />
<Compile Include="Conditions\AlwaysFalseCondition.cs" />
<Compile Include="Conditions\AlwaysTrueCondition.cs" />
<Compile Include="Conditions\ConcreteCondition.cs" />
<Compile Include="Conditions\ICondition.cs" />
<Compile Include="ExtensionPoints.cs" />
<Compile Include="Gui\Controls\AbstractButton.cs" />
<Compile Include="Gui\Controls\AbstractCommandControl.cs" />
<Compile Include="Gui\Controls\AbstractControl.cs" />
77,9 → 79,12
<Compile Include="Gui\Layout\AbstractDocument.cs" />
<Compile Include="Gui\Layout\AbstractPad.cs" />
<Compile Include="Gui\Layout\IDocument.cs" />
<Compile Include="Gui\Layout\IDocumentMeta.cs" />
<Compile Include="Gui\Layout\ILayoutItem.cs" />
<Compile Include="Gui\Layout\ILayoutItemMeta.cs" />
<Compile Include="Gui\Layout\ILayoutManager.cs" />
<Compile Include="Gui\Layout\IPad.cs" />
<Compile Include="Gui\Layout\IPadMeta.cs" />
<Compile Include="Gui\MenuItem\MenuItemVisibleCondition.cs" />
<Compile Include="Gui\Options\AbstractOptionsItem.cs" />
<Compile Include="Gui\Options\AbstractOptionsPad.cs" />
130,6 → 135,7
<Compile Include="Gui\ViewModel\IViewModel.cs" />
<Compile Include="Gui\ViewModel\NotifyPropertyChangedHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services.cs" />
<Compile Include="Services\ExtensionService\IExtensionService.cs" />
<Compile Include="Services\LoggingService\ILoggingService.cs" />
<Compile Include="Services\ExtensionService\AbstractExtension.cs" />
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Services/ExtensionService/ExtensionService.cs
39,15 → 39,10
/// <summary>
/// Utility methods and functions to work with IExtension objects.
/// </summary>
[Export(("/Services/ExtensionService"), typeof(IExtensionService))]
[Export((Services.Host.ExtensionService), typeof(IExtensionService))]
public class ExtensionService : IExtensionService
{
[ImportingConstructor]
public ExtensionService([Import("/Services/LoggingService", typeof(ILoggingService))] ILoggingService l)
{
logger = l;
}
 
[Import(Services.Logging.LoggingService, typeof(ILoggingService))]
private ILoggingService logger { get; set; }
 
/// <summary>
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/CompositionPoints.cs
New file
0,0 → 1,52
#region "SoapBox.Core License"
/// <header module="SoapBox.Core">
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Core.
///
/// Commercial Usage
/// Licensees holding valid SoapBox Automation Commercial licenses may use
/// this file in accordance with the SoapBox Automation Commercial License
/// Agreement provided with the Software or, alternatively, in accordance
/// with the terms contained in a written agreement between you and
/// SoapBox Automation Inc.
///
/// GNU Lesser General Public License Usage
/// SoapBox Core is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Core is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Core. If not, see <http://www.gnu.org/licenses/>.
/// </header>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace SoapBox.Core.CompositionPoints
{
public static class Host
{
public const string MainWindow = "CompositionPoints.Host.MainWindow";
}
 
public static class Workbench
{
public const string ViewModel = "CompositionPoints.Workbench";
}
 
public static class Options
{
public const string OptionsDialog = "CompositionPoints.Options.OptionsDialog";
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/Layout/IDocumentMeta.cs
New file
0,0 → 1,50
#region "SoapBox.Core License"
/// <header module="SoapBox.Core">
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Core.
///
/// Commercial Usage
/// Licensees holding valid SoapBox Automation Commercial licenses may use
/// this file in accordance with the SoapBox Automation Commercial License
/// Agreement provided with the Software or, alternatively, in accordance
/// with the terms contained in a written agreement between you and
/// SoapBox Automation Inc.
///
/// GNU Lesser General Public License Usage
/// SoapBox Core is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Core is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Core. If not, see <http://www.gnu.org/licenses/>.
/// </header>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
 
namespace SoapBox.Core
{
public interface IDocumentMeta : ILayoutItemMeta
{
}
 
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class DocumentAttribute : LayoutItemAttribute
{
public DocumentAttribute() : base(typeof(IDocument)) { }
}
 
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/Layout/ILayoutManager.cs
50,7 → 50,7
 
void SaveLayout();
void RestoreLayout(
IEnumerable<IPad> pads,
IEnumerable<IDocument> docs);
IEnumerable<Lazy<IPad,IPadMeta>> pads,
IEnumerable<Lazy<IDocument,IDocumentMeta>> docs);
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/Layout/IPadMeta.cs
New file
0,0 → 1,50
#region "SoapBox.Core License"
/// <header module="SoapBox.Core">
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Core.
///
/// Commercial Usage
/// Licensees holding valid SoapBox Automation Commercial licenses may use
/// this file in accordance with the SoapBox Automation Commercial License
/// Agreement provided with the Software or, alternatively, in accordance
/// with the terms contained in a written agreement between you and
/// SoapBox Automation Inc.
///
/// GNU Lesser General Public License Usage
/// SoapBox Core is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Core is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Core. If not, see <http://www.gnu.org/licenses/>.
/// </header>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
 
namespace SoapBox.Core
{
public interface IPadMeta : ILayoutItemMeta
{
}
 
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class PadAttribute : LayoutItemAttribute
{
public PadAttribute() : base(typeof(IPad)) { }
}
 
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/Layout/ILayoutItemMeta.cs
New file
0,0 → 1,52
#region "SoapBox.Core License"
/// <header module="SoapBox.Core">
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Core.
///
/// Commercial Usage
/// Licensees holding valid SoapBox Automation Commercial licenses may use
/// this file in accordance with the SoapBox Automation Commercial License
/// Agreement provided with the Software or, alternatively, in accordance
/// with the terms contained in a written agreement between you and
/// SoapBox Automation Inc.
///
/// GNU Lesser General Public License Usage
/// SoapBox Core is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Core is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Core. If not, see <http://www.gnu.org/licenses/>.
/// </header>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
 
namespace SoapBox.Core
{
public interface ILayoutItemMeta
{
string Name { get; }
}
 
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class LayoutItemAttribute : ExportAttribute
{
public LayoutItemAttribute() : base(typeof(ILayoutItem)) { }
public LayoutItemAttribute(Type contractType) : base(contractType) { }
public string Name { get; set; }
}
}
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/ToolBar/ToolBarItem/ToolBarToggleButton/AbstractToolBarToggleButtonView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractToolBarToggleButtonView : ResourceDictionary
{
public AbstractToolBarToggleButtonView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/ToolBar/ToolBarItem/ToolBarLabel/AbstractToolBarLabelView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractToolBarLabelView : ResourceDictionary
{
public AbstractToolBarLabelView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/ToolBar/ToolBarItem/ToolBarSeparator/AbstractToolBarSeparatorView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractToolBarSeparatorView : ResourceDictionary
{
public AbstractToolBarSeparatorView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/ToolBar/ToolBarItem/ToolBarRadioButton/AbstractToolBarRadioButtonView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractToolBarRadioButtonView : ResourceDictionary
{
public AbstractToolBarRadioButtonView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/ToolBar/ToolBarItem/ToolBarButton/AbstractToolBarButtonView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractToolBarButtonView : ResourceDictionary
{
public AbstractToolBarButtonView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/StatusBar/StatusBarRadioButton/AbstractStatusBarRadioButtonView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractStatusBarRadioButtonView : ResourceDictionary
{
public AbstractStatusBarRadioButtonView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/StatusBar/StatusBarButton/AbstractStatusBarButtonView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractStatusBarButtonView : ResourceDictionary
{
public AbstractStatusBarButtonView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/StatusBar/StatusBarToggleButton/AbstractStatusBarToggleButtonView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractStatusBarToggleButtonView : ResourceDictionary
{
public AbstractStatusBarToggleButtonView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/StatusBar/StatusBarLabel/AbstractStatusBarLabelView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractStatusBarLabelView : ResourceDictionary
{
public AbstractStatusBarLabelView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Gui/StatusBar/StatusBarSeparator/AbstractStatusBarSeparatorView.xaml.cs
35,7 → 35,7
 
namespace SoapBox.Core
{
[Export("/App/ApplicationResources", typeof(ResourceDictionary))]
[Export(ExtensionPoints.Host.Views, typeof(ResourceDictionary))]
public partial class AbstractStatusBarSeparatorView : ResourceDictionary
{
public AbstractStatusBarSeparatorView()
/trunk/SoapBox/SoapBox.Core/SoapBox.Core.Contracts/Services.cs
New file
0,0 → 1,52
#region "SoapBox.Core License"
/// <header module="SoapBox.Core">
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Core.
///
/// Commercial Usage
/// Licensees holding valid SoapBox Automation Commercial licenses may use
/// this file in accordance with the SoapBox Automation Commercial License
/// Agreement provided with the Software or, alternatively, in accordance
/// with the terms contained in a written agreement between you and
/// SoapBox Automation Inc.
///
/// GNU Lesser General Public License Usage
/// SoapBox Core is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Core is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Core. If not, see <http://www.gnu.org/licenses/>.
/// </header>
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace SoapBox.Core.Services
{
public static class Host
{
public const string ExtensionService = "Services.Host.ExtensionService";
}
 
public static class Logging
{
public const string LoggingService = "Services.Logging.LoggingService";
}
 
public static class Layout
{
public const string LayoutManager = "Services.Layout.LayoutManager";
}
}
/trunk/AvalonDock/AvalonDock/HelperFunc.cs
163,7 → 163,7
return null;
}
 
 
public static Point PointToScreenDPI(this Visual visual, Point pt)
{
Point resultPt = visual.PointToScreen(pt);
/trunk/AvalonDock/AvalonDock/FloatingWindow.cs
54,7 → 54,7
Window.WindowStyleProperty.OverrideMetadata(typeof(FloatingWindow), new FrameworkPropertyMetadata(WindowStyle.ToolWindow));
}
 
 
public FloatingWindow()
{
this.Loaded += new RoutedEventHandler(OnLoaded);
/trunk/AvalonDock/AvalonDock/Properties/AssemblyInfo.cs
6,7 → 6,6
using System.Globalization;
using System.Windows;
using System.Runtime.InteropServices;
using System.Security.Permissions;
 
#endregion
 
60,5 → 59,4
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.2.2681")]
 
[assembly: AssemblyVersion("1.2.2691")]
/trunk/AvalonDock/AvalonDock/DockableContent.cs
163,13 → 163,15
int childIndex,
double width,
double height,
AnchorStyle anchor)
AnchorStyle anchor,
DockableContentState state)
{
ContainerPane = containerPane;
ChildIndex = childIndex;
Width = Math.Max(width, 100.0);
Height = Math.Max(height, 100.0);
Anchor = anchor;
State = state;
}
 
public DockableContentStateAndPosition(
318,6 → 320,10
#endregion
 
 
 
 
 
 
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
564,10 → 570,10
int.Parse(contentElement.GetAttribute("ChildIndex")),
double.Parse(contentElement.GetAttribute("Width")),
double.Parse(contentElement.GetAttribute("Height")),
(AnchorStyle) Enum.Parse(typeof(AnchorStyle), contentElement.GetAttribute("Anchor"))
(AnchorStyle) Enum.Parse(typeof(AnchorStyle), contentElement.GetAttribute("Anchor")),
(DockableContentState) Enum.Parse(typeof(DockableContentState), contentElement.GetAttribute("State"))
);
//contentElement.HasAttribute("State") ? (DockableContentState)Enum.Parse(typeof(DockableContentState), contentElement.GetAttribute("State") );
 
}
}
#endregion
/trunk/AvalonDock/AvalonDock/DockingManager.cs
43,6 → 43,7
using System.Linq;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.ObjectModel;
 
namespace AvalonDock
{
401,14 → 402,31
 
void DocumentsSourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Reset)
{
DocumentContent[] docs = this.Documents;
if (e.Action == NotifyCollectionChangedAction.Reset)
{
DocumentContent[] docs = this.Documents;
ObservableCollection<DocumentContent> documentsToClose = new ObservableCollection<DocumentContent>();
 
foreach (DocumentContent doc in docs)
doc.Close();
}
foreach (DocumentContent doc in docs)
{
if (doc.Parent is DocumentPane)
{
if ((doc.Parent as DocumentPane).IsMainDocumentPane == false)
{
documentsToClose.Add(doc);
}
}
}
 
foreach (DocumentContent doc in documentsToClose)
{
doc.InternalClose();
}
 
foreach (DocumentContent doc in docs)
doc.InternalClose();
}
 
if (MainDocumentPane == null)
return;
 
459,16 → 477,16
{
if (child is DocumentPane)
return child as DocumentPane;
if (child is DockablePane)
{
DocumentPane doc = new DocumentPane();
DockablePane dockablePane = child as DockablePane;
while (dockablePane.Items.Count > 0)
{
doc.Items.Add((dockablePane.Items[0] as DockableContent).DetachFromContainerPane());
}
return doc;
}
//if (child is DockablePane)
//{
// DocumentPane doc = new DocumentPane();
// DockablePane dockablePane = child as DockablePane;
// while (dockablePane.Items.Count > 0)
// {
// doc.Items.Add((dockablePane.Items[0] as DockableContent).DetachFromContainerPane());
// }
// return doc;
//}
if (child is ResizingPanel)
{
DocumentPane foundDocPane = GetMainDocumentPane(child as ResizingPanel);
1968,20 → 1986,44
else if (desideredState == DockableContentState.DockableWindow ||
desideredState == DockableContentState.FloatingWindow)
{
DockablePane newHostpane = new DockablePane();
newHostpane.Items.Add(content);
content.SetStateToDock();
DockablePane newHostpane = null;
FloatingDockablePane prevHostpane = null;
if (content.SavedStateAndPosition != null && content.SavedStateAndPosition.ContainerPane != null && content.SavedStateAndPosition.ContainerPane is FloatingDockablePane)
{
prevHostpane = content.SavedStateAndPosition.ContainerPane as FloatingDockablePane;
if (!prevHostpane.Items.Contains(content))
prevHostpane.Items.Add(content);
}
else
{
newHostpane = new DockablePane();
newHostpane.Items.Add(content);
}
 
//ResizingPanel.SetResizeWidth(newHostpane, 200);
//ResizingPanel.SetResizeWidth(newHostpane, 500);
content.SetStateToDock();
 
DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this, newHostpane);
floatingWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
floatingWindow.Width = 200;
floatingWindow.Height = 500;
floatingWindow.Owner = Window.GetWindow(this);
RegisterFloatingWindow(floatingWindow);
floatingWindow.Show();
if (prevHostpane != null)
{
DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this, content);
floatingWindow.WindowStartupLocation = WindowStartupLocation.Manual;
floatingWindow.Top = prevHostpane.FloatingWindow.Top;
floatingWindow.Left = prevHostpane.FloatingWindow.Left;
floatingWindow.Width = prevHostpane.FloatingWindow.Width;
floatingWindow.Height = prevHostpane.FloatingWindow.Height;
floatingWindow.Owner = Window.GetWindow(this);
RegisterFloatingWindow(floatingWindow);
floatingWindow.Show();
}
else if (newHostpane != null)
{
DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this, newHostpane);
floatingWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
floatingWindow.Width = 200;
floatingWindow.Height = 500;
floatingWindow.Owner = Window.GetWindow(this);
RegisterFloatingWindow(floatingWindow);
floatingWindow.Show();
}
 
}
else if (desideredState == DockableContentState.Document)