Przeglądaj źródła

调整C#代码的格式

tanghai 13 lat temu
rodzic
commit
362925462f

+ 1 - 1
CSharp/App/Editor/App.xaml.cs

@@ -2,7 +2,7 @@
 
 namespace Editor
 {
-	public partial class App : Application
+	public partial class App: Application
 	{
 		protected override void OnStartup(StartupEventArgs e)
 		{

+ 1 - 1
CSharp/App/Editor/Bootstrapper.cs

@@ -9,7 +9,7 @@ using Modules.WaiGua;
 
 namespace Editor
 {
-	public class Bootstrapper : MefBootstrapper
+	public class Bootstrapper: MefBootstrapper
 	{
 		protected override void ConfigureAggregateCatalog()
 		{

+ 1 - 1
CSharp/App/Editor/Shell.xaml.cs

@@ -4,7 +4,7 @@ using System.Windows;
 namespace Editor
 {
 	[Export]
-	public partial class Shell : Window
+	public partial class Shell: Window
 	{
 		public Shell()
 		{

+ 1 - 1
CSharp/App/Editor/ShellViewModel.cs

@@ -4,7 +4,7 @@ using Microsoft.Practices.Prism.ViewModel;
 namespace Editor
 {
 	[Export]
-	public class ShellViewModel : NotificationObject
+	public class ShellViewModel: NotificationObject
 	{
 		// This is where any view model logic for the shell would go.
 	}

+ 1 - 1
CSharp/App/Infrastructure/AutoPopulateExportedViewsBehavior.cs

@@ -22,7 +22,7 @@ using Microsoft.Practices.Prism.Regions;
 namespace Infrastructure
 {
 	[Export(typeof (AutoPopulateExportedViewsBehavior)), PartCreationPolicy(CreationPolicy.NonShared)]
-	public class AutoPopulateExportedViewsBehavior : RegionBehavior, IPartImportsSatisfiedNotification
+	public class AutoPopulateExportedViewsBehavior: RegionBehavior, IPartImportsSatisfiedNotification
 	{
 		[ImportMany(AllowRecomposition = true)]
 		public Lazy<object, IViewRegionRegistration>[] RegisteredViews

+ 3 - 3
CSharp/App/Infrastructure/ViewExportAttribute.cs

@@ -21,13 +21,13 @@ using System.ComponentModel.Composition;
 namespace Infrastructure
 {
 	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false), MetadataAttribute]
-	public class ViewExportAttribute : ExportAttribute, IViewRegionRegistration
+	public class ViewExportAttribute: ExportAttribute, IViewRegionRegistration
 	{
-		public ViewExportAttribute() : base(typeof (object))
+		public ViewExportAttribute(): base(typeof (object))
 		{
 		}
 
-		public ViewExportAttribute(string viewName) : base(viewName, typeof (object))
+		public ViewExportAttribute(string viewName): base(viewName, typeof (object))
 		{
 		}
 

+ 1 - 1
CSharp/App/Modules/BehaviorTree/BehaviorTreeModule.cs

@@ -4,7 +4,7 @@ using Microsoft.Practices.Prism.Modularity;
 namespace Modules.BehaviorTree
 {
 	[ModuleExport(moduleType: typeof (BehaviorTreeModule))]
-	public class BehaviorTreeModule : IModule
+	public class BehaviorTreeModule: IModule
 	{
 		public void Initialize()
 		{

+ 1 - 1
CSharp/App/Modules/BehaviorTree/TreeNodeViewModel.cs

@@ -3,7 +3,7 @@ using Microsoft.Practices.Prism.ViewModel;
 
 namespace Modules.BehaviorTree
 {
-	public class TreeNodeViewModel : NotificationObject
+	public class TreeNodeViewModel: NotificationObject
 	{
 		private static int globalNum;
 		private readonly int num;

+ 1 - 1
CSharp/App/Modules/Robot/RobotModule.cs

@@ -4,7 +4,7 @@ using Microsoft.Practices.Prism.Modularity;
 namespace Modules.Robot
 {
 	[ModuleExport(moduleType: typeof (RobotModule))]
-	public class RobotModule : IModule
+	public class RobotModule: IModule
 	{
 		public void Initialize()
 		{

+ 3 - 3
CSharp/App/Modules/Robot/RobotViewModel.cs

@@ -8,13 +8,13 @@ using Microsoft.Practices.Prism.ViewModel;
 namespace Modules.Robot
 {
 	[Export(contractType: typeof (RobotViewModel)), PartCreationPolicy(creationPolicy: CreationPolicy.NonShared)]
-	internal class RobotViewModel : NotificationObject
+	internal class RobotViewModel: NotificationObject
 	{
 		private readonly Host host;
 		private string logText = "";
 
 		private readonly DispatcherTimer timer = new DispatcherTimer(DispatcherPriority.Normal)
-		{Interval = new TimeSpan(0, 0, 0, 0, 50)};
+		{ Interval = new TimeSpan(0, 0, 0, 0, 50) };
 
 		public string LogText
 		{
@@ -46,7 +46,7 @@ namespace Modules.Robot
 		{
 			try
 			{
-				var address = new Address {Host = "192.168.10.246", Port = 8901};
+				var address = new Address { Host = "192.168.10.246", Port = 8901 };
 				using (Peer peer = await this.host.ConnectAsync(address))
 				{
 					using (Packet packet = await peer.ReceiveAsync())

+ 1 - 1
CSharp/App/Modules/WaiGua/WaiGuaModule.cs

@@ -4,7 +4,7 @@ using Microsoft.Practices.Prism.Modularity;
 namespace Modules.WaiGua
 {
 	[ModuleExport(moduleType: typeof (WaiGuaModule))]
-	public class WaiGuaModule : IModule
+	public class WaiGuaModule: IModule
 	{
 		public void Initialize()
 		{

+ 1 - 1
CSharp/App/Modules/WaiGua/WaiGuaViewModel.cs

@@ -5,7 +5,7 @@ using Microsoft.Practices.Prism.ViewModel;
 namespace Modules.WaiGua
 {
 	[Export(contractType: typeof (WaiGuaViewModel)), PartCreationPolicy(creationPolicy: CreationPolicy.NonShared)]
-	internal class WaiGuaViewModel : NotificationObject
+	internal class WaiGuaViewModel: NotificationObject
 	{
 		private string logText = "";
 

+ 6 - 2
CSharp/CSharp.sln.DotSettings

@@ -18,6 +18,7 @@
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_EXPRESSION/@EntryValue">False</s:Boolean>
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_PARAMETER/@EntryValue">False</s:Boolean>
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTLINE_TYPE_PARAMETER_CONSTRAINS/@EntryValue">False</s:Boolean>
+	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">NEXT_LINE</s:String>
 	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/CASE_BLOCK_BRACES/@EntryValue">NEXT_LINE</s:String>
 	<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/CONTINUOUS_INDENT_MULTIPLIER/@EntryValue">2</s:Int64>
 	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_ATTRIBUTE_STYLE/@EntryValue">JOIN</s:String>
@@ -27,8 +28,9 @@
 	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_IFELSE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
 	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_USING_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
 	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_WHILE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
-	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_FIXED_STMT/@EntryValue">True</s:Boolean>
-	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_USINGS_STMT/@EntryValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_FIXED_STMT/@EntryValue">False</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_USINGS_STMT/@EntryValue">False</s:Boolean>
+	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">NEXT_LINE</s:String>
 	<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
 	<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_USER_LINEBREAKS/@EntryValue">False</s:Boolean>
@@ -40,7 +42,9 @@
 	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/REDUNDANT_THIS_QUALIFIER_STYLE/@EntryValue">ALWAYS_USE</s:String>
 	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_EMBEDDED_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_EXTENDS_COLON/@EntryValue">False</s:Boolean>
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_TERNARY_QUEST/@EntryValue">False</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/STICK_COMMENT/@EntryValue">False</s:Boolean>
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_DECLARATION_LPAR/@EntryValue">True</s:Boolean>
 	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_INVOCATION_LPAR/@EntryValue">True</s:Boolean>

+ 2 - 2
CSharp/Platform/Hooks/RecvHook.cs

@@ -8,7 +8,7 @@ namespace Hooks
 	[UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = true)]
 	public delegate int DRecv(IntPtr handle, IntPtr buf, int count, int flag);
 
-	public class RecvHook : IDisposable
+	public class RecvHook: IDisposable
 	{
 		[DllImport("Ws2_32.dll", EntryPoint = "recv")]
 		public static extern int Recv(IntPtr handle, IntPtr buf, int count, int flag);
@@ -20,7 +20,7 @@ namespace Hooks
 			try
 			{
 				this.localHook = LocalHook.Create(LocalHook.GetProcAddress("Ws2_32.dll", "recv"), new DRecv(dRecv), this);
-				this.localHook.ThreadACL.SetInclusiveACL(new[] {0});
+				this.localHook.ThreadACL.SetInclusiveACL(new[] { 0 });
 			}
 			catch (Exception)
 			{

+ 2 - 2
CSharp/Platform/Hooks/SendHook.cs

@@ -8,7 +8,7 @@ namespace Hooks
 	[UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = true)]
 	public delegate int DSend(IntPtr handle, IntPtr buf, int count, int flag);
 
-	public class SendHook : IDisposable
+	public class SendHook: IDisposable
 	{
 		[DllImport("Ws2_32.dll", EntryPoint = "send")]
 		public static extern int Send(IntPtr handle, IntPtr buf, int count, int flag);
@@ -20,7 +20,7 @@ namespace Hooks
 			try
 			{
 				this.localHook = LocalHook.Create(LocalHook.GetProcAddress("Ws2_32.dll", "send"), new DSend(dSend), this);
-				this.localHook.ThreadACL.SetInclusiveACL(new[] {0});
+				this.localHook.ThreadACL.SetInclusiveACL(new[] { 0 });
 			}
 			catch (Exception)
 			{

+ 2 - 2
CSharp/Platform/Log/NLoggerAdapter.cs

@@ -2,11 +2,11 @@
 
 namespace Log
 {
-	public class NLoggerAdapter : ALogDecorater, ILogger
+	public class NLoggerAdapter: ALogDecorater, ILogger
 	{
 		private readonly NLog.Logger logger = LogManager.GetCurrentClassLogger();
 
-		public NLoggerAdapter(ALogDecorater decorater = null) : base(decorater)
+		public NLoggerAdapter(ALogDecorater decorater = null): base(decorater)
 		{
 		}
 

+ 2 - 2
CSharp/Platform/Log/StackInfoDecorater.cs

@@ -3,9 +3,9 @@ using System.IO;
 
 namespace Log
 {
-	internal class StackInfoDecorater : ALogDecorater
+	internal class StackInfoDecorater: ALogDecorater
 	{
-		public StackInfoDecorater(ALogDecorater decorater = null) : base(decorater)
+		public StackInfoDecorater(ALogDecorater decorater = null): base(decorater)
 		{
 			this.FileName = true;
 			this.FileLineNumber = true;

+ 1 - 1
CSharp/ThirdParty/ENetCS/Address.cs

@@ -3,7 +3,7 @@ using System.Text;
 
 namespace ENet
 {
-	public struct Address : IEquatable<Address>
+	public struct Address: IEquatable<Address>
 	{
 		private ENetAddress address;
 

+ 2 - 2
CSharp/ThirdParty/ENetCS/ENetException.cs

@@ -2,9 +2,9 @@
 
 namespace ENet
 {
-	public class ENetException : Exception
+	public class ENetException: Exception
 	{
-		public ENetException(int code, string message) : base(message)
+		public ENetException(int code, string message): base(message)
 		{
 			this.Code = code;
 		}

+ 1 - 1
CSharp/ThirdParty/ENetCS/Host.cs

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
 
 namespace ENet
 {
-	public sealed class Host : IDisposable
+	public sealed class Host: IDisposable
 	{
 		private readonly PeersManager peersManager = new PeersManager();
 

+ 1 - 1
CSharp/ThirdParty/ENetCS/Packet.cs

@@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
 
 namespace ENet
 {
-	public sealed class Packet : IDisposable
+	public sealed class Packet: IDisposable
 	{
 		private Host host;
 		private IntPtr packet;

+ 1 - 1
CSharp/ThirdParty/ENetCS/Peer.cs

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
 
 namespace ENet
 {
-	public class Peer : IDisposable
+	public class Peer: IDisposable
 	{
 		private readonly Host host;
 		private readonly PeerEvent peerEvent = new PeerEvent();