Permalink
Browse files

Scal update, added ability to open a file from an argument, fix of ti…

…tle not being updated
  • Loading branch information...
1 parent 7eb4709 commit 042cb7d7edede49e490a33657e03cea3d95edae2 @flq committed Mar 5, 2012
@@ -38,8 +38,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="DynamicXaml">
- <HintPath>..\packages\DynamicXaml.0.6.3.0\lib\net40-Client\DynamicXaml.dll</HintPath>
+ <Reference Include="DynamicXaml, Version=0.6.5.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\DynamicXaml.0.6.5.0\lib\net40-Client\DynamicXaml.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="DynamicXaml" version="0.6.3.0" />
+ <package id="DynamicXaml" version="0.6.5.0" />
</packages>
@@ -18,7 +18,8 @@ public AppConfiguration()
.HandleTheseMessagesAsynchronously(msg => msg.Name.EndsWith("TaskMsg"))
.HandleTheseMessagesOnDispatcher(msg => msg.Name.EndsWith("UiMsg"))
.TypesBeingAMessageHub(t => t.CanBeCastTo<ISaga>())
- .TypesSubscribedToMessaging(t => t.CanBeCastTo<AbstractViewModel>());
+ .TypesSubscribedToMessaging(t => t.CanBeCastTo<AbstractViewModel>())
+ .TypesSubscribedToMessaging(t => t.Name.EndsWith("ViewModel"));
UnhandledExceptionsPassedTo<HandleExceptionOccurredMessages.UnhandledExceptionHandler>();
@@ -56,9 +56,9 @@ private void IncludeModification(string newValue)
}
public static readonly DependencyProperty FocusCommandsProperty =
- DependencyProperty.Register("FocusCommands", typeof(IObservable<IRefocusEditor>), typeof(MarkdownEditor), new PropertyMetadata(HandleFocusCommandsChanged));
+ DependencyProperty.Register("RefocusStream", typeof(IObservable<IRefocusEditor>), typeof(MarkdownEditor), new PropertyMetadata(HandleFocusCommandsChanged));
- public IObservable<IRefocusEditor> FocusCommands
+ public IObservable<IRefocusEditor> RefocusStream
{
get { return (IObservable<IRefocusEditor>)GetValue(FocusCommandsProperty); }
set { SetValue(FocusCommandsProperty, value); }
@@ -74,9 +74,9 @@ private static void HandleFocusCommandsChanged(DependencyObject d, DependencyPro
}
public static readonly DependencyProperty TextAppendCommandsProperty =
- DependencyProperty.Register("TextAppendCommands", typeof(IObservable<AppendTextUiMsg>), typeof(MarkdownEditor), new PropertyMetadata(HandleTextAppendCommandsChanged));
+ DependencyProperty.Register("TextAppendStream", typeof(IObservable<AppendTextUiMsg>), typeof(MarkdownEditor), new PropertyMetadata(HandleTextAppendCommandsChanged));
- public IObservable<AppendTextUiMsg> TextAppendCommands
+ public IObservable<AppendTextUiMsg> TextAppendStream
{
get { return (IObservable<AppendTextUiMsg>)GetValue(FocusCommandsProperty); }
set { SetValue(FocusCommandsProperty, value); }
@@ -25,8 +25,8 @@
<Editor:MarkdownEditor
x:Name="MarkdownText"
CurrentSelection="{Binding CurrentSelection, Mode=TwoWay}"
- FocusCommands="{Binding RefocusEditorStream, Mode=OneWay}"
- TextAppendCommands="{Binding TextAppendStream, Mode=OneWay}"
+ RefocusStream="{Binding RefocusEditorStream, Mode=OneWay}"
+ TextAppendStream="{Binding TextAppendStream, Mode=OneWay}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
</Grid>
@@ -2,10 +2,12 @@
using System.IO;
using MemBus;
using Microsoft.Win32;
+using Scal.Services;
using Thawmadoce.Editor;
using Thawmadoce.Extensibility;
using Thawmadoce.Frame.Messaging;
using Thawmadoce.Settings;
+using System.Linq;
namespace Thawmadoce.MainApp
{
@@ -15,16 +17,18 @@ public class FileOpsSaga : ISaga
private readonly IPublisher _publisher;
private readonly ISettings _settings;
+ private readonly ProgramArguments _args;
private readonly FileSaving _saveFile = new FileSaving();
private string _lastCapturedMarkdown;
private bool _sendingNewContentMyself;
- public FileOpsSaga(IPublisher publisher, ISettings settings)
+ public FileOpsSaga(IPublisher publisher, ISettings settings, ProgramArguments args)
{
_publisher = publisher;
_settings = settings;
+ _args = args;
}
public void Handle(NewContentForEditorUiMsg msg)
@@ -36,10 +40,19 @@ public void Handle(NewContentForEditorUiMsg msg)
public void Handle(UiSystemReadyUiMsg msg)
{
- var s = _settings.Get<string>("Core.TmpText");
- if (s != null)
- _lastCapturedMarkdown = s;
- _publisher.Publish(new NewContentForEditorUiMsg(_lastCapturedMarkdown));
+ var file = _args.FirstOrDefault();
+
+ if (file != null && File.Exists(file))
+ {
+ LoadContentsAndNotifySystems(file);
+ }
+ else
+ {
+ var s = _settings.Get<string>("Core.TmpText");
+ if (s != null)
+ _lastCapturedMarkdown = s;
+ _publisher.Publish(new NewContentForEditorUiMsg(_lastCapturedMarkdown));
+ }
}
public void Handle(OpenFileUiMsg msg)
@@ -77,10 +77,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Caliburn.Micro">
- <HintPath>..\packages\Scal.0.5.3.0\lib\net40\Caliburn.Micro.dll</HintPath>
+ <HintPath>..\packages\Scal.0.5.4.0\lib\net40\Caliburn.Micro.dll</HintPath>
</Reference>
<Reference Include="DynamicXaml">
- <HintPath>..\packages\DynamicXaml.0.6.3.0\lib\net40-Client\DynamicXaml.dll</HintPath>
+ <HintPath>..\packages\DynamicXaml.0.6.5.0\lib\net40-Client\DynamicXaml.dll</HintPath>
</Reference>
<Reference Include="MarkdownSharp">
<HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath>
@@ -92,7 +92,7 @@
<HintPath>..\packages\Newtonsoft.Json.4.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Scal">
- <HintPath>..\packages\Scal.0.5.3.0\lib\net40\Scal.dll</HintPath>
+ <HintPath>..\packages\Scal.0.5.4.0\lib\net40\Scal.dll</HintPath>
</Reference>
<Reference Include="StructureMap">
<HintPath>..\packages\structuremap.2.6.3\lib\StructureMap.dll</HintPath>
@@ -106,7 +106,7 @@
</Reference>
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Scal.0.5.3.0\lib\net40\System.Windows.Interactivity.dll</HintPath>
+ <HintPath>..\packages\Scal.0.5.4.0\lib\net40\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="DynamicXaml" version="0.6.3.0" />
+ <package id="DynamicXaml" version="0.6.5.0" />
<package id="MarkdownSharp" version="1.13.0.0" />
<package id="MemBus" version="1.4.2" />
<package id="Newtonsoft.Json" version="4.0.3" />
<package id="Rx-Main" version="1.0.11226" />
- <package id="Scal" version="0.5.3.0" />
+ <package id="Scal" version="0.5.4.0" />
<package id="structuremap" version="2.6.3" />
</packages>

0 comments on commit 042cb7d

Please sign in to comment.