diff --git a/scripts/StockTicker.build b/scripts/StockTicker.build
index 55cf52c..bfcf7a4 100644
--- a/scripts/StockTicker.build
+++ b/scripts/StockTicker.build
@@ -14,8 +14,8 @@
-
-
+
+
diff --git a/source/.nuget/NuGet.Config b/source/.nuget/NuGet.Config
new file mode 100644
index 0000000..67f8ea0
--- /dev/null
+++ b/source/.nuget/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/.nuget/NuGet.exe b/source/.nuget/NuGet.exe
new file mode 100644
index 0000000..4645f4b
Binary files /dev/null and b/source/.nuget/NuGet.exe differ
diff --git a/source/.nuget/NuGet.targets b/source/.nuget/NuGet.targets
new file mode 100644
index 0000000..d566b12
--- /dev/null
+++ b/source/.nuget/NuGet.targets
@@ -0,0 +1,151 @@
+
+
+
+ $(MSBuildProjectDirectory)\..\
+
+
+ false
+
+
+ false
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
+ $([System.IO.Path]::Combine($(ProjectDir), "packages.config"))
+
+
+
+
+ $(SolutionDir).nuget
+ packages.config
+
+
+
+
+ $(NuGetToolsPath)\nuget.exe
+ @(PackageSource)
+
+ "$(NuGetExePath)"
+ mono --runtime=v4.0.30319 $(NuGetExePath)
+
+ $(TargetDir.Trim('\\'))
+
+ -RequireConsent
+
+ $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "
+ $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols
+
+
+
+ RestorePackages;
+ $(BuildDependsOn);
+
+
+
+
+ $(BuildDependsOn);
+ BuildPackage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/.nuget/packages.config b/source/.nuget/packages.config
new file mode 100644
index 0000000..e661988
--- /dev/null
+++ b/source/.nuget/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/source/StockTicker.Specification/SpecificationBootstrapper.cs b/source/StockTicker.Specification/SpecificationBootstrapper.cs
index d5443cb..ccc04eb 100644
--- a/source/StockTicker.Specification/SpecificationBootstrapper.cs
+++ b/source/StockTicker.Specification/SpecificationBootstrapper.cs
@@ -35,11 +35,6 @@ public IKernel StandardKernel
}
}
- public void Start()
- {
- this.OnStartup(this, null);
- }
-
public void Stop()
{
this.OnExit(this, null);
diff --git a/source/StockTicker.Specification/StockTicker.Specification.csproj b/source/StockTicker.Specification/StockTicker.Specification.csproj
index f97b8a6..cd795dd 100644
--- a/source/StockTicker.Specification/StockTicker.Specification.csproj
+++ b/source/StockTicker.Specification/StockTicker.Specification.csproj
@@ -3,38 +3,41 @@
StockTicker
Specification
+ ..\
+ true
{FA85776B-D3B5-439D-A349-5CD1108CE8CB}
Library
-
- ..\packages\Caliburn.Micro\lib\net40\Caliburn.Micro.dll
-
-
+
False
- ..\packages\Machine.Specifications\lib\net40\Machine.Specifications.dll
+ ..\packages\Caliburn.Micro.1.5.1\lib\net40\Caliburn.Micro.dll
+
+
+ ..\packages\Machine.Specifications.0.5.12\lib\net40\Machine.Specifications.dll
- ..\packages\Machine.Specifications\lib\net40\Machine.Specifications.Clr4.dll
+ ..\packages\Machine.Specifications.0.5.12\lib\net40\Machine.Specifications.Clr4.dll
-
- ..\packages\Ninject\lib\net40\Ninject.dll
+
+ ..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll
+
+ False
+ ..\packages\Caliburn.Micro.1.5.1\lib\net40\System.Windows.Interactivity.dll
+
-
- ..\packages\thinktectureUIAnnotationsWPF\lib\Thinktecture.UIAnnotations.dll
-
@@ -57,4 +60,5 @@
+
\ No newline at end of file
diff --git a/source/StockTicker.Specification/packages.config b/source/StockTicker.Specification/packages.config
index 0311509..684e512 100644
--- a/source/StockTicker.Specification/packages.config
+++ b/source/StockTicker.Specification/packages.config
@@ -1,7 +1,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/source/StockTicker.Test/Actions/BusyIndicationViewModelTest.cs b/source/StockTicker.Test/Actions/BusyIndicationViewModelTest.cs
index 63a3fc2..29d25af 100644
--- a/source/StockTicker.Test/Actions/BusyIndicationViewModelTest.cs
+++ b/source/StockTicker.Test/Actions/BusyIndicationViewModelTest.cs
@@ -21,7 +21,6 @@ namespace StockTicker.Actions
using System;
using FluentAssertions;
- using FluentAssertions.EventMonitoring;
using Xunit;
public class BusyIndicationViewModelTest
diff --git a/source/StockTicker.Test/Actions/RescueResultDecoratorTest.cs b/source/StockTicker.Test/Actions/RescueResultDecoratorTest.cs
index 9ee6317..0564ec1 100644
--- a/source/StockTicker.Test/Actions/RescueResultDecoratorTest.cs
+++ b/source/StockTicker.Test/Actions/RescueResultDecoratorTest.cs
@@ -24,7 +24,6 @@ namespace StockTicker.Actions
using System.Linq;
using Caliburn.Micro;
using FluentAssertions;
- using FluentAssertions.EventMonitoring;
using Moq;
using StockTicker.TestHelpers;
using Xunit;
diff --git a/source/StockTicker.Test/Actions/ResultDecoraterBaseTest.cs b/source/StockTicker.Test/Actions/ResultDecoraterBaseTest.cs
index 3ebb748..fda8309 100644
--- a/source/StockTicker.Test/Actions/ResultDecoraterBaseTest.cs
+++ b/source/StockTicker.Test/Actions/ResultDecoraterBaseTest.cs
@@ -21,7 +21,6 @@ namespace StockTicker.Actions
using System;
using Caliburn.Micro;
using FluentAssertions;
- using FluentAssertions.EventMonitoring;
using Moq;
using StockTicker.TestHelpers;
diff --git a/source/StockTicker.Test/Actions/UseActionsActivationStrategyTest.cs b/source/StockTicker.Test/Actions/UseActionsActivationStrategyTest.cs
new file mode 100644
index 0000000..87c0a76
--- /dev/null
+++ b/source/StockTicker.Test/Actions/UseActionsActivationStrategyTest.cs
@@ -0,0 +1,63 @@
+//-------------------------------------------------------------------------------
+//
+// Copyright (c) 2012
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//-------------------------------------------------------------------------------
+
+namespace StockTicker.Actions
+{
+ using System;
+
+ using FluentAssertions;
+
+ using Moq;
+
+ using Ninject;
+ using Ninject.Activation.Strategies;
+
+ using Xunit;
+
+ public class UseActionsActivationStrategyTest
+ {
+ private readonly StandardKernel kernel;
+
+ public UseActionsActivationStrategyTest()
+ {
+ this.kernel = new StandardKernel();
+ this.kernel.Bind().ToSelf();
+ this.kernel.Bind().ToMethod(ctx => Mock.Of());
+
+ this.kernel.Components.Add();
+ }
+
+ private interface ITestObjectWithUseAction : IUseActions
+ {
+ }
+
+ [Fact]
+ public void WhenActivatedObjectUsesActions_ShouldAttachActionBuilder()
+ {
+ var useActions = this.kernel.Get();
+
+ useActions.Actions.Should().NotBeNull();
+ useActions.Actions().Should().NotBeNull();
+ }
+
+ private class TestObjectWithUseActions : ITestObjectWithUseAction
+ {
+ public Func Actions { internal get; set; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/StockTicker.Test/Authentication/AuthenticateTest.cs b/source/StockTicker.Test/Authentication/AuthenticateTest.cs
deleted file mode 100644
index 782b9b0..0000000
--- a/source/StockTicker.Test/Authentication/AuthenticateTest.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Dynamic;
-
- using Caliburn.Micro;
-
- using Moq;
-
- using StockTicker.TestHelpers;
- using Xunit;
-
- public class AuthenticateTest
- {
- private readonly Mock authenticationViewModel;
-
- private readonly Mock windowManager;
-
- private readonly Authenticate testee;
-
- public AuthenticateTest()
- {
- this.authenticationViewModel = new Mock();
- this.windowManager = new Mock();
-
- this.testee = new Authenticate(this.windowManager.Object, this.authenticationViewModel.Object);
- }
-
- [Fact]
- public void ShouldRaiseCompleted()
- {
- this.testee.ShouldRaiseCompleted();
- }
-
- [Fact]
- public void ShouldOpenAuthenticationWizard()
- {
- this.testee.Execute(new ActionExecutionContext());
-
- this.windowManager.Verify(w => w.ShowDialog(this.authenticationViewModel.Object, null, It.IsAny()));
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/Authentication/AuthenticationViewModelTest.cs b/source/StockTicker.Test/Authentication/AuthenticationViewModelTest.cs
deleted file mode 100644
index 35e1d24..0000000
--- a/source/StockTicker.Test/Authentication/AuthenticationViewModelTest.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Collections.Generic;
- using Caliburn.Micro;
- using FluentAssertions;
- using Moq;
-
- using StockTicker.Actions;
-
- using Xunit;
-
- public class AuthenticationViewModelTest
- {
- private readonly Mock authenticationStepFactory;
-
- private readonly AuthenticationViewModel testee;
-
- public AuthenticationViewModelTest()
- {
- this.authenticationStepFactory = new Mock();
-
- this.testee = new AuthenticationViewModel(this.authenticationStepFactory.Object, Mock.Of());
- }
-
- [Fact]
- public void ShouldInitializeWizardSteps()
- {
- var firstStep = new FakeStep();
- var secondStep = new FakeStep();
-
- this.authenticationStepFactory.SetupSequence(f => f.CreateSteps()).Returns(
- new List { firstStep, secondStep });
-
- this.testee.As().Activate();
-
- this.testee.Items.Should().HaveCount(2)
- .And.HaveElementAt(0, firstStep)
- .And.HaveElementAt(1, secondStep);
-
- this.testee.ActiveItem.Should().Be(firstStep);
- }
-
- [Fact]
- public void Next_ShouldMoveToNextStep()
- {
- var firstStep = new FakeStep();
- var secondStep = new FakeStep();
-
- this.authenticationStepFactory.SetupSequence(f => f.CreateSteps()).Returns(
- new List { firstStep, secondStep });
-
- this.Activate();
-
- this.testee.Next();
-
- this.testee.ActiveItem.Should().Be(secondStep);
- }
-
- private void Activate()
- {
- this.testee.As().Activate();
- }
-
- private class FakeStep : Screen, IAuthenticationStep
- {
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/Authentication/ChoosePasswordViewModelTest.cs b/source/StockTicker.Test/Authentication/ChoosePasswordViewModelTest.cs
deleted file mode 100644
index 3c9cddd..0000000
--- a/source/StockTicker.Test/Authentication/ChoosePasswordViewModelTest.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Security;
-
- using FluentAssertions.EventMonitoring;
-
- using FluentValidation;
-
- using Moq;
-
- using Xunit;
-
- public class ChoosePasswordViewModelTest
- {
- private readonly Mock validatorFactory;
-
- private readonly ChoosePasswordViewModel testee;
-
- public ChoosePasswordViewModelTest()
- {
- this.validatorFactory = new Mock();
-
- this.testee = new ChoosePasswordViewModel(this.validatorFactory.Object);
- }
-
- [Fact]
- public void Password_ShouldRaisePropertyChanged()
- {
- this.testee.MonitorEvents();
-
- this.testee.Password = new SecureString();
-
- this.testee.ShouldRaisePropertyChangeFor(t => t.Password);
- this.testee.ShouldRaisePropertyChangeFor(t => t.PasswordRetype);
- }
-
- [Fact]
- public void PasswordRetype_ShouldRaisePropertyChanged()
- {
- this.testee.MonitorEvents();
-
- this.testee.PasswordRetype = new SecureString();
-
- this.testee.ShouldRaisePropertyChangeFor(t => t.PasswordRetype);
- this.testee.ShouldRaisePropertyChangeFor(t => t.Password);
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/Authentication/ChooseUserNameViewModelTest.cs b/source/StockTicker.Test/Authentication/ChooseUserNameViewModelTest.cs
deleted file mode 100644
index a7525ae..0000000
--- a/source/StockTicker.Test/Authentication/ChooseUserNameViewModelTest.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using Caliburn.Micro;
-
- using FluentAssertions;
- using FluentAssertions.EventMonitoring;
-
- using Moq;
-
- using Xunit;
-
- public class ChooseUserNameViewModelTest
- {
- private readonly ChooseUserNameViewModel testee;
-
- public ChooseUserNameViewModelTest()
- {
- this.testee = new ChooseUserNameViewModel();
- }
-
- [Fact]
- public void UserName_ShouldRaisePropertyChanged()
- {
- this.testee.MonitorEvents();
-
- this.testee.UserName = "AnyName";
-
- this.testee.ShouldRaisePropertyChangeFor(t => t.UserName);
- }
-
- [Fact]
- public void ShouldRaisePropertyChangedForHasSuggestions()
- {
- this.testee.MonitorEvents();
-
- this.testee.Suggestions.Add("AnySuggestion");
-
- this.testee.ShouldRaisePropertyChangeFor(x => x.HasSuggestions);
- this.testee.HasSuggestions.Should().BeTrue();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/Authentication/SuggestUsernamesTest.cs b/source/StockTicker.Test/Authentication/SuggestUsernamesTest.cs
deleted file mode 100644
index 8487990..0000000
--- a/source/StockTicker.Test/Authentication/SuggestUsernamesTest.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Collections.Generic;
-
- using Caliburn.Micro;
-
- using FluentAssertions;
-
- using Moq;
-
- using StockTicker.Actions;
- using StockTicker.Externals;
- using StockTicker.TestHelpers;
-
- using Xunit;
-
- public class SuggestUsernamesTest
- {
- private readonly Mock authenticationService;
-
- private readonly PotentialNewUserModel potentialNewUser;
-
- private readonly SuggestUsernames testee;
-
- private readonly List suggestions;
-
- public SuggestUsernamesTest()
- {
- this.authenticationService = new Mock();
- this.potentialNewUser = new PotentialNewUserModel("AnyFirstname", "AnyLastname");
- this.suggestions = new List();
-
- this.testee = new SuggestUsernames(this.authenticationService.Object, this.potentialNewUser, this.suggestions);
- }
-
- [Fact]
- public void ShouldRaiseCompleted()
- {
- this.testee.ShouldRaiseCompleted();
- }
-
- [Fact]
- public void ShouldRequestAsynchronousExecution()
- {
- this.testee.Should().BeDecoratedWith();
- }
-
- [Fact]
- public void ShouldFillFoundStocks()
- {
- var expectedSearchModels = new List { "First", "Second", };
-
- this.authenticationService.Setup(s => s.SuggestUsernames(this.potentialNewUser))
- .Returns(expectedSearchModels);
-
- this.testee.Execute(new ActionExecutionContext());
-
- this.suggestions.Should().BeEquivalentTo(expectedSearchModels);
- }
-
- [Fact]
- public void ShouldClearInputCollection()
- {
- this.suggestions.Add("First");
- this.suggestions.Add("Second");
-
- this.testee.Execute(new ActionExecutionContext());
-
- this.suggestions.Should().BeEmpty();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/ContentViewModelFactoryTest.cs b/source/StockTicker.Test/ContentViewModelFactoryTest.cs
deleted file mode 100644
index 4b5be4a..0000000
--- a/source/StockTicker.Test/ContentViewModelFactoryTest.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker
-{
- using System;
-
- using FluentAssertions;
-
- using Moq;
-
- using Ninject;
-
- using StockTicker.Externals;
- using StockTicker.ManageStocks;
- using StockTicker.News;
-
- using Xunit;
-
- public class ContentViewModelFactoryTest : IDisposable
- {
- private readonly StandardKernel kernel;
-
- private readonly ContentViewModelFactory testee;
-
- public ContentViewModelFactoryTest()
- {
- this.kernel = new StandardKernel(new NinjectSettings { LoadExtensions = false });
- this.kernel.Bind().ToConstant(Mock.Of());
- this.kernel.Bind().ToConstant(Mock.Of());
-
- this.testee = new ContentViewModelFactory(this.kernel);
- }
-
- [Fact]
- public void ShouldReturnNewsViewModelAsDefaultContent()
- {
- IStockTickerContentViewModel result = this.testee.CreateContent(null);
-
- result.Should().NotBeNull()
- .And.BeAssignableTo();
- }
-
- [Fact]
- public void ShouldReturnDetailsViewModelForSearchedContent()
- {
- IStockTickerContentViewModel result =
- this.testee.CreateContent(new AnyStockDetailModel());
-
- result.Should().NotBeNull()
- .And.BeAssignableTo();
- }
-
- public void Dispose()
- {
- this.kernel.Dispose();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/FindStocks/SearchViewModelTest.cs b/source/StockTicker.Test/FindStocks/SearchViewModelTest.cs
index e52e37b..81070b7 100644
--- a/source/StockTicker.Test/FindStocks/SearchViewModelTest.cs
+++ b/source/StockTicker.Test/FindStocks/SearchViewModelTest.cs
@@ -18,20 +18,27 @@
namespace StockTicker.FindStocks
{
+ using System.Windows.Input;
+
using FluentAssertions;
- using FluentAssertions.EventMonitoring;
using StockTicker.Externals;
+ using StockTicker.TestHelpers;
using Xunit;
public class SearchViewModelTest
{
+ private readonly ActionBuilderMock actionBuilder;
+
private readonly SearchViewModel testee;
public SearchViewModelTest()
{
- this.testee = new SearchViewModel();
+ this.actionBuilder = new ActionBuilderMock();
+
+ this.testee = new SearchViewModel()
+ .AttachBuilder(this.actionBuilder);
}
[Fact]
@@ -66,5 +73,23 @@ public void ShouldRaisePropertyChangedForPattern()
this.testee.ShouldRaisePropertyChangeFor(t => t.Pattern);
}
+
+ [Fact]
+ public void ShouldSearch_WhenEnter()
+ {
+ this.testee.Search("AnySymbol", new KeyEventArgs(null, new FakePresentationSource(), 21, Key.Enter));
+
+ this.actionBuilder
+ .Should().NotBeEmpty();
+ }
+
+ [Fact]
+ public void ShouldNotSearch_WhenNotEnter()
+ {
+ this.testee.Search("AnySymbol", new KeyEventArgs(null, new FakePresentationSource(), 21, Key.A));
+
+ this.actionBuilder
+ .Should().BeEmpty();
+ }
}
}
\ No newline at end of file
diff --git a/source/StockTicker.Test/ManageStocks/ConductStockTickerContentTest.cs b/source/StockTicker.Test/ManageStocks/ConductStockTickerContentTest.cs
deleted file mode 100644
index 4f4ba3b..0000000
--- a/source/StockTicker.Test/ManageStocks/ConductStockTickerContentTest.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using Caliburn.Micro;
-
- using FluentAssertions;
-
- using Moq;
-
- using StockTicker.Externals;
- using StockTicker.TestHelpers;
-
- using Xunit;
-
- public class ConductStockTickerContentTest
- {
- private readonly FutureMock searchModel;
-
- private readonly Mock contentFactory;
-
- private IStockTickerContentViewModel detail;
-
- public ConductStockTickerContentTest()
- {
- this.searchModel = new AnyStockDetailModel().AsFuture();
- this.contentFactory = new Mock();
- }
-
- [Fact]
- public void ShouldRaiseCompleted()
- {
- ConductStockTickerContent testee = this.CreateTestee();
-
- testee.ShouldRaiseCompleted();
- }
-
- [Fact]
- public void ShouldAllowNullSearchModel()
- {
- var future = new FutureMock();
-
- ConductStockTickerContent testee = this.CreateTestee(future);
-
- System.Action act = () => testee.Execute(new ActionExecutionContext());
-
- act.ShouldNotThrow();
- }
-
- [Fact]
- public void ShouldConductCreatedDetailViewModel()
- {
- var contentViewModel = Mock.Of();
- this.contentFactory.Setup(f => f.CreateContent(It.IsAny())).Returns(contentViewModel);
-
- var testee = this.CreateTestee();
-
- testee.Execute(new ActionExecutionContext());
-
- this.detail.Should().Be(contentViewModel);
- }
-
- private ConductStockTickerContent CreateTestee(FutureMock search)
- {
- return new ConductStockTickerContent(search, d => this.detail = d, this.contentFactory.Object);
- }
-
- private ConductStockTickerContent CreateTestee()
- {
- return this.CreateTestee(this.searchModel);
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/ManageStocks/DollarConverterTest.cs b/source/StockTicker.Test/ManageStocks/DollarConverterTest.cs
deleted file mode 100644
index 5c46516..0000000
--- a/source/StockTicker.Test/ManageStocks/DollarConverterTest.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
- using System.Globalization;
-
- using FluentAssertions;
-
- using Xunit;
-
- public class DollarConverterTest
- {
- private readonly DollarConverter testee;
-
- public DollarConverterTest()
- {
- this.testee = new DollarConverter();
- }
-
- [Fact]
- public void ShouldNotConvertBack()
- {
- Action act = () => this.testee.ConvertBack(null, null, null, null);
-
- act.ShouldThrow();
- }
-
- [Fact]
- public void ShouldAppendDollar()
- {
- var result = this.testee.Convert(10.00m, null, null, CultureInfo.InvariantCulture);
-
- result.As().Should().NotBeNull().And.Be("$10.00");
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/ManageStocks/GetStockDetailsTest.cs b/source/StockTicker.Test/ManageStocks/GetStockDetailsTest.cs
deleted file mode 100644
index bf5cf8e..0000000
--- a/source/StockTicker.Test/ManageStocks/GetStockDetailsTest.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
-
- using Caliburn.Micro;
-
- using FluentAssertions;
-
- using Moq;
-
- using StockTicker.Actions;
- using StockTicker.Externals;
- using StockTicker.TestHelpers;
-
- using Xunit;
-
- using Action = System.Action;
-
- public class GetStockDetailsTest
- {
- private readonly Mock stockService;
-
- private readonly string symbol;
-
- private readonly FutureMock detail;
-
- public GetStockDetailsTest()
- {
- this.symbol = "AnySymbol";
- this.detail = new FutureMock();
-
- this.stockService = new Mock();
- }
-
- [Fact]
- public void ShouldNotAllowNullSearchModel()
- {
- Action act = () => this.CreateTestee(null);
-
- act.ShouldThrow();
- }
-
- [Fact]
- public void ShouldRaiseCompleted()
- {
- var testee = this.CreateTestee();
-
- testee.ShouldRaiseCompleted();
- }
-
- [Fact]
- public void ShouldRequestAsynchronousExecution()
- {
- var testee = this.CreateTestee();
-
- testee.Should().BeDecoratedWith();
- }
-
- [Fact]
- public void ShouldReturnDetails()
- {
- var expectedDetail = new AnyStockDetailModel();
- this.stockService.Setup(s => s.Get(this.symbol)).Returns(expectedDetail);
-
- var testee = this.CreateTestee();
-
- testee.Execute(new ActionExecutionContext());
-
- this.detail.Value.Should().Be(expectedDetail);
- }
-
- private GetStockDetails CreateTestee()
- {
- return this.CreateTestee(this.symbol);
- }
-
- private GetStockDetails CreateTestee(string symbol)
- {
- return new GetStockDetails(this.stockService.Object, symbol, this.detail);
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/ManageStocks/RangeToTextConverterTest.cs b/source/StockTicker.Test/ManageStocks/RangeToTextConverterTest.cs
deleted file mode 100644
index 35fe091..0000000
--- a/source/StockTicker.Test/ManageStocks/RangeToTextConverterTest.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
-
- using FluentAssertions;
-
- using StockTicker.Externals;
-
- using Xunit;
- using Xunit.Extensions;
-
- public class RangeToTextConverterTest
- {
- private readonly RangeToTextConverter testee;
-
- public RangeToTextConverterTest()
- {
- this.testee = new RangeToTextConverter();
- }
-
- [Fact]
- public void ShouldNotConvertBack()
- {
- Action act = () => this.testee.ConvertBack(null, null, null, null);
-
- act.ShouldThrow();
- }
-
- [Theory]
- [ClassData(typeof(RangeData))]
- public void ShouldConvertRange(decimal @from, decimal to, string expected)
- {
- var result = this.testee.Convert(new Range(from, to), null, null, CultureInfo.InvariantCulture);
-
- result.As().Should().NotBeNull().And.Be(expected);
- }
-
- private class RangeData : IEnumerable
- {
- public IEnumerator GetEnumerator()
- {
- yield return new object[] { 10.00m, 11.05m, "$10.00 - $11.05" };
- yield return new object[] { -10.00m, 11.05m, "$-10.00 - $11.05" };
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return this.GetEnumerator();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/ManageStocks/StockDetailModelToTitleConverterTest.cs b/source/StockTicker.Test/ManageStocks/StockDetailModelToTitleConverterTest.cs
deleted file mode 100644
index f1739c6..0000000
--- a/source/StockTicker.Test/ManageStocks/StockDetailModelToTitleConverterTest.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
- using System.Globalization;
-
- using FluentAssertions;
-
- using StockTicker.Externals;
-
- using Xunit;
-
- public class StockDetailModelToTitleConverterTest
- {
- private readonly StockDetailModelToTitleConverter testee;
-
- public StockDetailModelToTitleConverterTest()
- {
- this.testee = new StockDetailModelToTitleConverter();
- }
-
- [Fact]
- public void ShouldNotConvertBack()
- {
- Action act = () => this.testee.ConvertBack(null, null, null, null);
-
- act.ShouldThrow();
- }
-
- [Fact]
- public void ShouldConvertOnlySearchDetailModel()
- {
- object result = this.testee.Convert(new object(), null, null, CultureInfo.InvariantCulture);
-
- result.Should().BeNull();
- }
-
- [Fact]
- public void ShouldConvertSearchDetailModel()
- {
- var expected = new AnyStockDetailModel();
-
- object result = this.testee.Convert(expected, null, null, CultureInfo.InvariantCulture);
-
- result.As().Should().NotBeNull().And.Be("AnyCompany\r\nAnyFund:AnySymbol");
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker.Test/StockTicker.Test.csproj b/source/StockTicker.Test/StockTicker.Test.csproj
index 317b991..88f1850 100644
--- a/source/StockTicker.Test/StockTicker.Test.csproj
+++ b/source/StockTicker.Test/StockTicker.Test.csproj
@@ -3,42 +3,55 @@
StockTicker
Test
+ ..\
+ true
{F9E20B24-DEB5-40B9-8C4B-44F3F39067E4}
Library
-
- ..\packages\Caliburn.Micro\lib\net40\Caliburn.Micro.dll
-
-
+
False
- ..\packages\FluentAssertions\Lib\net40\FluentAssertions.dll
+ ..\packages\Caliburn.Micro.1.5.1\lib\net40\Caliburn.Micro.dll
-
- ..\packages\FluentValidation\lib\Net40\FluentValidation.dll
+
+ ..\packages\FluentAssertions.2.0.1\lib\net40\FluentAssertions.dll
-
- ..\packages\Moq\lib\NET40\Moq.dll
+
+ False
+ ..\packages\FluentValidation.3.4.6.0\lib\Net40\FluentValidation.dll
+
+
+ False
+ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll
- ..\packages\Ninject\lib\net40\Ninject.dll
+ False
+ ..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll
+
+
+ False
+ ..\packages\Caliburn.Micro.1.5.1\lib\net40\System.Windows.Interactivity.dll
+
-
- ..\packages\xunit\lib\xunit.dll
+
+
+ False
+ ..\packages\xunit.1.9.1\lib\net20\xunit.dll
-
- ..\packages\xunit.extensions\lib\xunit.extensions.dll
+
+ False
+ ..\packages\xunit.extensions.1.9.1\lib\net20\xunit.extensions.dll
@@ -48,22 +61,15 @@
-
-
-
-
-
+
-
-
-
-
-
-
+
+
+
@@ -75,9 +81,8 @@
-
-
+
@@ -89,4 +94,5 @@
+
\ No newline at end of file
diff --git a/source/StockTicker.Test/TestHelpers/ActionBuilderMock.cs b/source/StockTicker.Test/TestHelpers/ActionBuilderMock.cs
new file mode 100644
index 0000000..9a593e8
--- /dev/null
+++ b/source/StockTicker.Test/TestHelpers/ActionBuilderMock.cs
@@ -0,0 +1,111 @@
+//-------------------------------------------------------------------------------
+//
+// Copyright (c) 2012
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//-------------------------------------------------------------------------------
+
+namespace StockTicker.TestHelpers
+{
+ using System;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using Caliburn.Micro;
+
+ using Moq;
+
+ using StockTicker.Actions;
+
+ public class ActionBuilderMock : IActionBuilder, IEnumerable
+ {
+ private readonly List actionInfo;
+
+ public ActionBuilderMock()
+ : this(new List())
+ {
+ }
+
+ private ActionBuilderMock(List actionInfo)
+ {
+ this.actionInfo = actionInfo;
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return this.actionInfo.GetEnumerator();
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ return this.actionInfo
+ .Select(info => Activator.CreateInstance(typeof(Mock<>).MakeGenericType(info.ResultType)))
+ .Select(mock => ((dynamic)mock).Object)
+ .Cast()
+ .GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return this.GetEnumerator();
+ }
+
+ public IActionBuilder Execute() where TResult : IResult
+ {
+ this.actionInfo.Add(new ActionInfo(typeof(TResult), null));
+ return this;
+ }
+
+ public IActionBuilder Execute(object prototype) where TResult : IResult
+ {
+ this.actionInfo.Add(new ActionInfo(typeof(TResult), prototype));
+
+ return this;
+ }
+
+ public IActionBuilder ScopeWith(Action builder, object enterPrototype, object exitPrototype) where TEnterResult : IResult where TExitResult : IResult
+ {
+ this.actionInfo.Add(new ActionInfo(typeof(TEnterResult), enterPrototype));
+
+ builder(new ActionBuilderMock(this.actionInfo));
+
+ this.actionInfo.Add(new ActionInfo(typeof(TExitResult), exitPrototype));
+
+ return this;
+ }
+
+ public IActionBuilder ScopeWith(Action builder, object enterPrototype) where TEnterResult : IResult where TExitResult : IResult
+ {
+ this.actionInfo.Add(new ActionInfo(typeof(TEnterResult), enterPrototype));
+
+ builder(new ActionBuilderMock(this.actionInfo));
+
+ this.actionInfo.Add(new ActionInfo(typeof(TExitResult), null));
+
+ return this;
+ }
+
+ public IActionBuilder ScopeWith(Action builder) where TEnterResult : IResult where TExitResult : IResult
+ {
+ this.actionInfo.Add(new ActionInfo(typeof(TEnterResult), null));
+
+ builder(new ActionBuilderMock(this.actionInfo));
+
+ this.actionInfo.Add(new ActionInfo(typeof(TExitResult), null));
+
+ return this;
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/StockTicker.Test/TestHelpers/FutureExtensions.cs b/source/StockTicker.Test/TestHelpers/ActionBuilderMockExtensions.cs
similarity index 67%
rename from source/StockTicker.Test/TestHelpers/FutureExtensions.cs
rename to source/StockTicker.Test/TestHelpers/ActionBuilderMockExtensions.cs
index 52988a4..6a1efe3 100644
--- a/source/StockTicker.Test/TestHelpers/FutureExtensions.cs
+++ b/source/StockTicker.Test/TestHelpers/ActionBuilderMockExtensions.cs
@@ -1,5 +1,5 @@
//-------------------------------------------------------------------------------
-//
+//
// Copyright (c) 2012
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,13 +18,16 @@
namespace StockTicker.TestHelpers
{
- public static class FutureExtensions
+ using StockTicker.Actions;
+
+ public static class ActionBuilderMockExtensions
{
- public static FutureMock AsFuture(this TValue value)
- {
- var future = new FutureMock();
- future.SetValue(value);
- return future;
- }
+ public static T AttachBuilder(this T actionsAware, ActionBuilderMock builder)
+ where T : IUseActions
+ {
+ actionsAware.Actions = () => builder;
+
+ return actionsAware;
+ }
}
}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/IChooseUsernameViewModel.cs b/source/StockTicker.Test/TestHelpers/ActionInfo.cs
similarity index 66%
rename from source/StockTicker/Authentication/IChooseUsernameViewModel.cs
rename to source/StockTicker.Test/TestHelpers/ActionInfo.cs
index b6c0d6e..e58263b 100644
--- a/source/StockTicker/Authentication/IChooseUsernameViewModel.cs
+++ b/source/StockTicker.Test/TestHelpers/ActionInfo.cs
@@ -1,5 +1,5 @@
//-------------------------------------------------------------------------------
-//
+//
// Copyright (c) 2012
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,16 +16,20 @@
//
//-------------------------------------------------------------------------------
-namespace StockTicker.Authentication
+namespace StockTicker.TestHelpers
{
- using StockTicker.Actions;
+ using System;
- public interface IChooseUserNameViewModel : IAuthenticationStep, IUseActions
+ public class ActionInfo
{
- string FirstName { get; }
+ public ActionInfo(Type resultType, object input)
+ {
+ this.ResultType = resultType;
+ this.Input = input;
+ }
- string LastName { get; }
+ public Type ResultType { get; private set; }
- string UserName { get; }
+ public object Input { get; private set; }
}
}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/ChoosePasswordView.cs b/source/StockTicker.Test/TestHelpers/FakePresentationSource.cs
similarity index 62%
rename from source/StockTicker/Authentication/ChoosePasswordView.cs
rename to source/StockTicker.Test/TestHelpers/FakePresentationSource.cs
index f38458e..0f98860 100644
--- a/source/StockTicker/Authentication/ChoosePasswordView.cs
+++ b/source/StockTicker.Test/TestHelpers/FakePresentationSource.cs
@@ -1,5 +1,5 @@
//-------------------------------------------------------------------------------
-//
+//
// Copyright (c) 2012
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,23 +16,26 @@
//
//-------------------------------------------------------------------------------
-namespace StockTicker.Authentication
+namespace StockTicker.TestHelpers
{
- public partial class ChoosePasswordView
+ using System.Windows;
+ using System.Windows.Media;
+
+ internal class FakePresentationSource : PresentationSource
{
- public static object SampleData
+ public override Visual RootVisual { get; set; }
+
+ public override bool IsDisposed
{
get
{
- var choosePasswordViewModel = new ChoosePasswordViewModel(null)
- {
- FirstName = "User",
- LastName = "Fritz",
- UserName = "user.fritz"
- };
-
- return choosePasswordViewModel;
+ return false;
}
}
+
+ protected override CompositionTarget GetCompositionTargetCore()
+ {
+ throw new System.NotImplementedException();
+ }
}
}
\ No newline at end of file
diff --git a/source/StockTicker.Test/TestHelpers/ResultExtensionsForTesting.cs b/source/StockTicker.Test/TestHelpers/ResultExtensionsForTesting.cs
index 72feeec..208d429 100644
--- a/source/StockTicker.Test/TestHelpers/ResultExtensionsForTesting.cs
+++ b/source/StockTicker.Test/TestHelpers/ResultExtensionsForTesting.cs
@@ -24,8 +24,8 @@ namespace StockTicker.TestHelpers
using Caliburn.Micro;
- using FluentAssertions.Assertions;
- using FluentAssertions.EventMonitoring;
+ using FluentAssertions;
+ using FluentAssertions.Primitives;
using Moq;
@@ -66,7 +66,7 @@ public static void BeDecoratedWith(this ObjectAssertions assertions)
{
IEnumerable attributes = assertions.Subject.GetType().GetAttributes(false);
- FluentAssertions.Execute
+ FluentAssertions.Execution.Execute
.Verification
.ForCondition(attributes.Any())
.BecauseOf("Attribute {0} could not be found.", typeof(TAttribute).FullName)
diff --git a/source/StockTicker.Test/packages.config b/source/StockTicker.Test/packages.config
index 318b8e8..cc6dbaf 100644
--- a/source/StockTicker.Test/packages.config
+++ b/source/StockTicker.Test/packages.config
@@ -1,11 +1,10 @@
-
-
-
+
+
+
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/source/StockTicker.msbuild b/source/StockTicker.msbuild
index a5f9c4e..703b905 100644
--- a/source/StockTicker.msbuild
+++ b/source/StockTicker.msbuild
@@ -187,7 +187,7 @@
-
+
\ No newline at end of file
diff --git a/source/StockTicker.sln b/source/StockTicker.sln
index d3e69c0..2463cb6 100644
--- a/source/StockTicker.sln
+++ b/source/StockTicker.sln
@@ -1,12 +1,20 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StockTicker", "StockTicker\StockTicker.csproj", "{ECE87891-83C1-4CB9-A253-3EA7D1914269}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StockTicker.Test", "StockTicker.Test\StockTicker.Test.csproj", "{F9E20B24-DEB5-40B9-8C4B-44F3F39067E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StockTicker.Specification", "StockTicker.Specification\StockTicker.Specification.csproj", "{FA85776B-D3B5-439D-A349-5CD1108CE8CB}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{B864226C-68C6-4BA6-842D-C9D69C627957}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ .nuget\packages.config = .nuget\packages.config
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/source/StockTicker/Actions/ActionsModule.cs b/source/StockTicker/Actions/ActionsModule.cs
index fb9b9da..ac68e7c 100644
--- a/source/StockTicker/Actions/ActionsModule.cs
+++ b/source/StockTicker/Actions/ActionsModule.cs
@@ -20,6 +20,7 @@ namespace StockTicker.Actions
{
using Caliburn.Micro;
+ using Ninject.Activation.Strategies;
using Ninject.Extensions.Conventions;
using Ninject.Modules;
@@ -27,6 +28,8 @@ public class ActionsModule : NinjectModule
{
public override void Load()
{
+ this.Kernel.Components.Add();
+
this.Bind().To();
this.Bind().To();
this.Bind().To();
diff --git a/source/StockTicker.Test/TestHelpers/FutureMock.cs b/source/StockTicker/Actions/UseActionsActivationStrategy.cs
similarity index 60%
rename from source/StockTicker.Test/TestHelpers/FutureMock.cs
rename to source/StockTicker/Actions/UseActionsActivationStrategy.cs
index af65dd3..015333d 100644
--- a/source/StockTicker.Test/TestHelpers/FutureMock.cs
+++ b/source/StockTicker/Actions/UseActionsActivationStrategy.cs
@@ -1,5 +1,5 @@
//-------------------------------------------------------------------------------
-//
+//
// Copyright (c) 2012
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,24 +16,18 @@
//
//-------------------------------------------------------------------------------
-namespace StockTicker.TestHelpers
+namespace StockTicker.Actions
{
- public sealed class FutureMock : IFutureValueSetter, IFutureValue
+ using Ninject;
+ using Ninject.Activation.Strategies;
+
+ public class UseActionsActivationStrategy : ActivationStrategy
{
- public FutureMock()
+ public override void Activate(Ninject.Activation.IContext context, Ninject.Activation.InstanceReference reference)
{
- }
+ reference.IfInstanceIs(useAction => { useAction.Actions = () => context.Kernel.Get(); });
- public FutureMock(TValue value)
- {
- this.SetValue(value);
- }
-
- public TValue Value { get; private set; }
-
- public void SetValue(TValue value)
- {
- this.Value = value;
+ base.Activate(context, reference);
}
}
}
\ No newline at end of file
diff --git a/source/StockTicker/AppBootstrapper.cs b/source/StockTicker/AppBootstrapper.cs
index 2e25143..7ee31a9 100644
--- a/source/StockTicker/AppBootstrapper.cs
+++ b/source/StockTicker/AppBootstrapper.cs
@@ -26,10 +26,9 @@ namespace StockTicker
using Ninject;
- using StockTicker.Actions;
using StockTicker.Localization;
- public class AppBootstrapper : Bootstrapper
+ public class AppBootstrapper : BootstrapperBase
{
private ILocalizer localizer;
@@ -41,6 +40,7 @@ public AppBootstrapper()
public AppBootstrapper(bool useApplication)
: base(useApplication)
{
+ this.Start();
}
protected StandardKernel Kernel { get; private set; }
@@ -57,22 +57,6 @@ protected override IEnumerable SelectAssemblies()
protected override void Configure()
{
- // NOTE: This shows how to hook into Caliburn.Micro magic. Everytime a new view model is binded I check
- // whether the view model wants to use action builders. If this is the case a factory is provided for the
- // target view model. The default Bind Delegate must be saved in local variable and reintroduced in the
- // anonymous delegate.
- var defaultBindingAction = ViewModelBinder.Bind;
- ViewModelBinder.Bind = (rootModel, view, context) =>
- {
- defaultBindingAction(rootModel, view, context);
-
- var useAction = rootModel as IUseActions;
- if (useAction != null)
- {
- useAction.Actions = () => this.Kernel.Get();
- }
- };
-
this.Kernel = new StandardKernel();
this.Kernel.Load(this.SelectAssemblies());
}
@@ -82,7 +66,7 @@ protected override void OnStartup(object sender, System.Windows.StartupEventArgs
this.localizer = this.Kernel.Get();
this.localizer.Initialize();
- DisplayRootViewFor(typeof(IStockTickerViewModel));
+ this.DisplayRootViewFor(typeof(IStockTickerViewModel));
}
protected override void OnExit(object sender, EventArgs e)
diff --git a/source/StockTicker/Authentication/Authenticate.cs b/source/StockTicker/Authentication/Authenticate.cs
deleted file mode 100644
index 760041a..0000000
--- a/source/StockTicker/Authentication/Authenticate.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System;
- using System.Dynamic;
- using System.Windows;
- using System.Windows.Controls.Primitives;
-
- using Caliburn.Micro;
-
- // NOTE: IResult which opens a dialog window with dynamic placement on the screen. The window manager takes care of all the rest.
- internal class Authenticate : IAuthenticate
- {
- private readonly IWindowManager windowManager;
-
- private readonly IAuthenticationViewModel authenticationViewModel;
-
- public Authenticate(IWindowManager windowManager, IAuthenticationViewModel authenticationViewModel)
- {
- this.windowManager = windowManager;
- this.authenticationViewModel = authenticationViewModel;
- }
-
- public event EventHandler Completed = delegate { };
-
- public void Execute(ActionExecutionContext context)
- {
- dynamic settings = new ExpandoObject();
- settings.Placement = PlacementMode.Center;
- settings.ResizeMode = ResizeMode.NoResize;
- settings.ShowInTaskbar = false;
-
- this.windowManager.ShowDialog(this.authenticationViewModel, null, settings);
-
- this.Completed(this, new ResultCompletionEventArgs());
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/Authentication.Designer.cs b/source/StockTicker/Authentication/Authentication.Designer.cs
deleted file mode 100644
index 945b8a5..0000000
--- a/source/StockTicker/Authentication/Authentication.Designer.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.261
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Authentication {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Authentication() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StockTicker.Authentication.Authentication", typeof(Authentication).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized string similar to Authentication.
- ///
- internal static string AuthenticationTitle {
- get {
- return ResourceManager.GetString("AuthenticationTitle", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Let's choose your password.
- ///
- internal static string ChoosePassword {
- get {
- return ResourceManager.GetString("ChoosePassword", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Let's choose your username.
- ///
- internal static string ChooseUserName {
- get {
- return ResourceManager.GetString("ChooseUserName", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to First name.
- ///
- internal static string FirstName {
- get {
- return ResourceManager.GetString("FirstName", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to How about one of these?.
- ///
- internal static string HowAbout {
- get {
- return ResourceManager.GetString("HowAbout", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Last name.
- ///
- internal static string LastName {
- get {
- return ResourceManager.GetString("LastName", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Create a password.
- ///
- internal static string Password {
- get {
- return ResourceManager.GetString("Password", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Retyped password must match!.
- ///
- internal static string PasswordRetypeDoesNotMatch {
- get {
- return ResourceManager.GetString("PasswordRetypeDoesNotMatch", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Pick a username.
- ///
- internal static string PickUserName {
- get {
- return ResourceManager.GetString("PickUserName", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Fetching suggestion....
- ///
- internal static string Suggestion {
- get {
- return ResourceManager.GetString("Suggestion", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to User name.
- ///
- internal static string UserName {
- get {
- return ResourceManager.GetString("UserName", resourceCulture);
- }
- }
- }
-}
diff --git a/source/StockTicker/Authentication/Authentication.resx b/source/StockTicker/Authentication/Authentication.resx
deleted file mode 100644
index 65c7cb8..0000000
--- a/source/StockTicker/Authentication/Authentication.resx
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Authentication
-
-
- Let's choose your password
-
-
- Let's choose your username
-
-
- First name
-
-
- How about one of these?
-
-
- Last name
-
-
- Create a password
-
-
- Retyped password must match!
-
-
- Pick a username
-
-
- Fetching suggestion...
-
-
- User name
-
-
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/AuthenticationExtensions.cs b/source/StockTicker/Authentication/AuthenticationExtensions.cs
deleted file mode 100644
index a884e3d..0000000
--- a/source/StockTicker/Authentication/AuthenticationExtensions.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System;
- using System.Collections.Generic;
-
- using StockTicker.Actions;
- using StockTicker.Externals;
-
- // NOTE: Provides not only smarter syntax for actions but also some convenience mapping methods which could also be achieved with tools like AutoMapper.
- internal static class AuthenticationExtensions
- {
- public static IActionBuilder WithLogin(this IActionBuilder builder, Action configure)
- {
- return builder.ScopeWith(configure);
- }
-
- public static IActionBuilder SuggestUsernames(this IActionBuilder builder, PotentialNewUserModel potentialNewUser, ICollection suggestedUsernames)
- {
- return builder.Execute(new { potentialNewUser, suggestedUsernames });
- }
-
- public static UserNameChosen ToUserNameChosen(this IChooseUserNameViewModel chooseUserNameViewModel)
- {
- return new UserNameChosen(chooseUserNameViewModel.FirstName, chooseUserNameViewModel.LastName, chooseUserNameViewModel.UserName);
- }
-
- public static void FromChosenUserName(this IChoosePasswordViewModel choosePasswordViewModel, UserNameChosen message)
- {
- choosePasswordViewModel.FirstName = message.FirstName;
- choosePasswordViewModel.LastName = message.LastName;
- choosePasswordViewModel.UserName = message.UserName;
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/AuthenticationModule.cs b/source/StockTicker/Authentication/AuthenticationModule.cs
deleted file mode 100644
index a2af990..0000000
--- a/source/StockTicker/Authentication/AuthenticationModule.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using FluentValidation;
-
- using Ninject.Modules;
-
- using StockTicker.Extensions;
-
- public class AuthenticationModule : NinjectModule
- {
- public override void Load()
- {
- this.Bind().To();
-
- this.Bind().To().RegisterOnEventAggregator();
- this.Bind().To().RegisterOnEventAggregator();
-
- this.Bind().To().InSingletonScope();
-
- this.Bind>().To();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/AuthenticationStepFactory.cs b/source/StockTicker/Authentication/AuthenticationStepFactory.cs
deleted file mode 100644
index 7f0835a..0000000
--- a/source/StockTicker/Authentication/AuthenticationStepFactory.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Collections.Generic;
-
- using Ninject;
- using Ninject.Syntax;
-
- // NOTE: Concrete step factory which knows how the wizard steps are composed.
- internal class AuthenticationStepFactory : IAuthenticationStepFactory
- {
- private readonly IResolutionRoot resolutionRoot;
-
- public AuthenticationStepFactory(IResolutionRoot resolutionRoot)
- {
- this.resolutionRoot = resolutionRoot;
- }
-
- public IEnumerable CreateSteps()
- {
- yield return this.resolutionRoot.Get();
- yield return this.resolutionRoot.Get();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/AuthenticationView.xaml b/source/StockTicker/Authentication/AuthenticationView.xaml
deleted file mode 100644
index ceb6cbf..0000000
--- a/source/StockTicker/Authentication/AuthenticationView.xaml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/StockTicker/Authentication/AuthenticationView.xaml.cs b/source/StockTicker/Authentication/AuthenticationView.xaml.cs
deleted file mode 100644
index 9ee8824..0000000
--- a/source/StockTicker/Authentication/AuthenticationView.xaml.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Windows.Controls;
-
- ///
- /// Interaction logic for AuthenticationView.xaml
- ///
- public partial class AuthenticationView : UserControl
- {
- public AuthenticationView()
- {
- this.InitializeComponent();
- }
- }
-}
diff --git a/source/StockTicker/Authentication/AuthenticationViewModel.cs b/source/StockTicker/Authentication/AuthenticationViewModel.cs
deleted file mode 100644
index d3f09f4..0000000
--- a/source/StockTicker/Authentication/AuthenticationViewModel.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Linq;
-
- using Caliburn.Micro;
-
- using StockTicker.Actions;
-
- // NOTE: Holds the whole authentication wizard. Only one step can be active at the time. Each step which is finished is deactivated and removed from the conductors items collection
- internal sealed class AuthenticationViewModel : Conductor.Collection.OneActive, IAuthenticationViewModel
- {
- private readonly IAuthenticationStepFactory authenticationStepFactory;
-
- public AuthenticationViewModel(IAuthenticationStepFactory authenticationStepFactory, IBusyIndicationViewModel busyIndication)
- {
- this.authenticationStepFactory = authenticationStepFactory;
- this.BusyIndication = busyIndication;
-
- this.DisplayName = Authentication.AuthenticationTitle;
- }
-
- public IBusyIndicationViewModel BusyIndication { get; private set; }
-
- // NOTE: The next method is hooked up by the Next button and simply takes the next item from the items collection and activates it. Previously activated item is deactivated.
- public void Next()
- {
- this.DeactivateItem(this.ActiveItem, true);
-
- if (this.Items.Any())
- {
- this.ActivateItem(this.Items.First());
- }
- else
- {
- this.TryClose();
- }
- }
-
- // NOTE: Upon initialization all steps are loaded into the conductor. But only the first is activated
- protected override void OnInitialize()
- {
- base.OnInitialize();
-
- this.Items.AddRange(this.authenticationStepFactory.CreateSteps());
-
- this.ActivateItem(this.Items.First());
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/ChoosePasswordView.xaml b/source/StockTicker/Authentication/ChoosePasswordView.xaml
deleted file mode 100644
index 028534e..0000000
--- a/source/StockTicker/Authentication/ChoosePasswordView.xaml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
- *
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/StockTicker/Authentication/ChoosePasswordView.xaml.cs b/source/StockTicker/Authentication/ChoosePasswordView.xaml.cs
deleted file mode 100644
index ec6774b..0000000
--- a/source/StockTicker/Authentication/ChoosePasswordView.xaml.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Windows.Controls;
-
- ///
- /// Interaction logic for ChoosePasswordView.xaml
- ///
- public partial class ChoosePasswordView : UserControl
- {
- public ChoosePasswordView()
- {
- this.InitializeComponent();
- }
- }
-}
diff --git a/source/StockTicker/Authentication/ChoosePasswordViewModel.cs b/source/StockTicker/Authentication/ChoosePasswordViewModel.cs
deleted file mode 100644
index ae59ee9..0000000
--- a/source/StockTicker/Authentication/ChoosePasswordViewModel.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System;
- using System.Linq;
- using System.Security;
-
- using Caliburn.Micro;
-
- using FluentValidation;
- using FluentValidation.Results;
-
- using StockTicker.Actions;
-
- // NOTE: Implements IDataErrorInfo and uses fluent validation for validation of the password.
- // The validator is created by using the validator factory. Implementing the data error info pattern is always the same and
- // considered a cross cutting concern. Ideal place to use tools like PostSharp.
- internal class ChoosePasswordViewModel : Screen, IChoosePasswordViewModel
- {
- private readonly IValidatorFactory validatorFactory;
-
- private SecureString password;
- private SecureString passwordRetype;
-
- public ChoosePasswordViewModel(IValidatorFactory validatorFactory)
- {
- this.validatorFactory = validatorFactory;
- }
-
- public Func Actions { private get; set; }
-
- public string FirstName
- {
- get;
- set;
- }
-
- public string LastName
- {
- get;
- set;
- }
-
- public string UserName
- {
- get;
- set;
- }
-
- public SecureString Password
- {
- get
- {
- return this.password;
- }
-
- set
- {
- this.password = value;
- this.NotifyOfPropertyChange(() => this.Password);
- this.NotifyOfPropertyChange(() => this.PasswordRetype);
- }
- }
-
- public SecureString PasswordRetype
- {
- get
- {
- return this.passwordRetype;
- }
-
- set
- {
- this.passwordRetype = value;
- this.NotifyOfPropertyChange(() => this.PasswordRetype);
- this.NotifyOfPropertyChange(() => this.Password);
- }
- }
-
- public string Error
- {
- get
- {
- var result = this.GetValidationResult();
-
- if (result.IsValid)
- {
- return string.Empty;
- }
-
- var errors = result.Errors.Select(x => x.ErrorMessage);
- return string.Join(Environment.NewLine, errors);
- }
- }
-
- public string this[string columnName]
- {
- get
- {
- var result = this.GetValidationResult();
-
- if (result.IsValid)
- {
- return string.Empty;
- }
-
- var errors = result.Errors.Where(x => x.PropertyName.Contains(columnName));
- return string.Join(Environment.NewLine, errors);
- }
- }
-
- // NOTE: Reacts on event aggregator events
- public void Handle(UserNameChosen message)
- {
- this.FromChosenUserName(message);
- }
-
- // NOTE: We cannot close upon next if we have erros (validation failed).
- public override void CanClose(Action callback)
- {
- callback(string.IsNullOrEmpty(this.Error));
- }
-
- private ValidationResult GetValidationResult()
- {
- var validator = this.validatorFactory.GetValidator();
- ValidationResult result = validator.Validate(this);
- return result;
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/ChoosePasswordViewModelValidator.cs b/source/StockTicker/Authentication/ChoosePasswordViewModelValidator.cs
deleted file mode 100644
index bcf64fe..0000000
--- a/source/StockTicker/Authentication/ChoosePasswordViewModelValidator.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System;
- using System.Runtime.InteropServices;
- using System.Security;
-
- using FluentValidation;
-
- // NOTE: Validation magic with fluent validator which uses translatable messages.
- internal class ChoosePasswordViewModelValidator : AbstractValidator
- {
- public ChoosePasswordViewModelValidator()
- {
- this.RuleFor(vm => vm.Password).NotNull();
- this.RuleFor(vm => vm.PasswordRetype).NotNull();
-
- this.RuleFor(vm => vm.Password)
- .Must(BeEqualToPasswordRetype)
- .When(vm => vm.Password != null && vm.PasswordRetype != null)
- .WithMessage(Authentication.PasswordRetypeDoesNotMatch);
- }
-
- private static bool BeEqualToPasswordRetype(IChoosePasswordViewModel choosePasswordViewModel, SecureString password)
- {
- return SecureStringToString(password).Equals(SecureStringToString(choosePasswordViewModel.PasswordRetype));
- }
-
- private static string SecureStringToString(SecureString input)
- {
- IntPtr ptr = SecureStringToBSTR(input);
- string output = PtrToStringBSTR(ptr);
- return output;
- }
-
- private static IntPtr SecureStringToBSTR(SecureString ss)
- {
- IntPtr ptr = Marshal.SecureStringToBSTR(ss);
- return ptr;
- }
-
- private static string PtrToStringBSTR(IntPtr ptr)
- {
- string s = Marshal.PtrToStringBSTR(ptr);
- Marshal.ZeroFreeBSTR(ptr);
- return s;
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/ChooseUserNameView.cs b/source/StockTicker/Authentication/ChooseUserNameView.cs
deleted file mode 100644
index 8a3cd52..0000000
--- a/source/StockTicker/Authentication/ChooseUserNameView.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- public partial class ChooseUserNameView
- {
- public static object SampleData
- {
- get
- {
- var chooseUserNameViewModel = new ChooseUserNameViewModel()
- {
- FirstName = "User",
- LastName = "Fritz"
- };
-
- chooseUserNameViewModel.Suggestions.Add("user.fritz");
- chooseUserNameViewModel.Suggestions.Add("fritz.user");
-
- return chooseUserNameViewModel;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/ChooseUserNameView.xaml b/source/StockTicker/Authentication/ChooseUserNameView.xaml
deleted file mode 100644
index fe2abe4..0000000
--- a/source/StockTicker/Authentication/ChooseUserNameView.xaml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/StockTicker/Authentication/ChooseUserNameView.xaml.cs b/source/StockTicker/Authentication/ChooseUserNameView.xaml.cs
deleted file mode 100644
index 4da37c3..0000000
--- a/source/StockTicker/Authentication/ChooseUserNameView.xaml.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Windows.Controls;
-
- ///
- /// Interaction logic for ChooseUsernameView.xaml
- ///
- public partial class ChooseUserNameView : UserControl
- {
- public ChooseUserNameView()
- {
- this.InitializeComponent();
- }
- }
-}
diff --git a/source/StockTicker/Authentication/ChooseUserNameViewModel.cs b/source/StockTicker/Authentication/ChooseUserNameViewModel.cs
deleted file mode 100644
index 7c09164..0000000
--- a/source/StockTicker/Authentication/ChooseUserNameViewModel.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Collections.Specialized;
- using System.Linq;
-
- using Caliburn.Micro;
-
- using StockTicker.Actions;
- using StockTicker.Externals;
-
- // NOTE: When a user name needs to be chosen, suggestions need to be loaded from the external services.
- // When the user clicks next on the parent screen this view model gets deactivated by the parent conductor. Upon deactivation we notify
- // potentially interested subscribers about the chosen username. We cannot assume which is the next step in the wizard. But we can assume that
- // subscribers are already alive and listening because the lifetime of the steps is managed by the parent conductor.
- internal class ChooseUserNameViewModel : Screen, IChooseUserNameViewModel
- {
- private string userName;
-
- private string firstName;
-
- private string lastName;
-
- public ChooseUserNameViewModel()
- {
- this.Suggestions = new BindableCollection();
- this.Suggestions.CollectionChanged += this.HandleSuggestionsChanged;
- }
-
- public Func Actions { private get; set; }
-
- public string FirstName
- {
- get
- {
- return this.firstName;
- }
-
- set
- {
- this.firstName = value;
- this.NotifyOfPropertyChange(() => this.FirstName);
- }
- }
-
- public string LastName
- {
- get
- {
- return this.lastName;
- }
-
- set
- {
- this.lastName = value;
- this.NotifyOfPropertyChange(() => this.LastName);
- }
- }
-
- public string UserName
- {
- get
- {
- return this.userName;
- }
-
- set
- {
- this.userName = value;
- this.NotifyOfPropertyChange(() => this.UserName);
- }
- }
-
- public bool HasSuggestions
- {
- get
- {
- return this.Suggestions.Any();
- }
- }
-
- public ObservableCollection Suggestions
- {
- get;
- private set;
- }
-
- // NOTE: Load suggestions.
- public IEnumerable SuggestUsernames(string firstName, string lastName)
- {
- return
- this.Actions().WithBusyIndication(
- busyScope => busyScope.SuggestUsernames(new PotentialNewUserModel(firstName, lastName), this.Suggestions),
- Authentication.Suggestion);
- }
-
- // NOTE: Notification by using the event aggregator. This could also be done with the Event Broker
- protected override void OnDeactivate(bool close)
- {
- base.OnDeactivate(close);
-
- UserNameChosen message = this.ToUserNameChosen();
-
- Coroutine.BeginExecute(this.Actions().Notify(message).GetEnumerator());
- }
-
- private void HandleSuggestionsChanged(object sender, NotifyCollectionChangedEventArgs e)
- {
- this.NotifyOfPropertyChange(() => this.HasSuggestions);
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/IAuthenticate.cs b/source/StockTicker/Authentication/IAuthenticate.cs
deleted file mode 100644
index 36aa65f..0000000
--- a/source/StockTicker/Authentication/IAuthenticate.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using Caliburn.Micro;
-
- public interface IAuthenticate : IResult
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/IAuthenticationStep.cs b/source/StockTicker/Authentication/IAuthenticationStep.cs
deleted file mode 100644
index f22719f..0000000
--- a/source/StockTicker/Authentication/IAuthenticationStep.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using Caliburn.Micro;
-
- // NOTE: A single wizard step.
- public interface IAuthenticationStep : IScreen
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/IAuthenticationStepFactory.cs b/source/StockTicker/Authentication/IAuthenticationStepFactory.cs
deleted file mode 100644
index c3cf71f..0000000
--- a/source/StockTicker/Authentication/IAuthenticationStepFactory.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Collections.Generic;
-
- // NOTE: Step factory
- internal interface IAuthenticationStepFactory
- {
- IEnumerable CreateSteps();
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/IChoosePasswordViewModel.cs b/source/StockTicker/Authentication/IChoosePasswordViewModel.cs
deleted file mode 100644
index 6f480b4..0000000
--- a/source/StockTicker/Authentication/IChoosePasswordViewModel.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.ComponentModel;
- using System.Security;
-
- using Caliburn.Micro;
-
- using StockTicker.Actions;
-
- internal interface IChoosePasswordViewModel : IAuthenticationStep, IUseActions, IHandle, IDataErrorInfo
- {
- string FirstName { get; set; }
-
- string LastName { get; set; }
-
- string UserName { get; set; }
-
- SecureString Password { get; set; }
-
- SecureString PasswordRetype { get; set; }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/ISuggestUsernames.cs b/source/StockTicker/Authentication/ISuggestUsernames.cs
deleted file mode 100644
index 9fd99f1..0000000
--- a/source/StockTicker/Authentication/ISuggestUsernames.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using Caliburn.Micro;
-
- internal interface ISuggestUsernames : IResult
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/Secure.cs b/source/StockTicker/Authentication/Secure.cs
deleted file mode 100644
index 003845d..0000000
--- a/source/StockTicker/Authentication/Secure.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System.Security;
- using System.Windows;
- using System.Windows.Controls;
-
- // NOTE: Shows how to use dependency properties.
- internal static class Secure
- {
- public static readonly DependencyProperty Password =
- DependencyProperty.RegisterAttached("Password", typeof(SecureString), typeof(Secure), new PropertyMetadata(new SecureString(), HandleBoundPasswordChanged));
-
- public static SecureString GetPassword(DependencyObject dp)
- {
- return (SecureString)dp.GetValue(Password);
- }
-
- public static void SetPassword(DependencyObject dp, SecureString value)
- {
- dp.SetValue(Password, value);
- }
-
- private static void HandlePasswordChanged(object sender, RoutedEventArgs e)
- {
- var box = sender as PasswordBox;
-
- SetPassword(box, box.SecurePassword);
- }
-
- private static void HandleBoundPasswordChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e)
- {
- var box = dp as PasswordBox;
-
- if (box == null)
- {
- return;
- }
-
- box.PasswordChanged -= HandlePasswordChanged;
- box.PasswordChanged += HandlePasswordChanged;
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/SuggestUsernames.cs b/source/StockTicker/Authentication/SuggestUsernames.cs
deleted file mode 100644
index 3618b46..0000000
--- a/source/StockTicker/Authentication/SuggestUsernames.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- using System;
- using System.Collections.Generic;
-
- using Caliburn.Micro;
-
- using StockTicker.Actions;
- using StockTicker.Externals;
-
- // NOTE: Gets the suggested usernames with asynchronous advice from the external services.
- [Async]
- internal class SuggestUsernames : ISuggestUsernames
- {
- private readonly IAuthenticationService authenticationService;
-
- private readonly PotentialNewUserModel potentialNewUser;
-
- private readonly ICollection suggestedUsernames;
-
- public SuggestUsernames(IAuthenticationService authenticationService, PotentialNewUserModel potentialNewUser, ICollection suggestedUsernames)
- {
- this.authenticationService = authenticationService;
- this.potentialNewUser = potentialNewUser;
- this.suggestedUsernames = suggestedUsernames;
- }
-
- public event EventHandler Completed = delegate { };
-
- public void Execute(ActionExecutionContext context)
- {
- this.suggestedUsernames.Clear();
-
- IEnumerable suggestions = this.authenticationService.SuggestUsernames(this.potentialNewUser);
-
- foreach (string suggestion in suggestions)
- {
- this.suggestedUsernames.Add(suggestion);
- }
-
- this.Completed(this, new ResultCompletionEventArgs());
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Authentication/UserNameChosen.cs b/source/StockTicker/Authentication/UserNameChosen.cs
deleted file mode 100644
index c3d47a9..0000000
--- a/source/StockTicker/Authentication/UserNameChosen.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Authentication
-{
- internal class UserNameChosen
- {
- public UserNameChosen(string firstName, string lastName, string userName)
- {
- this.FirstName = firstName;
- this.LastName = lastName;
- this.UserName = userName;
- }
-
- public string FirstName { get; private set; }
-
- public string LastName { get; private set; }
-
- public string UserName { get; private set; }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ContentViewModelFactory.cs b/source/StockTicker/ContentViewModelFactory.cs
deleted file mode 100644
index 14fdeab..0000000
--- a/source/StockTicker/ContentViewModelFactory.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker
-{
- using Ninject;
- using Ninject.Syntax;
-
- using StockTicker.Extensions;
- using StockTicker.Externals;
- using StockTicker.ManageStocks;
- using StockTicker.News;
-
- internal class ContentViewModelFactory : IContentViewModelFactory
- {
- private readonly IResolutionRoot resolutionRoot;
-
- public ContentViewModelFactory(IResolutionRoot resolutionRoot)
- {
- this.resolutionRoot = resolutionRoot;
- }
-
- public IStockTickerContentViewModel CreateContent(StockDetailModel detailModel)
- {
- // NOTE: When no detail model is present the news model is provided
- if (detailModel == null)
- {
- return this.resolutionRoot.Get();
- }
-
- return this.resolutionRoot.Get(new { detailModel });
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/FindStocks/SearchView.xaml b/source/StockTicker/FindStocks/SearchView.xaml
index f92d70e..a13e0ec 100644
--- a/source/StockTicker/FindStocks/SearchView.xaml
+++ b/source/StockTicker/FindStocks/SearchView.xaml
@@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cal="http://www.caliburnproject.org"
- xmlns:l="http://schemas.root-project.org/xaml/presentation"
+ xmlns:l="http://wpflocalizeextension.codeplex.com"
xmlns:uia="clr-namespace:Thinktecture.UIAnnotations;assembly=Thinktecture.UIAnnotations"
xmlns:FindStocks="clr-namespace:StockTicker.FindStocks"
mc:Ignorable="d"
@@ -15,7 +15,7 @@
@@ -24,9 +24,6 @@
Visibility="{Binding Path=HasStocks, Converter={StaticResource searchHintVisibilityConverter}}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- cal:Message.Attach="
- [Event MouseDoubleClick] = [Action Display(SearchHints.SelectedItem)];
- [Event MouseDoubleClick] = [Action Clear()]"
TabIndex="1">
diff --git a/source/StockTicker/FindStocks/SearchViewModel.cs b/source/StockTicker/FindStocks/SearchViewModel.cs
index 818b324..517b279 100644
--- a/source/StockTicker/FindStocks/SearchViewModel.cs
+++ b/source/StockTicker/FindStocks/SearchViewModel.cs
@@ -24,6 +24,7 @@ namespace StockTicker.FindStocks
using System.Collections.Specialized;
using System.Globalization;
using System.Linq;
+ using System.Windows.Input;
using Caliburn.Micro;
@@ -69,8 +70,13 @@ public string Pattern
}
// NOTE: Search method which appropriate busy indication around it
- public IEnumerable Search(string searchPattern)
+ public IEnumerable Search(string searchPattern, KeyEventArgs eventArgs)
{
+ if (eventArgs.Key != Key.Enter)
+ {
+ return Enumerable.Empty();
+ }
+
string busyMessage = string.Format(CultureInfo.InvariantCulture, FindStocks.Searching, searchPattern);
return this.Actions()
diff --git a/source/StockTicker/Future.cs b/source/StockTicker/Future.cs
deleted file mode 100644
index deb98b8..0000000
--- a/source/StockTicker/Future.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker
-{
- using System.Threading;
-
- public sealed class Future : IFutureValueSetter, IFutureValue
- {
- private readonly ManualResetEvent syncEvent;
-
- private TValue value;
-
- public Future()
- {
- this.syncEvent = new ManualResetEvent(false);
- }
-
- public TValue Value
- {
- get
- {
- this.syncEvent.WaitOne();
- return this.value;
- }
- }
-
- public void SetValue(TValue value)
- {
- ThreadPool.QueueUserWorkItem(
- state =>
- {
- this.value = value;
-
- this.syncEvent.Set();
- });
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/GlobalSuppressions.cs b/source/StockTicker/GlobalSuppressions.cs
index 3e6814a..a4d80ec 100644
--- a/source/StockTicker/GlobalSuppressions.cs
+++ b/source/StockTicker/GlobalSuppressions.cs
@@ -28,3 +28,5 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "StockTicker.Actions.RescueResultDecorator`1.#Handle(!0)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", Scope = "type", Target = "StockTicker.Future`1")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "StockTicker.Authentication.Secure.#.cctor()")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "StockTicker.StockTickerViewModel.#Actions")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "StockTicker.Actions.ActionsModule.#Load()")]
diff --git a/source/StockTicker/IContentViewModelFactory.cs b/source/StockTicker/IContentViewModelFactory.cs
deleted file mode 100644
index b5ea4b8..0000000
--- a/source/StockTicker/IContentViewModelFactory.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker
-{
- using StockTicker.Externals;
-
- // NOTE: Factory which decides which kind of dynamic content is rendered on the StockTickerViewModel
- internal interface IContentViewModelFactory
- {
- IStockTickerContentViewModel CreateContent(StockDetailModel detailModel);
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/IFutureValue.cs b/source/StockTicker/IFutureValue.cs
deleted file mode 100644
index bef3d28..0000000
--- a/source/StockTicker/IFutureValue.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker
-{
- // NOTE: Consumer interface for future value consumers.
- public interface IFutureValue
- {
- TValue Value { get; }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/IFutureValueSetter.cs b/source/StockTicker/IFutureValueSetter.cs
deleted file mode 100644
index d64c83b..0000000
--- a/source/StockTicker/IFutureValueSetter.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker
-{
- // NOTE: Consumer interface for future value providers
- public interface IFutureValueSetter
- {
- void SetValue(TValue value);
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/ConductStockTickerContent.cs b/source/StockTicker/ManageStocks/ConductStockTickerContent.cs
deleted file mode 100644
index 22cda38..0000000
--- a/source/StockTicker/ManageStocks/ConductStockTickerContent.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
-
- using Caliburn.Micro;
-
- using StockTicker.Externals;
-
- // NOTE: This IResult cannot be asynchronous because it conducts view models. View models must be created and conducted on the main dispatcher.
- internal class ConductStockTickerContent : IConductStockTickerContent
- {
- private readonly IFutureValue detailModel;
-
- private readonly Action conductor;
-
- private readonly IContentViewModelFactory contentFactory;
-
- // NOTE: Lazy initialized detail model is provided here.
- public ConductStockTickerContent(IFutureValue detailModel, Action conductor, IContentViewModelFactory contentFactory)
- {
- this.detailModel = detailModel;
- this.conductor = conductor;
- this.contentFactory = contentFactory;
- }
-
- public event EventHandler Completed = delegate { };
-
- public void Execute(ActionExecutionContext context)
- {
- // NOTE: We access the future value here
- IStockTickerContentViewModel contentViewModel = this.contentFactory.CreateContent(this.detailModel.Value);
- this.conductor(contentViewModel);
-
- this.Completed(this, new ResultCompletionEventArgs());
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/DollarConverter.cs b/source/StockTicker/ManageStocks/DollarConverter.cs
deleted file mode 100644
index 5c10c4c..0000000
--- a/source/StockTicker/ManageStocks/DollarConverter.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
- using System.Globalization;
- using System.Windows.Data;
-
- [ValueConversion(typeof(decimal), typeof(string))]
- public class DollarConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return string.Format(culture, "${0}", value);
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/GetStockDetails.cs b/source/StockTicker/ManageStocks/GetStockDetails.cs
deleted file mode 100644
index 02ad5a4..0000000
--- a/source/StockTicker/ManageStocks/GetStockDetails.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
-
- using Caliburn.Micro;
-
- using StockTicker.Actions;
- using StockTicker.Externals;
-
- // NOTE: Async annotation advices the action builder pipeline to wrap the IResult implementation with an asynchronous decorator.
- // This is especially in acceptance tests very flexible approach because the asynchronous execution can be removed during acceptance tests.
- [Async]
- internal class GetStockDetails : IGetStockDetails
- {
- private readonly string symbol;
-
- private readonly IFutureValueSetter detailModel;
-
- private readonly IStockService stockService;
-
- public GetStockDetails(IStockService stockService, string symbol, IFutureValueSetter detailModel)
- {
- if (string.IsNullOrEmpty(symbol))
- {
- throw new ArgumentNullException("symbol");
- }
-
- this.symbol = symbol;
- this.detailModel = detailModel;
- this.stockService = stockService;
- }
-
- public event EventHandler Completed = delegate { };
-
- public void Execute(ActionExecutionContext context)
- {
- StockDetailModel stockDetail = this.stockService.Get(this.symbol);
- this.detailModel.SetValue(stockDetail);
-
- this.Completed(this, new ResultCompletionEventArgs());
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/IConductStockTickerContent.cs b/source/StockTicker/ManageStocks/IConductStockTickerContent.cs
deleted file mode 100644
index c67d631..0000000
--- a/source/StockTicker/ManageStocks/IConductStockTickerContent.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using Caliburn.Micro;
-
- // NOTE: IResult which is responsible for conduction the StockTickerContent (either News or Details)
- public interface IConductStockTickerContent : IResult
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/IGetStockDetails.cs b/source/StockTicker/ManageStocks/IGetStockDetails.cs
deleted file mode 100644
index 861692f..0000000
--- a/source/StockTicker/ManageStocks/IGetStockDetails.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using Caliburn.Micro;
-
- // NOTE: IResult which fetches stock details from remote location.
- public interface IGetStockDetails : IResult
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/IStockDetailViewModel.cs b/source/StockTicker/ManageStocks/IStockDetailViewModel.cs
deleted file mode 100644
index b491a4e..0000000
--- a/source/StockTicker/ManageStocks/IStockDetailViewModel.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System.Collections.Generic;
-
- using Caliburn.Micro;
-
- using StockTicker.Actions;
- using StockTicker.Externals;
-
- internal interface IStockDetailViewModel : IStockTickerContentViewModel, IUseActions
- {
- StockDetailModel Model { get; }
-
- IEnumerable AddPortfolio();
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/ManageStocks.Designer.cs b/source/StockTicker/ManageStocks/ManageStocks.Designer.cs
deleted file mode 100644
index 806c226..0000000
--- a/source/StockTicker/ManageStocks/ManageStocks.Designer.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.261
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class ManageStocks {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal ManageStocks() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StockTicker.ManageStocks.ManageStocks", typeof(ManageStocks).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized string similar to Add to Alerts.
- ///
- internal static string AddAlerts {
- get {
- return ResourceManager.GetString("AddAlerts", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Add to Portfolio.
- ///
- internal static string AddPortfolio {
- get {
- return ResourceManager.GetString("AddPortfolio", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Average Daily Volume.
- ///
- internal static string AverageDailyVolume {
- get {
- return ResourceManager.GetString("AverageDailyVolume", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Daily Range.
- ///
- internal static string DailyRange {
- get {
- return ResourceManager.GetString("DailyRange", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Description.
- ///
- internal static string Description {
- get {
- return ResourceManager.GetString("Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to 52-Week Range.
- ///
- internal static string FiftyTwoWeekRange {
- get {
- return ResourceManager.GetString("FiftyTwoWeekRange", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Industry.
- ///
- internal static string Industry {
- get {
- return ResourceManager.GetString("Industry", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Previous Close.
- ///
- internal static string PreviousClose {
- get {
- return ResourceManager.GetString("PreviousClose", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Sector.
- ///
- internal static string Sector {
- get {
- return ResourceManager.GetString("Sector", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Today's Open.
- ///
- internal static string TodaysOpen {
- get {
- return ResourceManager.GetString("TodaysOpen", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Volume.
- ///
- internal static string Volume {
- get {
- return ResourceManager.GetString("Volume", resourceCulture);
- }
- }
- }
-}
diff --git a/source/StockTicker/ManageStocks/ManageStocks.resx b/source/StockTicker/ManageStocks/ManageStocks.resx
deleted file mode 100644
index 71d5e63..0000000
--- a/source/StockTicker/ManageStocks/ManageStocks.resx
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Add to Alerts
-
-
- Add to Portfolio
-
-
- Average Daily Volume
-
-
- Daily Range
-
-
- Description
-
-
- 52-Week Range
-
-
- Industry
-
-
- Previous Close
-
-
- Sector
-
-
- Today's Open
-
-
- Volume
-
-
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/ManageStocksExtensions.cs b/source/StockTicker/ManageStocks/ManageStocksExtensions.cs
deleted file mode 100644
index c5282b0..0000000
--- a/source/StockTicker/ManageStocks/ManageStocksExtensions.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
-
- using Caliburn.Micro;
-
- using StockTicker.Actions;
- using StockTicker.Externals;
-
- // NOTE: All extension methods here hide complexity of builder execution and provide more expressive and meaningful method names without generics.
- internal static class ManageStocksExtensions
- {
- public static IActionBuilder ConductContent(this IActionBuilder builder, IFutureValue detailModel, Conductor conductor)
- {
- return builder.Execute(new { detailModel, conductor = (Action)conductor.ActivateItem });
- }
-
- public static IActionBuilder ConductDefaultContent(this IActionBuilder builder, Conductor conductor)
- {
- var future = new Future();
- future.SetValue(null);
-
- return builder.ConductContent(future, conductor);
- }
-
- public static IActionBuilder GetDetails(this IActionBuilder builder, StockSearchModel searchModel, IFutureValueSetter detailModel)
- {
- return builder.Execute(new { symbol = searchModel.ToSymbol(), detailModel });
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/ManageStocksModule.cs b/source/StockTicker/ManageStocks/ManageStocksModule.cs
deleted file mode 100644
index b74669c..0000000
--- a/source/StockTicker/ManageStocks/ManageStocksModule.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using Ninject.Modules;
-
- public class ManageStocksModule : NinjectModule
- {
- public override void Load()
- {
- this.Bind().To();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/RangeToTextConverter.cs b/source/StockTicker/ManageStocks/RangeToTextConverter.cs
deleted file mode 100644
index 52791c8..0000000
--- a/source/StockTicker/ManageStocks/RangeToTextConverter.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
- using System.Globalization;
- using System.Windows.Data;
-
- using StockTicker.Externals;
-
- // NOTE: Special conversion should be done by using converters. Converters can be unit tested and simply attached in the XAML.
- [ValueConversion(typeof(Range), typeof(string))]
- public class RangeToTextConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- var range = value as Range;
-
- if (range != null)
- {
- return string.Format(culture, "${0} - ${1}", range.From, range.To);
- }
-
- return null;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/StockDetailModelToTitleConverter.cs b/source/StockTicker/ManageStocks/StockDetailModelToTitleConverter.cs
deleted file mode 100644
index 761cbf4..0000000
--- a/source/StockTicker/ManageStocks/StockDetailModelToTitleConverter.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
- using System.Globalization;
- using System.Windows.Data;
-
- using StockTicker.Externals;
-
- // NOTE: Special converter which combines the company, the fund and the symbol. Might be a good exercise.
- [ValueConversion(typeof(StockDetailModel), typeof(string))]
- public class StockDetailModelToTitleConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- var detailModel = value as StockDetailModel;
-
- if (detailModel != null)
- {
- return string.Format(
- culture,
- "{0}{1}{2}:{3}",
- detailModel.Company,
- Environment.NewLine,
- detailModel.Fund,
- detailModel.Symbol);
- }
-
- return null;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/StockDetailView.cs b/source/StockTicker/ManageStocks/StockDetailView.cs
deleted file mode 100644
index a5e76b0..0000000
--- a/source/StockTicker/ManageStocks/StockDetailView.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using StockTicker.Externals;
-
- // NOTE: Again cool fake data for view construction.
- public partial class StockDetailView
- {
- public static object SampleData
- {
- get
- {
- var detailViewModel = new StockDetailViewModel(new StockDetailModel("Symbol", "Company", "Fund", "Description", "Sector", "Industry", 10m, 10.05m, new Range(5.05m, 6.10m), new Range(4.00m, 10.50m), 10000, 20000));
-
- return detailViewModel;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/ManageStocks/StockDetailView.xaml b/source/StockTicker/ManageStocks/StockDetailView.xaml
deleted file mode 100644
index 9847612..0000000
--- a/source/StockTicker/ManageStocks/StockDetailView.xaml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/StockTicker/ManageStocks/StockDetailView.xaml.cs b/source/StockTicker/ManageStocks/StockDetailView.xaml.cs
deleted file mode 100644
index 825bc46..0000000
--- a/source/StockTicker/ManageStocks/StockDetailView.xaml.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System.Windows.Controls;
-
- ///
- /// Interaction logic for StockDetailView.xaml
- ///
- public partial class StockDetailView : UserControl
- {
- public StockDetailView()
- {
- this.InitializeComponent();
- }
- }
-}
diff --git a/source/StockTicker/ManageStocks/StockDetailViewModel.cs b/source/StockTicker/ManageStocks/StockDetailViewModel.cs
deleted file mode 100644
index 8ab8603..0000000
--- a/source/StockTicker/ManageStocks/StockDetailViewModel.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.ManageStocks
-{
- using System;
- using System.Collections.Generic;
-
- using Caliburn.Micro;
-
- using StockTicker.Actions;
- using StockTicker.Authentication;
- using StockTicker.Externals;
-
- // NOTE: Represents detail information about a stock. This has behavior and therefore can receive actions.
- internal class StockDetailViewModel : Screen, IStockDetailViewModel
- {
- public StockDetailViewModel(StockDetailModel detailModel)
- {
- this.Model = detailModel;
- }
-
- public Func Actions { private get; set; }
-
- // NOTE: Information about the details model are directly exposed as property and not wrapped. Violates law of demeter but is much simpler.
- public StockDetailModel Model { get; private set; }
-
- // NOTE: Bound to button add portfolio
- public IEnumerable AddPortfolio()
- {
- return this.Actions().WithLogin(builder => { });
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/News/HeadLinesView.xaml b/source/StockTicker/News/HeadLinesView.xaml
deleted file mode 100644
index d7d43c0..0000000
--- a/source/StockTicker/News/HeadLinesView.xaml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/StockTicker/News/HeadLinesViewModel.cs b/source/StockTicker/News/HeadLinesViewModel.cs
deleted file mode 100644
index fa5d387..0000000
--- a/source/StockTicker/News/HeadLinesViewModel.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.News
-{
- using Caliburn.Micro;
-
- // NOTE: Special news content which shows headlines.
- public class HeadlinesViewModel : Screen, INewsContentViewModel
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/News/INewsContentViewModel.cs b/source/StockTicker/News/INewsContentViewModel.cs
deleted file mode 100644
index 69db38c..0000000
--- a/source/StockTicker/News/INewsContentViewModel.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.News
-{
- using Caliburn.Micro;
-
- // NOTE: News content is essentially a pluggable news content area which can be retrieved from third party plugins.
- internal interface INewsContentViewModel : IScreen
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/News/INewsViewModel.cs b/source/StockTicker/News/INewsViewModel.cs
deleted file mode 100644
index 13757ce..0000000
--- a/source/StockTicker/News/INewsViewModel.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.News
-{
- internal interface INewsViewModel : IStockTickerContentViewModel
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/News/Images/Economy.jpg b/source/StockTicker/News/Images/Economy.jpg
deleted file mode 100644
index b1e900e..0000000
Binary files a/source/StockTicker/News/Images/Economy.jpg and /dev/null differ
diff --git a/source/StockTicker/News/Images/NewsPaper.jpg b/source/StockTicker/News/Images/NewsPaper.jpg
deleted file mode 100644
index 0636bea..0000000
Binary files a/source/StockTicker/News/Images/NewsPaper.jpg and /dev/null differ
diff --git a/source/StockTicker/News/Images/PersonalFinance.jpg b/source/StockTicker/News/Images/PersonalFinance.jpg
deleted file mode 100644
index c905e10..0000000
Binary files a/source/StockTicker/News/Images/PersonalFinance.jpg and /dev/null differ
diff --git a/source/StockTicker/News/Images/Retirement.jpg b/source/StockTicker/News/Images/Retirement.jpg
deleted file mode 100644
index 6008860..0000000
Binary files a/source/StockTicker/News/Images/Retirement.jpg and /dev/null differ
diff --git a/source/StockTicker/News/Images/SpecialReports.jpg b/source/StockTicker/News/Images/SpecialReports.jpg
deleted file mode 100644
index bff4428..0000000
Binary files a/source/StockTicker/News/Images/SpecialReports.jpg and /dev/null differ
diff --git a/source/StockTicker/News/Images/Spotlight.jpg b/source/StockTicker/News/Images/Spotlight.jpg
deleted file mode 100644
index 154f9f6..0000000
Binary files a/source/StockTicker/News/Images/Spotlight.jpg and /dev/null differ
diff --git a/source/StockTicker/News/Images/Taxes.jpg b/source/StockTicker/News/Images/Taxes.jpg
deleted file mode 100644
index 9f27c53..0000000
Binary files a/source/StockTicker/News/Images/Taxes.jpg and /dev/null differ
diff --git a/source/StockTicker/News/NewsModule.cs b/source/StockTicker/News/NewsModule.cs
deleted file mode 100644
index 0c023fe..0000000
--- a/source/StockTicker/News/NewsModule.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.News
-{
- using Ninject.Extensions.Conventions;
- using Ninject.Modules;
-
- public class NewsModule : NinjectModule
- {
- public override void Load()
- {
- this.Bind().To().InSingletonScope();
-
- this.Kernel.Bind(x =>
- x.FromThisAssembly()
- .IncludingNonePublicTypes()
- .SelectAllClasses()
- .InheritedFrom()
- .InNamespaceOf()
- .BindAllInterfaces()
- .Configure(c => c.InSingletonScope()));
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/News/NewsView.cs b/source/StockTicker/News/NewsView.cs
deleted file mode 100644
index 48f6ef2..0000000
--- a/source/StockTicker/News/NewsView.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.News
-{
- // NOTE: Explain nice trick with partial class and sample data providing. This allows to put sample data right where the actual view implementation is laying.
- public partial class NewsView
- {
- public static object SampleData
- {
- get
- {
- return null;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/News/NewsView.xaml b/source/StockTicker/News/NewsView.xaml
deleted file mode 100644
index 0002992..0000000
--- a/source/StockTicker/News/NewsView.xaml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/StockTicker/News/NewsView.xaml.cs b/source/StockTicker/News/NewsView.xaml.cs
deleted file mode 100644
index 7c850a0..0000000
--- a/source/StockTicker/News/NewsView.xaml.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.News
-{
- using System.Windows.Controls;
-
- ///
- /// Interaction logic for NewsView.xaml
- ///
- public partial class NewsView : UserControl
- {
- public NewsView()
- {
- this.InitializeComponent();
- }
- }
-}
diff --git a/source/StockTicker/News/NewsViewModel.cs b/source/StockTicker/News/NewsViewModel.cs
deleted file mode 100644
index eed9077..0000000
--- a/source/StockTicker/News/NewsViewModel.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.News
-{
- using System.Collections.Generic;
-
- using Caliburn.Micro;
-
- // NOTE: The news view model is a conductor with all collected items active. All news content is activated and displayed on the screen.
- internal class NewsViewModel : Conductor.Collection.AllActive, INewsViewModel
- {
- public NewsViewModel(IEnumerable news)
- {
- this.Items.AddRange(news);
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/News/PromotionView.xaml b/source/StockTicker/News/PromotionView.xaml
deleted file mode 100644
index 0081b87..0000000
--- a/source/StockTicker/News/PromotionView.xaml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- Surprising Job That Gets Many Americans Into the Millionaire Club
- Rules to Save By: Jean Chatzky Reveals Her Simple Money Tips
- How to 'Cheat' on Your Taxes ... Legally!
-
-
-
diff --git a/source/StockTicker/News/PromotionView.xaml.cs b/source/StockTicker/News/PromotionView.xaml.cs
deleted file mode 100644
index 97971a4..0000000
--- a/source/StockTicker/News/PromotionView.xaml.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-namespace StockTicker.News
-{
- using System.Windows.Controls;
-
- ///
- /// Interaction logic for PromotionView.xaml
- ///
- public partial class PromotionView : UserControl
- {
- public PromotionView()
- {
- this.InitializeComponent();
- }
- }
-}
diff --git a/source/StockTicker/News/PromotionViewModel.cs b/source/StockTicker/News/PromotionViewModel.cs
deleted file mode 100644
index 8b6100d..0000000
--- a/source/StockTicker/News/PromotionViewModel.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.News
-{
- using Caliburn.Micro;
-
- // NOTE: Special news content view model which shows tickers and promotions.
- public class PromotionViewModel : Screen, INewsContentViewModel
- {
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/StaticContentView.xaml b/source/StockTicker/StaticContentView.xaml
new file mode 100644
index 0000000..6b76cdf
--- /dev/null
+++ b/source/StockTicker/StaticContentView.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/source/StockTicker/News/HeadLinesView.xaml.cs b/source/StockTicker/StaticContentView.xaml.cs
similarity index 78%
rename from source/StockTicker/News/HeadLinesView.xaml.cs
rename to source/StockTicker/StaticContentView.xaml.cs
index 6c2b8d3..1242a80 100644
--- a/source/StockTicker/News/HeadLinesView.xaml.cs
+++ b/source/StockTicker/StaticContentView.xaml.cs
@@ -1,5 +1,5 @@
//-------------------------------------------------------------------------------
-//
+//
// Copyright (c) 2012
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,16 +16,16 @@
//
//-------------------------------------------------------------------------------
-namespace StockTicker.News
+namespace StockTicker
{
using System.Windows.Controls;
///
- /// Interaction logic for HeadLinesView.xaml
+ /// Interaction logic for StaticContentView.xaml
///
- public partial class HeadlinesView : UserControl
+ public partial class StaticContentView : UserControl
{
- public HeadlinesView()
+ public StaticContentView()
{
this.InitializeComponent();
}
diff --git a/source/StockTicker/Authentication/IAuthenticationViewModel.cs b/source/StockTicker/StaticContentViewModel.cs
similarity index 81%
rename from source/StockTicker/Authentication/IAuthenticationViewModel.cs
rename to source/StockTicker/StaticContentViewModel.cs
index 27c6a74..79cdc31 100644
--- a/source/StockTicker/Authentication/IAuthenticationViewModel.cs
+++ b/source/StockTicker/StaticContentViewModel.cs
@@ -1,5 +1,5 @@
//-------------------------------------------------------------------------------
-//
+//
// Copyright (c) 2012
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,11 +16,11 @@
//
//-------------------------------------------------------------------------------
-namespace StockTicker.Authentication
+namespace StockTicker
{
using Caliburn.Micro;
- internal interface IAuthenticationViewModel : IConductor
+ internal class StaticContentViewModel : Screen, IStockTickerContentViewModel
{
}
}
\ No newline at end of file
diff --git a/source/StockTicker/StockTicker.csproj b/source/StockTicker/StockTicker.csproj
index bc56afe..6edfd61 100644
--- a/source/StockTicker/StockTicker.csproj
+++ b/source/StockTicker/StockTicker.csproj
@@ -4,37 +4,44 @@
StockTicker
Source
/assemblycomparemode:StrongNameIgnoringVersion
+ ..\
+ true
{ECE87891-83C1-4CB9-A253-3EA7D1914269}
WinExe
-
- ..\packages\Caliburn.Micro\lib\net40\Caliburn.Micro.dll
+
+ False
+ ..\packages\Caliburn.Micro.1.5.1\lib\net40\Caliburn.Micro.dll
- ..\packages\Castle.Core.\lib\net40-client\Castle.Core.dll
+ ..\packages\Castle.Core.3.0.0.4001\lib\net40-client\Castle.Core.dll
-
- ..\packages\FluentValidation\lib\Net40\FluentValidation.dll
+
+ False
+ ..\packages\FluentValidation.3.4.6.0\lib\Net40\FluentValidation.dll
- ..\packages\Ninject\lib\net40\Ninject.dll
+ False
+ ..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll
- ..\packages\ninject.extensions.conventions\lib\net40\Ninject.Extensions.Conventions.dll
+ False
+ ..\packages\ninject.extensions.conventions.3.0.0.11\lib\net40\Ninject.Extensions.Conventions.dll
- ..\packages\Ninject.Extensions.Factory\lib\net40\Ninject.Extensions.Factory.dll
+ ..\packages\Ninject.Extensions.Factory.3.0.1.0\lib\net40\Ninject.Extensions.Factory.dll
-
- ..\packages\Caliburn.Micro\lib\net40\System.Windows.Interactivity.dll
+
+ False
+ ..\packages\Caliburn.Micro.1.5.1\lib\net40\System.Windows.Interactivity.dll
@@ -44,18 +51,24 @@
4.0
-
- ..\packages\thinktectureUIAnnotationsWPF\lib\Thinktecture.UIAnnotations.dll
+
+ False
+ ..\packages\thinktectureUIAnnotationsWPF.0.10\lib\Thinktecture.UIAnnotations.dll
- ..\packages\WpfLocalizeExtension\lib\WPFLocalizeExtension.dll
+ ..\packages\WpfLocalizeExtension.2.1.2\lib\net35\WPFLocalizeExtension.dll
-
- False
- ..\packages\Extended.Wpf.Toolkit\lib\net40\WPFToolkit.Extended.dll
+
+ ..\packages\XAMLMarkupExtensions.1.1.5\lib\net40\XAMLMarkupExtensions.dll
+
+
+ ..\packages\Extended.Wpf.Toolkit.1.9.0\lib\net40\Xceed.Wpf.DataGrid.dll
+
+
+ ..\packages\Extended.Wpf.Toolkit.1.9.0\lib\net40\Xceed.Wpf.Toolkit.dll
@@ -98,42 +111,8 @@
-
-
- True
- True
- Authentication.resx
-
-
-
-
-
-
-
-
-
- ChooseUserNameView.xaml
-
-
-
- ChoosePasswordView.xaml
-
-
-
-
-
-
-
-
-
- AuthenticationView.xaml
-
-
-
-
-
+
-
@@ -168,11 +147,7 @@
SearchView.xaml
-
-
-
-
@@ -181,42 +156,6 @@
-
-
-
-
-
-
-
- True
- True
- ManageStocks.resx
-
-
-
-
-
-
-
- StockDetailView.xaml
-
-
-
- HeadlinesView.xaml
-
-
-
-
-
-
-
- NewsView.xaml
-
-
-
- PromotionView.xaml
-
-
@@ -224,6 +163,10 @@
True
General.resx
+
+ StaticContentView.xaml
+
+
StockTickerView.xaml
@@ -235,8 +178,6 @@
-
-
@@ -256,18 +197,10 @@
ResXFileCodeGenerator
Actions.Designer.cs
-
- ResXFileCodeGenerator
- Authentication.Designer.cs
-
ResXFileCodeGenerator
FindStocks.Designer.cs
-
- ResXFileCodeGenerator
- ManageStocks.Designer.cs
-
ResXFileCodeGenerator
Resources.Designer.cs
@@ -285,15 +218,7 @@
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
+
MSBuild:Compile
Designer
@@ -313,42 +238,12 @@
Designer
MSBuild:Compile
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
Designer
MSBuild:Compile
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/source/StockTicker/StockTickerModule.cs b/source/StockTicker/StockTickerModule.cs
index 92a941b..fb35beb 100644
--- a/source/StockTicker/StockTickerModule.cs
+++ b/source/StockTicker/StockTickerModule.cs
@@ -24,7 +24,6 @@ public class StockTickerModule : NinjectModule
{
public override void Load()
{
- this.Bind().To().InSingletonScope();
this.Bind().To().InSingletonScope();
}
}
diff --git a/source/StockTicker/StockTickerView.xaml b/source/StockTicker/StockTickerView.xaml
index e7ef0d7..8e3ef75 100644
--- a/source/StockTicker/StockTickerView.xaml
+++ b/source/StockTicker/StockTickerView.xaml
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:l="http://schemas.root-project.org/xaml/presentation"
+ xmlns:l="http://wpflocalizeextension.codeplex.com"
xmlns:cal="http://www.caliburnproject.org"
xmlns:FindStocks="clr-namespace:StockTicker.FindStocks" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
@@ -18,7 +18,7 @@
+ Text="{l:Loc StockTicker:Actions.Actions:Loading}" />
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Validation
-{
- using FluentValidation;
-
- using Ninject.Modules;
-
- public class ValidationModule : NinjectModule
- {
- public override void Load()
- {
- this.Bind().To().InSingletonScope();
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/Validation/ValidatorFactory.cs b/source/StockTicker/Validation/ValidatorFactory.cs
deleted file mode 100644
index 5530183..0000000
--- a/source/StockTicker/Validation/ValidatorFactory.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//-------------------------------------------------------------------------------
-//
-// Copyright (c) 2012
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-------------------------------------------------------------------------------
-
-namespace StockTicker.Validation
-{
- using System;
-
- using FluentValidation;
-
- using Ninject;
- using Ninject.Syntax;
-
- // NOTE: This factory plugs into fluent validation and allows to build up validators with ninject. (Detail, not really important).
- public class ValidatorFactory : IValidatorFactory
- {
- private readonly IResolutionRoot resolutionRoot;
-
- public ValidatorFactory(IResolutionRoot resolutionRoot)
- {
- this.resolutionRoot = resolutionRoot;
- }
-
- public IValidator GetValidator()
- {
- return this.resolutionRoot.Get>();
- }
-
- public IValidator GetValidator(Type type)
- {
- var validatorType = typeof(IValidator<>).MakeGenericType(type);
-
- return (IValidator)this.resolutionRoot.Get(validatorType);
- }
- }
-}
\ No newline at end of file
diff --git a/source/StockTicker/packages.config b/source/StockTicker/packages.config
index 91a1258..4b5c9ce 100644
--- a/source/StockTicker/packages.config
+++ b/source/StockTicker/packages.config
@@ -1,12 +1,13 @@
-
+
-
-
-
+
+
+
-
+
-
+
+
\ No newline at end of file