diff options
| author | Jason Lepp <jlepp@arcresources.com> | 2010-10-14 16:44:20 -0600 |
|---|---|---|
| committer | Jason Lepp <jlepp@arcresources.com> | 2010-10-14 16:44:20 -0600 |
| commit | 089aeadfcd4819c051e56c26e89ab453851d1216 (patch) | |
| tree | 57324249efd26af4efc32de755718a96869e16a4 | |
| parent | 6ee5411f93f7534691492963a9b9c478575edb1e (diff) | |
Begin adding repos, domain and StructureMap
| -rwxr-xr-x | MVPtoMVVM.mvp.sln | 22 | ||||
| -rwxr-xr-x | lib/StructureMap/StructureMap.dll | bin | 0 -> 245760 bytes | |||
| -rwxr-xr-x | src/MVPtoMVVM.mvp/App.xaml | 2 | ||||
| -rwxr-xr-x | src/MVPtoMVVM.mvp/Bootstrap.cs | 21 | ||||
| -rwxr-xr-x | src/MVPtoMVVM.mvp/MVPtoMVVM.mvp.csproj | 16 | ||||
| -rwxr-xr-x | src/MVPtoMVVM.mvp/MvpWindow.xaml | 9 | ||||
| -rwxr-xr-x | src/MVPtoMVVM.mvp/MvpWindow.xaml.cs | 10 | ||||
| -rwxr-xr-x | src/MVPtoMVVM/MVPtoMVVM.csproj | 4 | ||||
| -rwxr-xr-x | src/MVPtoMVVM/domain/TodoItem.cs | 10 | ||||
| -rwxr-xr-x | src/MVPtoMVVM/repositories/IRepository.cs | 12 | ||||
| -rwxr-xr-x | src/MVPtoMVVM/repositories/TodoItemRepository.cs | 26 |
11 files changed, 127 insertions, 5 deletions
diff --git a/MVPtoMVVM.mvp.sln b/MVPtoMVVM.mvp.sln index d1ff756..72e071e 100755 --- a/MVPtoMVVM.mvp.sln +++ b/MVPtoMVVM.mvp.sln @@ -3,16 +3,38 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MVPtoMVVM.mvp", "src\MVPtoMVVM.mvp\MVPtoMVVM.mvp.csproj", "{01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MVPtoMVVM", "src\MVPtoMVVM\MVPtoMVVM.csproj", "{FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Debug|Mixed Platforms.Build.0 = Debug|x86
{01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Debug|x86.ActiveCfg = Debug|x86
{01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Debug|x86.Build.0 = Debug|x86
+ {01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Release|Any CPU.ActiveCfg = Release|x86
+ {01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Release|Mixed Platforms.Build.0 = Release|x86
{01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Release|x86.ActiveCfg = Release|x86
{01F8F0EA-64F3-4A1C-B5BF-C0CD4BD3CA8B}.Release|x86.Build.0 = Release|x86
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/lib/StructureMap/StructureMap.dll b/lib/StructureMap/StructureMap.dll Binary files differnew file mode 100755 index 0000000..6e4af21 --- /dev/null +++ b/lib/StructureMap/StructureMap.dll diff --git a/src/MVPtoMVVM.mvp/App.xaml b/src/MVPtoMVVM.mvp/App.xaml index 8f60c76..d4abb02 100755 --- a/src/MVPtoMVVM.mvp/App.xaml +++ b/src/MVPtoMVVM.mvp/App.xaml @@ -1,7 +1,7 @@ <Application x:Class="MVPtoMVVM.mvp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- StartupUri="MainWindow.xaml">
+ StartupUri="MvpWindow.xaml">
<Application.Resources>
</Application.Resources>
diff --git a/src/MVPtoMVVM.mvp/Bootstrap.cs b/src/MVPtoMVVM.mvp/Bootstrap.cs new file mode 100755 index 0000000..5b27753 --- /dev/null +++ b/src/MVPtoMVVM.mvp/Bootstrap.cs @@ -0,0 +1,21 @@ +using MVPtoMVVM.domain;
+using StructureMap;
+
+namespace MVPtoMVVM.mvp
+{
+ public class Bootstrap
+ {
+ public void Execute()
+ {
+ ObjectFactory.Initialize(x =>
+ {
+ x.Scan(scanner =>
+ {
+ scanner.AssemblyContainingType(typeof(TodoItem));
+
+ });
+ });
+
+ }
+ }
+}
\ No newline at end of file diff --git a/src/MVPtoMVVM.mvp/MVPtoMVVM.mvp.csproj b/src/MVPtoMVVM.mvp/MVPtoMVVM.mvp.csproj index fbcd33d..43fdbc4 100755 --- a/src/MVPtoMVVM.mvp/MVPtoMVVM.mvp.csproj +++ b/src/MVPtoMVVM.mvp/MVPtoMVVM.mvp.csproj @@ -36,6 +36,9 @@ <WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="StructureMap">
+ <HintPath>..\..\lib\StructureMap\StructureMap.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
@@ -55,7 +58,7 @@ <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
- <Page Include="MainWindow.xaml">
+ <Page Include="MvpWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -63,8 +66,9 @@ <DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
- <Compile Include="MainWindow.xaml.cs">
- <DependentUpon>MainWindow.xaml</DependentUpon>
+ <Compile Include="Bootstrap.cs" />
+ <Compile Include="MvpWindow.xaml.cs">
+ <DependentUpon>MvpWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
@@ -92,6 +96,12 @@ </None>
<AppDesigner Include="Properties\" />
</ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\MVPtoMVVM\MVPtoMVVM.csproj">
+ <Project>{FFF299F6-DB6A-4858-B7A9-B5BE3F7C6325}</Project>
+ <Name>MVPtoMVVM</Name>
+ </ProjectReference>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/src/MVPtoMVVM.mvp/MvpWindow.xaml b/src/MVPtoMVVM.mvp/MvpWindow.xaml new file mode 100755 index 0000000..873db7d --- /dev/null +++ b/src/MVPtoMVVM.mvp/MvpWindow.xaml @@ -0,0 +1,9 @@ +<Window x:Class="MVPtoMVVM.mvp.MvpWindow"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ Title="MainWindow" Height="350" Width="525">
+ <StackPanel>
+ <DataGrid AutoGenerateColumns="True" Name="todoItemsGrid">
+ </DataGrid>
+ </StackPanel>
+</Window>
diff --git a/src/MVPtoMVVM.mvp/MvpWindow.xaml.cs b/src/MVPtoMVVM.mvp/MvpWindow.xaml.cs new file mode 100755 index 0000000..27a6ff3 --- /dev/null +++ b/src/MVPtoMVVM.mvp/MvpWindow.xaml.cs @@ -0,0 +1,10 @@ +namespace MVPtoMVVM.mvp
+{
+ public partial class MvpWindow
+ {
+ public MvpWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/MVPtoMVVM/MVPtoMVVM.csproj b/src/MVPtoMVVM/MVPtoMVVM.csproj index a6b4aab..f44d42e 100755 --- a/src/MVPtoMVVM/MVPtoMVVM.csproj +++ b/src/MVPtoMVVM/MVPtoMVVM.csproj @@ -40,8 +40,10 @@ <Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Class1.cs" />
+ <Compile Include="domain\TodoItem.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="repositories\IRepository.cs" />
+ <Compile Include="repositories\TodoItemRepository.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/src/MVPtoMVVM/domain/TodoItem.cs b/src/MVPtoMVVM/domain/TodoItem.cs new file mode 100755 index 0000000..0170b98 --- /dev/null +++ b/src/MVPtoMVVM/domain/TodoItem.cs @@ -0,0 +1,10 @@ +using System;
+
+namespace MVPtoMVVM.domain
+{
+ public class TodoItem
+ {
+ public string Description { get; set; }
+ public DateTime DueDate { get; set; }
+ }
+}
\ No newline at end of file diff --git a/src/MVPtoMVVM/repositories/IRepository.cs b/src/MVPtoMVVM/repositories/IRepository.cs new file mode 100755 index 0000000..3593a02 --- /dev/null +++ b/src/MVPtoMVVM/repositories/IRepository.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic;
+using MVPtoMVVM.domain;
+
+namespace MVPtoMVVM.repositories
+{
+ public interface ITodoItemRepository
+ {
+ void Add(TodoItem item);
+ TodoItem Get(string description);
+ IEnumerable<TodoItem> GetAll();
+ }
+}
\ No newline at end of file diff --git a/src/MVPtoMVVM/repositories/TodoItemRepository.cs b/src/MVPtoMVVM/repositories/TodoItemRepository.cs new file mode 100755 index 0000000..fab5e1a --- /dev/null +++ b/src/MVPtoMVVM/repositories/TodoItemRepository.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic;
+using MVPtoMVVM.domain;
+using System.Linq;
+
+namespace MVPtoMVVM.repositories
+{
+ class TodoItemRepository : ITodoItemRepository
+ {
+ private List<TodoItem> items = new List<TodoItem>();
+
+ public void Add(TodoItem item)
+ {
+ items.Add(item);
+ }
+
+ public TodoItem Get(string description)
+ {
+ return items.FirstOrDefault(x => x.Description == description);
+ }
+
+ public IEnumerable<TodoItem> GetAll()
+ {
+ return items.AsEnumerable();
+ }
+ }
+}
\ No newline at end of file |
