Permalink
Browse files

Initial Jounce Build - 0.9

  • Loading branch information...
JeremyLikness committed Oct 4, 2010
0 parents commit 8e4afce4c7d1572f771f05e0b8f4b767907859e6
Showing with 5,195 additions and 0 deletions.
  1. +34 −0 Jounce.Core/Application/IDeploymentService.cs
  2. +41 −0 Jounce.Core/Application/ILogger.cs
  3. +13 −0 Jounce.Core/Application/IModuleInitializer.cs
  4. +14 −0 Jounce.Core/Application/LogSeverity.cs
  5. +34 −0 Jounce.Core/Command/IActionCommand.cs
  6. +17 −0 Jounce.Core/Constants.cs
  7. +15 −0 Jounce.Core/Event/EntityCommand.cs
  8. +72 −0 Jounce.Core/Event/EntityEvent.cs
  9. +38 −0 Jounce.Core/Event/IEventAggregator.cs
  10. +11 −0 Jounce.Core/Event/IEventSink.cs
  11. +13 −0 Jounce.Core/Event/UnhandledExceptionEvent.cs
  12. +126 −0 Jounce.Core/Jounce.Core.csproj
  13. +10 −0 Jounce.Core/Jounce.Core.csproj.vspscc
  14. +147 −0 Jounce.Core/MefDebugger.cs
  15. +89 −0 Jounce.Core/Model/BaseNotify.cs
  16. +37 −0 Jounce.Core/Properties/AssemblyInfo.cs
  17. +117 −0 Jounce.Core/Resources.Designer.cs
  18. +138 −0 Jounce.Core/Resources.resx
  19. +32 −0 Jounce.Core/Serialization/IJounceSerializer.cs
  20. +24 −0 Jounce.Core/View/ExportAsViewAttribute.cs
  21. +10 −0 Jounce.Core/View/IExportAsViewMetadata.cs
  22. +18 −0 Jounce.Core/View/ViewNavigatedArgs.cs
  23. +32 −0 Jounce.Core/View/ViewNavigationArgs.cs
  24. +32 −0 Jounce.Core/View/ViewXapRoute.cs
  25. +101 −0 Jounce.Core/ViewModel/BaseViewModel.cs
  26. +26 −0 Jounce.Core/ViewModel/ExportAsViewModelAttribute.cs
  27. +10 −0 Jounce.Core/ViewModel/IExportAsViewModelMetadata.cs
  28. +31 −0 Jounce.Core/ViewModel/IViewModel.cs
  29. +76 −0 Jounce.Core/ViewModel/IViewModelRouter.cs
  30. +39 −0 Jounce.Core/ViewModel/ViewModelRoute.cs
  31. +13 −0 Jounce.Core/Workflow/IWorkflow.cs
  32. +86 −0 Jounce.Framework/Command/ActionCommand.cs
  33. +19 −0 Jounce.Framework/Exceptions/DeploymentCatalogDownloadException.cs
  34. +123 −0 Jounce.Framework/Jounce.Framework.csproj
  35. +10 −0 Jounce.Framework/Jounce.Framework.csproj.vspscc
  36. +44 −0 Jounce.Framework/JounceHelper.cs
  37. +35 −0 Jounce.Framework/Properties/AssemblyInfo.cs
  38. +108 −0 Jounce.Framework/Resources.Designer.cs
  39. +135 −0 Jounce.Framework/Resources.resx
  40. +160 −0 Jounce.Framework/Services/ApplicationService.cs
  41. +94 −0 Jounce.Framework/Services/DefaultLogger.cs
  42. +142 −0 Jounce.Framework/Services/DeploymentService.cs
  43. +156 −0 Jounce.Framework/Services/EventAggregatorService.cs
  44. +49 −0 Jounce.Framework/Services/Serializer.cs
  45. +283 −0 Jounce.Framework/ViewModels/BaseEntityViewModel.cs
  46. +249 −0 Jounce.Framework/ViewModels/ViewModelRouter.cs
  47. +111 −0 Jounce.Framework/Views/ViewRouter.cs
  48. +47 −0 Jounce.Framework/Workflow/WorkflowAction.cs
  49. +42 −0 Jounce.Framework/Workflow/WorkflowBackgroundWorker.cs
  50. +85 −0 Jounce.Framework/Workflow/WorkflowController.cs
  51. +40 −0 Jounce.Framework/Workflow/WorkflowDelay.cs
  52. +74 −0 Jounce.Framework/Workflow/WorkflowEvent.cs
  53. +89 −0 Jounce.Framework/Workflow/WorkflowRoutedEvent.cs
  54. +35 −0 Jounce.Regions/Adapters/ContentRegion.cs
  55. +9 −0 Jounce.Regions/Adapters/IRegionAdapterMetadata.cs
  56. +44 −0 Jounce.Regions/Adapters/ItemsRegion.cs
  57. +148 −0 Jounce.Regions/Adapters/RegionAdapterBase.cs
  58. +18 −0 Jounce.Regions/Adapters/RegionAdapterForAttribute.cs
  59. +18 −0 Jounce.Regions/Core/Constants.cs
  60. +24 −0 Jounce.Regions/Core/ExportViewToRegionAttribute.cs
  61. +11 −0 Jounce.Regions/Core/IExportViewToRegionMetadata.cs
  62. +45 −0 Jounce.Regions/Core/IRegionAdapterBase.cs
  63. +37 −0 Jounce.Regions/Core/IRegionManager.cs
  64. +64 −0 Jounce.Regions/ExportAsRegion.cs
  65. +104 −0 Jounce.Regions/Jounce.Regions.csproj
  66. +10 −0 Jounce.Regions/Jounce.Regions.csproj.vspscc
  67. +35 −0 Jounce.Regions/Properties/AssemblyInfo.cs
  68. +246 −0 Jounce.Regions/RegionManager.cs
  69. +102 −0 Jounce.Web/Jounce.Web.csproj
  70. +10 −0 Jounce.Web/Jounce.Web.csproj.vspscc
  71. +75 −0 Jounce.Web/JounceTestPage.aspx
  72. +74 −0 Jounce.Web/JounceTestPage.html
  73. +35 −0 Jounce.Web/Properties/AssemblyInfo.cs
  74. +2 −0 Jounce.Web/Silverlight.js
  75. +30 −0 Jounce.Web/Web.Debug.config
  76. +31 −0 Jounce.Web/Web.Release.config
  77. +13 −0 Jounce.Web/Web.config
  78. +11 −0 Jounce/App.xaml
  79. +14 −0 Jounce/App.xaml.cs
  80. +126 −0 Jounce/Jounce.csproj
  81. +10 −0 Jounce/Jounce.csproj.vspscc
  82. +6 −0 Jounce/Properties/AppManifest.xml
  83. +35 −0 Jounce/Properties/AssemblyInfo.cs
  84. +33 −0 Jounce/ViewModels/WelcomeViewModel.cs
  85. +27 −0 Jounce/Views/Welcome.xaml
  86. +47 −0 Jounce/Views/Welcome.xaml.cs
  87. +65 −0 JounceSln.sln
  88. +10 −0 JounceSln.vssscc
@@ -0,0 +1,34 @@
+using System.ComponentModel.Composition.Hosting;
+using System;
+
+namespace Jounce.Core.Application
+{
+ /// <summary>
+ /// Request the xap
+ /// </summary>
+ public interface IDeploymentService
+ {
+ /// <summary>
+ /// Request a xap to be downloaded and integrated
+ /// </summary>
+ /// <param name="xapName">The name of the XAP to download</param>
+ void RequestXap(string xapName);
+
+ /// <summary>
+ /// Request a xap to be downloaded and integrated
+ /// </summary>
+ /// <param name="xapName">The name of the XAP to download</param>
+ /// <param name="xapLoaded">Callback when xap is loaded</param>
+ void RequestXap(string xapName, Action<Exception> xapLoaded);
+
+ /// <summary>
+ /// The main catalog
+ /// </summary>
+ AggregateCatalog Catalog { get; set; }
+
+ /// <summary>
+ /// Logger
+ /// </summary>
+ ILogger Logger { get; set; }
+ }
+}
@@ -0,0 +1,41 @@
+using System;
+
+namespace Jounce.Core.Application
+{
+ /// <summary>
+ /// Logger interface
+ /// </summary>
+ public interface ILogger
+ {
+ /// <summary>
+ /// Sets the severity
+ /// </summary>
+ /// <param name="minimumLevel">Minimum level</param>
+ void SetSeverity(LogSeverity minimumLevel);
+
+ /// <summary>
+ /// Log with a message
+ /// </summary>
+ /// <param name="severity">The severity</param>
+ /// <param name="source">The source</param>
+ /// <param name="message">The message</param>
+ void Log(LogSeverity severity, string source, string message);
+
+ /// <summary>
+ /// Log with an exception
+ /// </summary>
+ /// <param name="severity">The severity</param>
+ /// <param name="source">The source</param>
+ /// <param name="exception">The exception</param>
+ void Log(LogSeverity severity, string source, Exception exception);
+
+ /// <summary>
+ /// Log with formatting
+ /// </summary>
+ /// <param name="severity">The severity</param>
+ /// <param name="source">The source</param>
+ /// <param name="messageTemplate">The message template</param>
+ /// <param name="arguments">The lines to log</param>
+ void LogFormat(LogSeverity severity, string source, string messageTemplate, params object[] arguments);
+ }
+}
@@ -0,0 +1,13 @@
+namespace Jounce.Core.Application
+{
+ /// <summary>
+ /// Use the module initializer to run code when a new
+ /// module loads via the deployment catalog - simply
+ /// define and export it, and it will run
+ /// </summary>
+ public interface IModuleInitializer
+ {
+ bool Initialized { get; }
+ void Initialize();
+ }
+}
@@ -0,0 +1,14 @@
+namespace Jounce.Core.Application
+{
+ /// <summary>
+ /// Severity for the log message
+ /// </summary>
+ public enum LogSeverity : short
+ {
+ Verbose = 0,
+ Information = 1,
+ Warning = 2,
+ Error = 3,
+ Critical = 4
+ }
+}
@@ -0,0 +1,34 @@
+using System;
+using System.Windows.Input;
+
+namespace Jounce.Core.Command
+{
+ /// <summary>
+ /// Typed action command
+ /// </summary>
+ /// <typeparam name="T">The type to act against</typeparam>
+ public interface IActionCommand<T> : IActionCommand
+ {
+ /// <summary>
+ /// Override the action
+ /// </summary>
+ /// <param name="action"></param>
+ void OverrideAction(Action<T> action);
+ }
+
+ /// <summary>
+ /// Basic action command
+ /// </summary>
+ public interface IActionCommand : ICommand
+ {
+ /// <summary>
+ /// True if the original command has been overridden
+ /// </summary>
+ bool Overridden { get; set; }
+
+ /// <summary>
+ /// Raise the execute changed event
+ /// </summary>
+ void RaiseCanExecuteChanged();
+ }
+}
@@ -0,0 +1,17 @@
+namespace Jounce.Core
+{
+ /// <summary>
+ /// Application-wide constants
+ /// </summary>
+ public static class Constants
+ {
+ public const string BEGIN_BUSY = "Jounce.Begin.Busy";
+ public const string END_BUSY = "Jounce.End.Busy";
+
+ public const string SHELL = "Jounce.Shell";
+
+ public const string INIT_PARAM_LOGLEVEL = "Jounce.LogLevel";
+
+
+ }
+}
@@ -0,0 +1,15 @@
+namespace Jounce.Core.Event
+{
+ /// <summary>
+ /// Helps encapsulate actions taken against entities
+ /// </summary>
+ public enum EntityCommand : short
+ {
+ Add,
+ Update,
+ Delete,
+ Select,
+ Focus,
+ Query
+ }
+}
@@ -0,0 +1,72 @@
+using System;
+
+namespace Jounce.Core.Event
+{
+ /// <summary>
+ /// The entity event args
+ /// </summary>
+ public class EntityEvent
+ {
+ /// <summary>
+ /// Entity event args
+ /// </summary>
+ /// <param name="entity">The entity</param>
+ /// <param name="command">The command</param>
+ /// <returns>The args to wrap the command</returns>
+ public static EntityEvent CreateArgsFor(object entity, EntityCommand command)
+ {
+ return new EntityEvent
+ {
+ Command = command,
+ Entity = entity,
+ EntityType = entity.GetType()
+ };
+ }
+
+ /// <summary>
+ /// Typed create - allows for null args
+ /// </summary>
+ /// <typeparam name="T">The type</typeparam>
+ /// <param name="entity">The object</param>
+ /// <param name="command">The comman</param>
+ /// <returns>The args</returns>
+ public static EntityEvent CreateArgsFor<T>(object entity, EntityCommand command)
+ {
+ return new EntityEvent
+ {
+ Command = command,
+ Entity = entity,
+ EntityType = typeof(T)
+ };
+ }
+ /// <summary>
+ /// Type of the entity
+ /// </summary>
+ public Type EntityType { get; private set; }
+
+ /// <summary>
+ /// Command for the entity
+ /// </summary>
+ public EntityCommand Command { get; private set; }
+
+ /// <summary>
+ /// Entity itself
+ /// </summary>
+ public object Entity { get; private set; }
+
+ /// <summary>
+ /// cast it
+ /// </summary>
+ /// <typeparam name="T">The type</typeparam>
+ /// <returns>The cast entity</returns>
+ public T EntityForType<T>()
+ {
+ return Entity == null ? default(T) : (T) Entity;
+ }
+
+ public override string ToString()
+ {
+ return string.Format("EntityEvent : {0} : {1} : {2}", Command, EntityType.FullName, Entity);
+ }
+ }
+}
@@ -0,0 +1,38 @@
+namespace Jounce.Core.Event
+{
+ /// <summary>
+ /// Event aggregator for generic pub/sub messaging
+ /// </summary>
+ public interface IEventAggregator
+ {
+ /// <summary>
+ /// Publish an event
+ /// </summary>
+ /// <typeparam name="TEvent">The type of the event to publish</typeparam>
+ /// <param name="sampleEvent">The event data</param>
+ void Publish<TEvent>(TEvent sampleEvent);
+
+ /// <summary>
+ /// Get a handle to subscribe/listen to an event
+ /// </summary>
+ /// <typeparam name="TEvent">The event type to listen for</typeparam>
+ /// <param name="subscriber">The subscriber</param>
+ /// <returns>An observable handle to the event</returns>
+ void Subscribe<TEvent>(IEventSink<TEvent> subscriber);
+
+ /// <summary>
+ /// Get a handle to subscribe/listen to an event
+ /// </summary>
+ /// <typeparam name="TEvent">The event type to listen for</typeparam>
+ /// <param name="subscriber">The subscriber</param>
+ /// <returns>An observable handle to the event</returns>
+ void SubscribeOnDispatcher<TEvent>(IEventSink<TEvent> subscriber);
+
+ /// <summary>
+ /// Unsubscriber
+ /// </summary>
+ /// <typeparam name="TEvent"></typeparam>
+ /// <param name="unsubscriber"></param>
+ void Unsubscribe<TEvent>(IEventSink<TEvent> unsubscriber);
+ }
+}
@@ -0,0 +1,11 @@
+namespace Jounce.Core.Event
+{
+ /// <summary>
+ /// Event sink for published events
+ /// </summary>
+ /// <typeparam name="T">The type of the event</typeparam>
+ public interface IEventSink<in T>
+ {
+ void HandleEvent(T publishedEvent);
+ }
+}
@@ -0,0 +1,13 @@
+using System;
+
+namespace Jounce.Core.Event
+{
+ /// <summary>
+ /// An unhandled exception - emitted via the event aggregator to be processed as needed
+ /// </summary>
+ public class UnhandledExceptionEvent
+ {
+ public Exception UncaughtException { get; set; }
+ public bool Handled { get; set; }
+ }
+}
Oops, something went wrong.

0 comments on commit 8e4afce

Please sign in to comment.