From 88593559e867daca88178fd60d338fd95f5b7953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AC=9D=E6=A1=82=E7=B6=B1?= Date: Tue, 1 Mar 2016 19:51:39 +0800 Subject: [PATCH] code formats --- .../DynamicCode/LinqClosure/LinqClosure.vb | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/LINQ/LINQ/Framewok/DynamicCode/LinqClosure/LinqClosure.vb b/LINQ/LINQ/Framewok/DynamicCode/LinqClosure/LinqClosure.vb index 3b12e89..3d9ccf2 100644 --- a/LINQ/LINQ/Framewok/DynamicCode/LinqClosure/LinqClosure.vb +++ b/LINQ/LINQ/Framewok/DynamicCode/LinqClosure/LinqClosure.vb @@ -10,34 +10,41 @@ Public Module LinqClosure Dim lBuilder As New StringBuilder() Call lBuilder.AppendLine("Namespace ___linqClosure") - Call lBuilder.AppendLine("Public Class Linq") + Call lBuilder.AppendLine() + Call lBuilder.AppendLine(" Public Class Linq") + Call lBuilder.AppendLine() - Call lBuilder.AppendLine($"Public Shared Function Project({x} As {type}) As LinqValue") + Call lBuilder.AppendLine($" Public Shared Function Project({x} As {type}) As LinqValue") + Call lBuilder.AppendLine() If Not preLetClosures Is Nothing Then For Each line As String In preLetClosures - Call lBuilder.AppendLine("Dim " & line) + Call lBuilder.AppendLine(" Dim " & line) Next + Call lBuilder.AppendLine() End If If Not String.IsNullOrEmpty(where) Then - Call lBuilder.AppendLine($"If Not {where} Then") - Call lBuilder.AppendLine($"Return {GetType(LinqValue).FullName}.Unavailable()") - Call lBuilder.AppendLine("End If") + Call lBuilder.AppendLine($" If Not {where} Then") + Call lBuilder.AppendLine($" Return {GetType(LinqValue).FullName}.Unavailable()") + Call lBuilder.AppendLine(" End If") + Call lBuilder.AppendLine() End If If Not afterLetClosures Is Nothing Then For Each line As String In afterLetClosures - Call lBuilder.AppendLine("Dim " & line) + Call lBuilder.AppendLine(" Dim " & line) Next + Call lBuilder.AppendLine() End If - Call lBuilder.AppendLine("Dim obj As Object = " & __getProjects(projects)) - Call lBuilder.AppendLine("Return obj") + Call lBuilder.AppendLine(" Dim obj As Object = " & __getProjects(projects)) + Call lBuilder.AppendLine(" Return obj") - Call lBuilder.AppendLine("End Function") + Call lBuilder.AppendLine(" End Function") + Call lBuilder.AppendLine() - Call lBuilder.AppendLine("End Class") + Call lBuilder.AppendLine(" End Class") Call lBuilder.AppendLine("End Namespace") Return lBuilder.ToString @@ -50,8 +57,8 @@ Public Module LinqClosure Return projects(Scan0) Else Dim anym As StringBuilder = New StringBuilder("New With {" & vbCrLf) - Call anym.AppendLine(String.Join(", ", projects.ToArray(Function(s) __property(s)))) - Call anym.AppendLine("}") + Call anym.AppendLine(String.Join(", " & vbCrLf, projects.ToArray(Function(s) vbTab & __property(s)))) + Call anym.AppendLine(vbTab & "}") Return anym.ToString End If