Permalink
Browse files

convert newlines

  • Loading branch information...
1 parent fb80942 commit c6cb855d355dfbf9f3cff5831db68b5509c367e6 @handcraftsman handcraftsman committed Nov 17, 2010
Showing with 7,127 additions and 7,127 deletions.
  1. +36 −36 Converter/ClassMapBody.cs
  2. +143 −143 Converter/CodeFileBuilder.cs
  3. +113 −113 Converter/Converter.csproj
  4. +10 −10 Converter/Extensions/CodeFileBuilderExtensions.cs
  5. +36 −36 Converter/Extensions/NHibernate/HbmBagExtensions.cs
  6. +33 −33 Converter/Extensions/NHibernate/HbmColumnExtensions.cs
  7. +16 −16 Converter/Extensions/NHibernate/HbmComponentExtensions.cs
  8. +67 −67 Converter/Extensions/NHibernate/HbmIdExtensions.cs
  9. +16 −16 Converter/Extensions/NHibernate/HbmManyToManyExtensions.cs
  10. +82 −82 Converter/Extensions/NHibernate/HbmManyToOneExtensions.cs
  11. +11 −11 Converter/Extensions/NHibernate/HbmOneToManyExtensions.cs
  12. +97 −97 Converter/Extensions/NHibernate/HbmPropertyExtensions.cs
  13. +35 −35 Converter/Extensions/NHibernate/HbmSetExtensions.cs
  14. +33 −33 Converter/Extensions/StringExtensions.cs
  15. +7 −7 Converter/FakeMap.cs
  16. +54 −54 Converter/HbmFileUtility.cs
  17. +45 −45 Converter/MappedClassInfo.cs
  18. +137 −137 Converter/MappedPropertyInfo.cs
  19. +95 −95 Converter/MappingConverter.cs
  20. +36 −36 Converter/Methods/Column.cs
  21. +34 −34 Converter/Methods/CustomType.cs
  22. +70 −70 Converter/Methods/GeneratedBy.cs
  23. +6 −6 Converter/Methods/ICommonMapMethod.cs
  24. +33 −33 Converter/Methods/Index.cs
  25. +48 −48 Converter/Methods/Join/Cascade.cs
  26. +36 −36 Converter/Methods/Join/Inverse.cs
  27. +48 −48 Converter/Methods/Join/KeyColumn.cs
  28. +41 −41 Converter/Methods/Join/LazyLoad.cs
  29. +27 −27 Converter/Methods/Join/OrderBy.cs
  30. +27 −27 Converter/Methods/Join/Table.cs
  31. +27 −27 Converter/Methods/Join/Where.cs
  32. +33 −33 Converter/Methods/Length.cs
  33. +43 −43 Converter/Methods/Nullability.cs
  34. +33 −33 Converter/Methods/Unique.cs
  35. +37 −37 Converter/Methods/UnsavedValue.cs
  36. +54 −54 Converter/NamedConstant.cs
  37. +38 −38 Converter/Properties/AssemblyInfo.cs
  38. +178 −178 Converter/PropertyMappingType.cs
  39. +37 −37 Converter/ReflectionUtility.cs
  40. +70 −70 Converter/Types/Bag.cs
  41. +59 −59 Converter/Types/Component.cs
  42. +6 −6 Converter/Types/IMapStart.cs
  43. +36 −36 Converter/Types/Id.cs
  44. +33 −33 Converter/Types/Map.cs
  45. +30 −30 Converter/Types/References.cs
  46. +75 −75 Converter/Types/Set.cs
  47. +151 −151 ConverterTests/AssertExtensions.cs
  48. +20 −20 ConverterTests/ClassFileUtilities.cs
  49. +29 −29 ConverterTests/ClassFileUtilitiesTests.cs
  50. +115 −115 ConverterTests/ConverterTests.csproj
  51. +153 −153 ConverterTests/Extensions/NHibernate/HbmBagExtensionsTests.cs
  52. +107 −107 ConverterTests/Extensions/NHibernate/HbmColumnExtensionsTests.cs
  53. +40 −40 ConverterTests/Extensions/NHibernate/HbmComponentExtensionsTests.cs
  54. +305 −305 ConverterTests/Extensions/NHibernate/HbmIdExtensionsTests.cs
  55. +40 −40 ConverterTests/Extensions/NHibernate/HbmManyToManyExtensionsTests.cs
  56. +376 −376 ConverterTests/Extensions/NHibernate/HbmManyToOneExtensionsTests.cs
  57. +24 −24 ConverterTests/Extensions/NHibernate/HbmOneToManyExtensionsTests.cs
  58. +397 −397 ConverterTests/Extensions/NHibernate/HbmPropertyExtensionsTests.cs
  59. +153 −153 ConverterTests/Extensions/NHibernate/HbmSetExtensionsTests.cs
  60. +95 −95 ConverterTests/Extensions/StringExtensionTests.cs
  61. +446 −446 ConverterTests/MappedPropertyInfoTests.cs
  62. +97 −97 ConverterTests/Methods/ColumnTests.cs
  63. +80 −80 ConverterTests/Methods/CustomTypeTests.cs
  64. +122 −122 ConverterTests/Methods/GeneratedByTests.cs
  65. +67 −67 ConverterTests/Methods/IndexTests.cs
  66. +60 −60 ConverterTests/Methods/Join/CascadeTests.cs
  67. +54 −54 ConverterTests/Methods/Join/InverseTests.cs
  68. +68 −68 ConverterTests/Methods/Join/KeyColumnTests.cs
  69. +63 −63 ConverterTests/Methods/Join/LazyLoadTests.cs
  70. +48 −48 ConverterTests/Methods/Join/OrderByTests.cs
  71. +48 −48 ConverterTests/Methods/Join/TableTests.cs
  72. +48 −48 ConverterTests/Methods/Join/WhereTests.cs
  73. +64 −64 ConverterTests/Methods/LengthTests.cs
  74. +104 −104 ConverterTests/Methods/NullabilityTests.cs
  75. +67 −67 ConverterTests/Methods/UniqueTests.cs
  76. +75 −75 ConverterTests/Methods/UnsavedValueTests.cs
  77. +38 −38 ConverterTests/Properties/AssemblyInfo.cs
  78. +29 −29 ConverterTests/Types/BagTests.cs
  79. +29 −29 ConverterTests/Types/ComponentTests.cs
  80. +104 −104 ConverterTests/Types/IdTests.cs
  81. +137 −137 ConverterTests/Types/MapTests.cs
  82. +42 −42 ConverterTests/Types/MappingConverterTests.cs
  83. +81 −81 ConverterTests/Types/ReferencesTests.cs
  84. +29 −29 ConverterTests/Types/SetTests.cs
  85. +32 −32 NHibernateHbmToFluent.sln
  86. +255 −255 WinForm/MainForm.Designer.cs
  87. +70 −70 WinForm/MainForm.cs
  88. +128 −128 WinForm/MainForm.resx
  89. +19 −19 WinForm/Program.cs
  90. +38 −38 WinForm/Properties/AssemblyInfo.cs
  91. +63 −63 WinForm/Properties/Resources.Designer.cs
  92. +116 −116 WinForm/Properties/Resources.resx
  93. +26 −26 WinForm/Properties/Settings.Designer.cs
  94. +7 −7 WinForm/Properties/Settings.settings
  95. +96 −96 WinForm/WinForm.csproj
  96. BIN WinForm/bin/Debug/NHibernateHbmToFluent.Converter.dll
  97. BIN WinForm/bin/Debug/NHibernateHbmToFluent.Converter.pdb
  98. BIN WinForm/bin/Debug/NHibernateHbmToFluent.exe
  99. BIN WinForm/bin/Debug/NHibernateHbmToFluent.pdb
  100. BIN WinForm/bin/Debug/NHibernateHbmToFluent.vshost.exe
  101. +11 −11 WinForm/bin/Debug/NHibernateHbmToFluent.vshost.exe.manifest
View
@@ -1,37 +1,37 @@
-using System.Collections.Generic;
-using NHibernateHbmToFluent.Converter.Methods;
-
-namespace NHibernateHbmToFluent.Converter
-{
- public class ClassMapBody
- {
- private readonly CodeFileBuilder _builder;
-
- public ClassMapBody(CodeFileBuilder builder)
- {
- _builder = builder;
- }
-
- public void Add(string prefix, MappedPropertyInfo info)
- {
- var methodBuilders = new List<ICommonMapMethod>
- {
- new Nullability(_builder),
- new Unique(_builder),
- new Index(_builder)
- };
- info.Type.StartMethod(prefix, _builder, info);
- {
- methodBuilders.ForEach(x => x.Add(info));
- }
- EndMap(_builder);
- }
-
-
- private static void EndMap(CodeFileBuilder builder)
- {
- builder.AddLine(";");
- builder.Unindent();
- }
- }
+using System.Collections.Generic;
+using NHibernateHbmToFluent.Converter.Methods;
+
+namespace NHibernateHbmToFluent.Converter
+{
+ public class ClassMapBody
+ {
+ private readonly CodeFileBuilder _builder;
+
+ public ClassMapBody(CodeFileBuilder builder)
+ {
+ _builder = builder;
+ }
+
+ public void Add(string prefix, MappedPropertyInfo info)
+ {
+ var methodBuilders = new List<ICommonMapMethod>
+ {
+ new Nullability(_builder),
+ new Unique(_builder),
+ new Index(_builder)
+ };
+ info.Type.StartMethod(prefix, _builder, info);
+ {
+ methodBuilders.ForEach(x => x.Add(info));
+ }
+ EndMap(_builder);
+ }
+
+
+ private static void EndMap(CodeFileBuilder builder)
+ {
+ builder.AddLine(";");
+ builder.Unindent();
+ }
+ }
}
@@ -1,144 +1,144 @@
-using System;
-using System.Text;
-using System.Text.RegularExpressions;
-
-namespace NHibernateHbmToFluent.Converter
-{
- public class CodeFileBuilder
- {
- private readonly StringBuilder _sb = new StringBuilder();
- private int _indentLevel;
-
- public void StartMethod(string methodPrototype)
- {
- StartBlock(methodPrototype);
- }
-
- public void AddProperty(string name, string getBody, string setBody, bool isStatic, bool isOverride)
- {
- StartBlock("public " + (isOverride ? "override " : "") + (isStatic ? "static " : "") + "string " + name);
- {
- if (getBody != null)
- {
- if (getBody.IndexOf(Environment.NewLine) == -1)
- {
- AddLine("get { " + getBody + " }");
- }
- else
- {
- StartBlock("get");
- {
- AddLine(getBody);
- }
- EndBlock();
- }
- }
- if (setBody != null)
- {
- if (setBody.IndexOf(Environment.NewLine) == -1)
- {
- AddLine("set { " + setBody + " }");
- }
- else
- {
- StartBlock("set");
- {
- AddLine(setBody);
- }
- EndBlock();
- }
- }
- }
- EndBlock();
- }
-
- public void AddComment(string comment)
- {
- AddLine("// " + comment);
- }
-
- public void StartRegion(string name)
- {
- AddLine("");
- AddLine("#region " + name);
- AddLine("");
- }
-
- public void EndRegion()
- {
- AddLine("");
- AddLine("#endregion");
- }
-
- public void StartClass(string name, bool isPartial, bool isStatic)
- {
- StartBlock("public" + (isPartial ? " partial" : "") + (isStatic ? " static" : "") + " class " + name);
- }
-
- public void StartNamespace(string @namespace)
- {
- AddLine("");
- StartBlock("namespace " + @namespace);
- }
-
- public void AddUsing(string s)
- {
- AddLine(string.Format("using {0};", s));
- }
-
- private void StartBlock(string header)
- {
- AddLine(header);
- StartBlock();
- }
-
- public void StartBlock()
- {
- AddLine("{");
- Indent();
- }
-
- public void EndBlock()
- {
- Unindent();
- AddLine("}");
- }
-
- public void AddLine(string line)
- {
- if (!String.IsNullOrEmpty(line))
- {
- _sb.AppendFormat("{0}{1}{2}", GetTabs(), line, Environment.NewLine);
- }
- else
- {
- _sb.Append(Environment.NewLine);
- }
- }
-
- private string GetTabs()
- {
- return "".PadLeft(_indentLevel, '\t');
- }
-
- public void Indent()
- {
- _indentLevel++;
- }
-
- public void Indent(int count)
- {
- _indentLevel += count;
- }
-
- public void Unindent()
- {
- _indentLevel--;
- }
-
- public override string ToString()
- {
- return Regex.Replace(_sb.ToString(), "\r\n\t+;", ";", RegexOptions.Multiline | RegexOptions.Compiled);
- }
- }
+using System;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace NHibernateHbmToFluent.Converter
+{
+ public class CodeFileBuilder
+ {
+ private readonly StringBuilder _sb = new StringBuilder();
+ private int _indentLevel;
+
+ public void StartMethod(string methodPrototype)
+ {
+ StartBlock(methodPrototype);
+ }
+
+ public void AddProperty(string name, string getBody, string setBody, bool isStatic, bool isOverride)
+ {
+ StartBlock("public " + (isOverride ? "override " : "") + (isStatic ? "static " : "") + "string " + name);
+ {
+ if (getBody != null)
+ {
+ if (getBody.IndexOf(Environment.NewLine) == -1)
+ {
+ AddLine("get { " + getBody + " }");
+ }
+ else
+ {
+ StartBlock("get");
+ {
+ AddLine(getBody);
+ }
+ EndBlock();
+ }
+ }
+ if (setBody != null)
+ {
+ if (setBody.IndexOf(Environment.NewLine) == -1)
+ {
+ AddLine("set { " + setBody + " }");
+ }
+ else
+ {
+ StartBlock("set");
+ {
+ AddLine(setBody);
+ }
+ EndBlock();
+ }
+ }
+ }
+ EndBlock();
+ }
+
+ public void AddComment(string comment)
+ {
+ AddLine("// " + comment);
+ }
+
+ public void StartRegion(string name)
+ {
+ AddLine("");
+ AddLine("#region " + name);
+ AddLine("");
+ }
+
+ public void EndRegion()
+ {
+ AddLine("");
+ AddLine("#endregion");
+ }
+
+ public void StartClass(string name, bool isPartial, bool isStatic)
+ {
+ StartBlock("public" + (isPartial ? " partial" : "") + (isStatic ? " static" : "") + " class " + name);
+ }
+
+ public void StartNamespace(string @namespace)
+ {
+ AddLine("");
+ StartBlock("namespace " + @namespace);
+ }
+
+ public void AddUsing(string s)
+ {
+ AddLine(string.Format("using {0};", s));
+ }
+
+ private void StartBlock(string header)
+ {
+ AddLine(header);
+ StartBlock();
+ }
+
+ public void StartBlock()
+ {
+ AddLine("{");
+ Indent();
+ }
+
+ public void EndBlock()
+ {
+ Unindent();
+ AddLine("}");
+ }
+
+ public void AddLine(string line)
+ {
+ if (!String.IsNullOrEmpty(line))
+ {
+ _sb.AppendFormat("{0}{1}{2}", GetTabs(), line, Environment.NewLine);
+ }
+ else
+ {
+ _sb.Append(Environment.NewLine);
+ }
+ }
+
+ private string GetTabs()
+ {
+ return "".PadLeft(_indentLevel, '\t');
+ }
+
+ public void Indent()
+ {
+ _indentLevel++;
+ }
+
+ public void Indent(int count)
+ {
+ _indentLevel += count;
+ }
+
+ public void Unindent()
+ {
+ _indentLevel--;
+ }
+
+ public override string ToString()
+ {
+ return Regex.Replace(_sb.ToString(), "\r\n\t+;", ";", RegexOptions.Multiline | RegexOptions.Compiled);
+ }
+ }
}
Oops, something went wrong.

0 comments on commit c6cb855

Please sign in to comment.