Jelajahi Sumber

1.增加编辑节点数据功能
2.不同节点显示不同的颜色

tanghai 11 tahun lalu
induk
melakukan
fc90820a14

+ 52 - 9
CSharp/App/Modules/Tree/BehaviorTreeView.xaml

@@ -2,18 +2,36 @@
 		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:BehaviorTree="clr-namespace:Tree" 
+		xmlns:Tree="clr-namespace:Tree"
 		x:Class="Tree.BehaviorTreeView"
 		mc:Ignorable="d" 
-		d:DesignHeight="600" 
-		d:DesignWidth="800" 
-		d:DataContext="{d:DesignInstance BehaviorTree:BehaviorTreeViewModel}">
+		d:DesignHeight="800" 
+		d:DesignWidth="1280" 
+		d:DataContext="{d:DesignInstance Tree:BehaviorTreeViewModel}">
 	<UserControl.Resources>
-		<LinearGradientBrush x:Key="treeNodeFillBrush" StartPoint="0,0" EndPoint="0,1">
+		<LinearGradientBrush x:Key="treeNodeSelectorFillBrush" StartPoint="0,0" EndPoint="0,1">
 			<GradientStop Color="White" Offset="0" />
-			<GradientStop Color="#7FC9FF" Offset="0.6" />
+			<GradientStop Color="#FFF37FFF" Offset="0.6" />
+		</LinearGradientBrush>
+		<LinearGradientBrush x:Key="treeNodeOtherFillBrush" StartPoint="0,0" EndPoint="0,1">
+			<GradientStop Color="White" Offset="0" />
+			<GradientStop Color="#FFF59202" Offset="0.6" />
+		</LinearGradientBrush>
+		<LinearGradientBrush x:Key="treeNodeActionFillBrush" StartPoint="0,0" EndPoint="0,1">
+			<GradientStop Color="White" Offset="0" />
+			<GradientStop Color="#FF06F31C" Offset="0.6" />
+		</LinearGradientBrush>
+		<LinearGradientBrush x:Key="treeNodeSequenceFillBrush" StartPoint="0,0" EndPoint="0,1">
+			<GradientStop Color="White" Offset="0" />
+			<GradientStop Color="#FFF3EF91" Offset="0.6" />
+		</LinearGradientBrush>
+		<LinearGradientBrush x:Key="treeNodeConditionFillBrush" StartPoint="0,0" EndPoint="0,1">
+			<GradientStop Color="White" Offset="0" />
+			<GradientStop Color="#FF06CBF7" Offset="0.6" />
 		</LinearGradientBrush>
 		<SolidColorBrush x:Key="treeNodeBorderBrush" Color="Black" />
+		<Tree:NodeTypeColorConverter x:Key="NodeTypeColorConverter"/>
+		<Tree:NodeTypeToStringConverter x:Key="NodeTypeToStringConverter"/>
 	</UserControl.Resources>
 
 	<UserControl.CommandBindings>
@@ -36,6 +54,10 @@
 		</ContextMenu>
 	</UserControl.ContextMenu>
 	<Grid>
+		<Grid.ColumnDefinitions>
+			<ColumnDefinition Width="5*"/>
+			<ColumnDefinition Width="*"/>
+		</Grid.ColumnDefinitions>
 		<ListBox Name="listBox" SelectionMode="Single" ItemsSource="{Binding TreeNodes}">
 			<ListBox.Resources>
 				<Style TargetType="{x:Type ListBoxItem}">
@@ -49,13 +71,16 @@
 				</ItemsPanelTemplate>
 			</ListBox.ItemsPanel>
 			<ListBox.ItemTemplate>
-				<DataTemplate DataType="BehaviorTree:TreeNodeViewModel">
+				<DataTemplate DataType="Tree:TreeNodeViewModel">
 					<Canvas MouseDown="ListBoxItem_MouseDown" MouseUp="ListBoxItem_MouseUp" MouseMove="ListBoxItem_MouseMove"
 							PreviewMouseLeftButtonDown="ListBoxItem_PreviewMouseLeftButtonDown"
 							PreviewMouseLeftButtonUp="ListBoxItem_PreviewMouseLeftButtonUp">
 						<Rectangle Name="rectNode" Width="{Binding Width}" Height="{Binding Height}" Cursor="Hand" StrokeThickness="2"
-								RadiusX="40" RadiusY="40" Stroke="{StaticResource treeNodeBorderBrush}" Fill="{StaticResource treeNodeFillBrush}"/>
-						<Label Content="{Binding Id}" Canvas.Left="20" Canvas.Top="15"></Label>
+								RadiusX="10" RadiusY="10" Stroke="{StaticResource treeNodeBorderBrush}" Fill="{StaticResource treeNodeSelectorFillBrush}"/>
+						<StackPanel>
+							<Label Content="{Binding Type, Converter={StaticResource NodeTypeToStringConverter}}" ></Label>
+							<Label Content="{Binding Comment}" ></Label>
+						</StackPanel>
 						<Line X1="{Binding ConnectorX1}" Y1="{Binding ConnectorY1}" X2="{Binding ConnectorX2}" Y2="{Binding ConnectorY2}"
 								Stroke="Black" StrokeThickness="2"  />
 					</Canvas>
@@ -63,9 +88,27 @@
 						<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
 							<Setter TargetName="rectNode" Property="Stroke" Value="Green" />
 						</DataTrigger>
+						<DataTrigger Binding="{Binding Type, Converter={StaticResource NodeTypeColorConverter}}" Value="selector">
+							<Setter TargetName="rectNode" Property="Fill" Value="{StaticResource treeNodeSelectorFillBrush}" />
+						</DataTrigger>
+						<DataTrigger Binding="{Binding Type, Converter={StaticResource NodeTypeColorConverter}}" Value="sequence">
+							<Setter TargetName="rectNode" Property="Fill" Value="{StaticResource treeNodeSequenceFillBrush}" />
+						</DataTrigger>
+						<DataTrigger Binding="{Binding Type, Converter={StaticResource NodeTypeColorConverter}}" Value="condition">
+							<Setter TargetName="rectNode" Property="Fill" Value="{StaticResource treeNodeConditionFillBrush}" />
+						</DataTrigger>
+						<DataTrigger Binding="{Binding Type, Converter={StaticResource NodeTypeColorConverter}}" Value="action">
+							<Setter TargetName="rectNode" Property="Fill" Value="{StaticResource treeNodeActionFillBrush}" />
+						</DataTrigger>
+						<DataTrigger Binding="{Binding Type, Converter={StaticResource NodeTypeColorConverter}}" Value="other">
+							<Setter TargetName="rectNode" Property="Fill" Value="{StaticResource treeNodeOtherFillBrush}" />
+						</DataTrigger>
 					</DataTemplate.Triggers>
 				</DataTemplate>
 			</ListBox.ItemTemplate>
 		</ListBox>
+		<StackPanel Grid.Column="1">
+			<Tree:NodeDataEditor x:Name="nodeDataEditor" />
+		</StackPanel>
 	</Grid>
 </UserControl>

+ 4 - 2
CSharp/App/Modules/Tree/BehaviorTreeView.xaml.cs

@@ -44,7 +44,7 @@ namespace Tree
 			// one root node
 			if (this.ViewModel.TreeNodes.Count == 0)
 			{
-				var addTreeNode = new TreeNodeViewModel(point.X, point.Y);
+				var addTreeNode = new TreeNodeViewModel(point.X, point.Y) { Type = (int) NodeType.Selector };
 				this.ViewModel.Add(addTreeNode, null);
 			}
 			else
@@ -52,7 +52,7 @@ namespace Tree
 				if (this.listBox.SelectedItem != null)
 				{
 					var parentNode = this.listBox.SelectedItem as TreeNodeViewModel;
-					var addTreeNode = new TreeNodeViewModel(parentNode);
+					var addTreeNode = new TreeNodeViewModel(parentNode) { Type = (int) NodeType.Selector };
 					this.ViewModel.Add(addTreeNode, parentNode);
 				}
 			}
@@ -181,6 +181,8 @@ namespace Tree
 
 			this.listBox.SelectedItem = treeNodeViewModel;
 			this.moveFromNode = treeNodeViewModel;
+
+			this.nodeDataEditor.DataContext = treeNodeViewModel;
 		}
 
 		private void ListBoxItem_PreviewMouseLeftButtonUp(object sender, MouseEventArgs e)

+ 33 - 0
CSharp/App/Modules/Tree/ListToStringConverter.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Windows.Data;
+
+namespace Tree
+{
+	[ValueConversion(typeof(List<string>), typeof(string))]
+	public class ListToStringConverter : IValueConverter
+	{
+		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+		{
+			if (value == null)
+			{
+				return "";
+			}
+			var list = (List<string>) value;
+			return String.Join(",", list);
+		}
+
+		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+		{
+			if (value == null)
+			{
+				return new List<string>();
+			}
+			var s = (string) value;
+			string[] ss = s.Split(',');
+			return ss.ToList();
+		}
+	}
+}

+ 22 - 21
CSharp/App/Modules/Tree/NodeDataEditor.xaml

@@ -1,30 +1,31 @@
-<UserControl x:Class="Modules.Tree.NodeDataEditor"
+<UserControl x:Class="Tree.NodeDataEditor"
              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" Height="217" Width="211">
-	<Grid Margin="0,0,10,10">
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:tree="clr-namespace:Tree"
+             mc:Ignorable="d" Height="198" Width="211" DataContextChanged="OnDataContextChanged">
+	<UserControl.Resources>
+		<tree:ListToStringConverter x:Key="ListToStringConverter"/>
+	</UserControl.Resources>
+	<Grid VerticalAlignment="Stretch">
 		<Grid.RowDefinitions>
-			<RowDefinition/>
-			<RowDefinition/>
-			<RowDefinition/>
-			<RowDefinition/>
-			<RowDefinition/>
+			<RowDefinition Height="*"/>
+			<RowDefinition Height="*"/>
+			<RowDefinition Height="*"/>
+			<RowDefinition Height="4*"/>
 		</Grid.RowDefinitions>
 		<Grid.ColumnDefinitions>
-			<ColumnDefinition/>
-			<ColumnDefinition/>
+			<ColumnDefinition Width="47*"/>
+			<ColumnDefinition Width="154*"/>
 		</Grid.ColumnDefinitions>
-		<Label Content="ID: " Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" VerticalContentAlignment="Stretch" />
-		<Label Content="Type:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" />
-		<Label Content="Name:" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" />
-		<Label Content="Args:" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" />
-		<Label Content="Comment:" Grid.Row="4" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" />
-		<TextBox Grid.Column="1" Grid.Row="0" Margin="10"/>
-		<TextBox Grid.Column="1" Grid.Row="1" Margin="10"/>
-		<TextBox Grid.Column="1" Grid.Row="2" Margin="10"/>
-		<TextBox Grid.Column="1" Grid.Row="3" Margin="10"/>
-		<TextBox Grid.Column="1" Grid.Row="4" Margin="10"/>
+		<Label Content="ID: " Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Top" VerticalContentAlignment="Stretch" Height="26" Margin="0,0,19,0" Width="28" />
+		<Label Content="类型:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Top" Height="26" Margin="-2,0,9,0" Width="40" />
+		<Label Content="参数:" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Top" Height="26" Margin="-2,1,9,0" Width="40" />
+		<Label Content="备注:" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Top" Height="26" Margin="0,40,9,0" Width="40" />
+		<TextBox Name="tbId" Grid.Column="1" Grid.Row="0" Margin="2" Text="{Binding Id}" IsReadOnly="True" />
+		<ComboBox Name="cbType" Grid.Column="1" Grid.Row="1" Margin="2" SelectionChanged="CbType_OnSelectionChanged" />
+		<TextBox Name="tbArgs" Grid.Column="1" Grid.Row="2" Margin="2" Text="{Binding Args, Converter={StaticResource ListToStringConverter}}" />
+		<TextBox Name="tbComment" Grid.Column="1" Grid.Row="3" Margin="2" Text="{Binding Comment}" />
 	</Grid>
 </UserControl>

+ 32 - 1
CSharp/App/Modules/Tree/NodeDataEditor.xaml.cs

@@ -12,8 +12,9 @@ using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using Helper;
 
-namespace Modules.Tree
+namespace Tree
 {
 	/// <summary>
 	/// NodeDataEditor.xaml 的交互逻辑
@@ -23,6 +24,36 @@ namespace Modules.Tree
 		public NodeDataEditor()
 		{
 			InitializeComponent();
+
+			string[] nodeTypes = Enum.GetNames(typeof(NodeType));
+			this.cbType.ItemsSource = nodeTypes;
+		}
+
+		public TreeNodeViewModel ViewModel
+		{
+			get
+			{
+				return this.DataContext as TreeNodeViewModel;
+			}
+		}
+
+		private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
+		{
+			if (this.ViewModel == null)
+			{
+				return;
+			}
+			this.cbType.SelectedIndex = EnumHelper.EnumIndex<NodeType>(this.ViewModel.Type);
+		}
+
+		private void CbType_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+		{
+			if (this.cbType.SelectedValue == null)
+			{
+				this.ViewModel.Type = 0;
+				return;
+			}
+			this.ViewModel.Type = (int)Enum.Parse(typeof(NodeType), this.cbType.SelectedValue.ToString().Trim());
 		}
 	}
 }

+ 17 - 0
CSharp/App/Modules/Tree/NodeType.cs

@@ -0,0 +1,17 @@
+
+namespace Tree
+{
+	public enum NodeType
+	{
+		Selector = 1,
+		Sequence = 2,
+		Not = 10,
+
+		// condition节点 10000开始
+		SelectTarget = 10000,
+		Roll = 10001,
+
+		// action节点 20000开始
+		CastSpell = 20000,
+	}
+}

+ 43 - 0
CSharp/App/Modules/Tree/NodeTypeColorConverter.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Windows.Data;
+
+namespace Tree
+{
+	[ValueConversion(typeof(int), typeof(int))]
+	public class NodeTypeColorConverter : IValueConverter
+	{
+		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+		{
+			if (value == null)
+			{
+				return 0;
+			}
+			int nodeType = (int) value;
+			if (nodeType == (int) NodeType.Selector)
+			{
+				return "selector";
+			}
+			if (nodeType == (int) NodeType.Sequence)
+			{
+				return "sequence";
+			}
+			if (nodeType < 20000 && nodeType >= 10000)
+			{
+				return "condition";
+			}
+			if (nodeType < 30000 && nodeType >= 20000)
+			{
+				return "action";
+			}
+			return "other";
+		}
+
+		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+		{
+			return null;
+		}
+	}
+}

+ 26 - 0
CSharp/App/Modules/Tree/NodeTypeToStringConverter.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Windows.Data;
+
+namespace Tree
+{
+	[ValueConversion(typeof(int), typeof(string))]
+	public class NodeTypeToStringConverter : IValueConverter
+	{
+		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+		{
+			if (value == null)
+			{
+				return "";
+			}
+			return ((NodeType)(int)value).ToString();
+		}
+
+		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+		{
+			return null;
+		}
+	}
+}

+ 4 - 0
CSharp/App/Modules/Tree/Tree.csproj

@@ -91,9 +91,13 @@
     <Compile Include="BehaviorTreeView.xaml.cs">
       <DependentUpon>BehaviorTreeView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="NodeTypeToStringConverter.cs" />
+    <Compile Include="NodeTypeColorConverter.cs" />
+    <Compile Include="ListToStringConverter.cs" />
     <Compile Include="NodeDataEditor.xaml.cs">
       <DependentUpon>NodeDataEditor.xaml</DependentUpon>
     </Compile>
+    <Compile Include="NodeType.cs" />
     <Compile Include="TreeNodeData.cs" />
     <Compile Include="TreeNodeDataArray.cs" />
     <Compile Include="TreeNodeViewModel.cs" />

+ 3 - 3
CSharp/App/Modules/Tree/TreeNodeData.cs

@@ -24,13 +24,13 @@ namespace Tree
 		/// 节点名字
 		/// </summary>
 		[DataMember(Order = 3)]
-		public int Name { get; set; }
+		public string Name { get; set; }
 
 		/// <summary>
 		/// 节点配置参数
 		/// </summary>
 		[DataMember(Order = 4)]
-		public string Args { get; set; }
+		public List<string> Args { get; set; }
 
 		/// <summary>
 		/// 父节点
@@ -54,7 +54,7 @@ namespace Tree
 		/// 节点说明
 		/// </summary>
 		[DataMember(Order = 7)]
-		public int Comment { get; set; }
+		public string Comment { get; set; }
 
 		/// <summary>
 		/// 节点是否折叠,给编辑器看的

+ 51 - 2
CSharp/App/Modules/Tree/TreeNodeViewModel.cs

@@ -1,5 +1,7 @@
 using System;
+using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.Windows.Documents;
 using Microsoft.Practices.Prism.Mvvm;
 
 namespace Tree
@@ -84,7 +86,38 @@ namespace Tree
 			get
 			{
 				return this.treeNodeData.Id;
+			}
+			set
+			{
+				this.treeNodeData.Id = value;
+				this.OnPropertyChanged("Id");
 			}
+		}
+
+		public string Name
+		{
+			get
+			{
+				return this.treeNodeData.Name;
+			}
+			set
+			{
+				this.treeNodeData.Name = value;
+				this.OnPropertyChanged("Name");
+			}
+		}
+
+		public string Comment
+		{
+			get
+			{
+				return this.treeNodeData.Comment;
+			}
+			set
+			{
+				this.treeNodeData.Comment = value;
+				this.OnPropertyChanged("Comment");
+			}
 		}
 
 		public static double Width
@@ -244,10 +277,26 @@ namespace Tree
 				{
 					return;
 				}
-				int type = 0;
-				this.SetProperty(ref type, value);
 				this.treeNodeData.Type = value;
+				this.OnPropertyChanged("Type");
 			}
+		}
+
+		public List<string> Args
+		{
+			get
+			{
+				return this.treeNodeData.Args;
+			}
+			set
+			{
+				if (this.treeNodeData.Args == value)
+				{
+					return;
+				}
+				this.treeNodeData.Args = value;
+				this.OnPropertyChanged("Args");
+			}
 		}
 
 		public TreeNodeViewModel Parent

+ 26 - 0
CSharp/Platform/Helper/EnumHelper.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Helper
+{
+	public static class EnumHelper
+	{
+		public static int EnumIndex<T>(int value)
+		{
+			int i = 0;
+			foreach (var v in Enum.GetValues(typeof (T)))
+			{
+				if ((int) v != value)
+				{
+					++i;
+					continue;
+				}
+				return i;
+			}
+			return -1;
+		}
+	}
+}

+ 71 - 70
CSharp/Platform/Helper/Helper.csproj

@@ -1,77 +1,78 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{24233CD5-A5DF-484B-A482-B79CB7A0D9CB}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Helper</RootNamespace>
-    <AssemblyName>Helper</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
-    <RestorePackages>true</RestorePackages>
-  </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="MongoDB.Bson, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Bson.dll</HintPath>
-    </Reference>
-    <Reference Include="MongoDB.Driver, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Driver.dll</HintPath>
-    </Reference>
-    <Reference Include="protobuf-net, Version=2.0.0.668, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\packages\protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Numerics" />
-    <Reference Include="System.Runtime.Serialization" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="ByteHelper.cs" />
-    <Compile Include="BigIntegerHelper.cs" />
-    <Compile Include="LoaderHelper.cs" />
-    <Compile Include="ProtobufHelper.cs" />
-    <Compile Include="RandomHelper.cs" />
-    <Compile Include="StringHelper.cs" />
-    <Compile Include="TimeHelper.cs" />
-    <Compile Include="XmlHelper.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="MongoHelper.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Packages.config" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{24233CD5-A5DF-484B-A482-B79CB7A0D9CB}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Helper</RootNamespace>
+    <AssemblyName>Helper</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+  </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="MongoDB.Bson, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Bson.dll</HintPath>
+    </Reference>
+    <Reference Include="MongoDB.Driver, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Driver.dll</HintPath>
+    </Reference>
+    <Reference Include="protobuf-net, Version=2.0.0.668, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\packages\protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Numerics" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ByteHelper.cs" />
+    <Compile Include="BigIntegerHelper.cs" />
+    <Compile Include="EnumHelper.cs" />
+    <Compile Include="LoaderHelper.cs" />
+    <Compile Include="ProtobufHelper.cs" />
+    <Compile Include="RandomHelper.cs" />
+    <Compile Include="StringHelper.cs" />
+    <Compile Include="TimeHelper.cs" />
+    <Compile Include="XmlHelper.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="MongoHelper.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(SolutionDir)\.nuget\nuget.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>