Kaynağa Gözat

增加tree模块用于设计行为树

tanghai 14 yıl önce
ebeveyn
işleme
06dc286557

+ 13 - 0
CSharp/CSharp.sln

@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Login", "Modules\LoginModul
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "Infrastructure\Infrastructure.csproj", "{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TreeCanvas", "Modules\TreeCanvas\TreeCanvas.csproj", "{6CD185D1-08E0-4729-A999-2D5B57BA8193}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -49,11 +51,22 @@ Global
 		{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
 		{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}.Release|x86.ActiveCfg = Release|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
 		{7CC7BF9C-13BE-470E-BC35-6A1944767899} = {C4C64188-4FAE-4CC3-A9E6-D9D4AF7429B6}
+		{6CD185D1-08E0-4729-A999-2D5B57BA8193} = {C4C64188-4FAE-4CC3-A9E6-D9D4AF7429B6}
 	EndGlobalSection
 EndGlobal

+ 2 - 0
CSharp/Editor/Bootstrapper.cs

@@ -4,6 +4,7 @@ using Microsoft.Practices.Prism.MefExtensions;
 using Module.Login;
 using Infrastructure;
 using Microsoft.Practices.Prism.Regions;
+using Module.TreeCanvas;
 
 namespace Editor
 {
@@ -14,6 +15,7 @@ namespace Editor
 			this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Bootstrapper).Assembly));
 			this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ViewExportAttribute).Assembly));
 			this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(LoginModule).Assembly));
+			this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(TreeCanvasModule).Assembly));
 		}
 
 		protected override void ConfigureContainer()

+ 4 - 0
CSharp/Editor/Editor.csproj

@@ -97,6 +97,10 @@
       <Project>{7CC7BF9C-13BE-470E-BC35-6A1944767899}</Project>
       <Name>Login</Name>
     </ProjectReference>
+    <ProjectReference Include="..\Modules\TreeCanvas\TreeCanvas.csproj">
+      <Project>{6CD185D1-08E0-4729-A999-2D5B57BA8193}</Project>
+      <Name>TreeCanvas</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
     <None Include="NLog.config">

+ 5 - 5
CSharp/Editor/Shell.xaml

@@ -1,9 +1,9 @@
 <Window x:Class="Editor.Shell"
-	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-	xmlns:cal="http://www.codeplex.com/CompositeWPF"
-	xmlns:prism="http://www.codeplex.com/prism"
-	Title="Editor" Height="600" Width="800" WindowStartupLocation="CenterScreen">
+		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+		xmlns:cal="http://www.codeplex.com/CompositeWPF"
+		xmlns:prism="http://www.codeplex.com/prism"
+		Title="Editor" Height="600" Width="800" WindowStartupLocation="CenterScreen">
 	<Grid>
 		<StackPanel>
 			<ContentControl Name="mainRegion" prism:RegionManager.RegionName="MainRegion" />

+ 7 - 0
CSharp/Modules/TreeCanvas/Packages.config

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+	<package id="CommonServiceLocator" version="1.0" />
+	<package id="NLog" version="2.0.0.2000" />
+	<package id="Prism" version="4.0.0.0" />
+	<package id="Prism.MEFExtensions" version="4.0.0.0" />
+</packages>

+ 92 - 0
CSharp/Modules/TreeCanvas/TreeCanvas.csproj

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{6CD185D1-08E0-4729-A999-2D5B57BA8193}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>TreeCanvas</RootNamespace>
+    <AssemblyName>TreeCanvas</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Practices.Prism">
+      <HintPath>..\..\Packages\Prism.4.0.0.0\lib\NET40\Microsoft.Practices.Prism.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Practices.Prism.Interactivity">
+      <HintPath>..\..\Packages\Prism.4.0.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Practices.Prism.MefExtensions">
+      <HintPath>..\..\Packages\Prism.MEFExtensions.4.0.0.0\lib\NET40\Microsoft.Practices.Prism.MefExtensions.dll</HintPath>
+    </Reference>
+    <Reference Include="NLog">
+      <HintPath>..\..\Packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
+    </Reference>
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.Composition" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xaml" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="TreeCanvasModule.cs" />
+    <Compile Include="TreeCanvasView.xaml.cs">
+      <DependentUpon>TreeCanvasView.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="TreeCanvasViewModel.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Properties\" />
+  </ItemGroup>
+  <ItemGroup>
+    <Page Include="TreeCanvasView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Infrastructure\Infrastructure.csproj">
+      <Project>{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}</Project>
+      <Name>Infrastructure</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Packages.config" />
+  </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.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 13 - 0
CSharp/Modules/TreeCanvas/TreeCanvasModule.cs

@@ -0,0 +1,13 @@
+using Microsoft.Practices.Prism.MefExtensions.Modularity;
+using Microsoft.Practices.Prism.Modularity;
+
+namespace Module.TreeCanvas
+{
+	[ModuleExport(typeof(TreeCanvasModule))]
+	public class TreeCanvasModule : IModule
+	{
+		public void Initialize()
+		{
+		}
+	}
+}

+ 11 - 0
CSharp/Modules/TreeCanvas/TreeCanvasView.xaml

@@ -0,0 +1,11 @@
+<UserControl x:Class="Module.TreeCanvas.TreeCanvasView"
+		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+		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" 
+		mc:Ignorable="d" 
+		d:DesignHeight="300" d:DesignWidth="300">
+	<Grid>
+
+	</Grid>
+</UserControl>

+ 44 - 0
CSharp/Modules/TreeCanvas/TreeCanvasView.xaml.cs

@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.ComponentModel.Composition;
+using Infrastructure;
+
+namespace Module.TreeCanvas
+{
+	/// <summary>
+	/// TreeCanvasView.xaml 的交互逻辑
+	/// </summary>
+	[ViewExport(RegionName = "TreeCanvasRegion")]
+	[PartCreationPolicy(CreationPolicy.NonShared)]
+	public partial class TreeCanvasView : UserControl
+	{
+		public TreeCanvasView()
+		{
+			InitializeComponent();
+		}
+
+		[Import]
+		TreeCanvasViewModel ViewModel
+		{
+			get
+			{
+				return this.DataContext as TreeCanvasViewModel;
+			}
+			set
+			{
+				this.DataContext = value;
+			}
+		}
+	}
+}

+ 11 - 0
CSharp/Modules/TreeCanvas/TreeCanvasViewModel.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Module.TreeCanvas
+{
+	class TreeCanvasViewModel
+	{
+	}
+}