Skip to content

Commit d28d4f0

Browse files
committed
More Docs update by Ken Foskey !!! (Thanks dude !!)
git-svn-id: svn://localhost/trunk@813 fafefce7-770d-0410-b8bf-a6f642d37c66
1 parent 0e2ba21 commit d28d4f0

14 files changed

+428
-138
lines changed

FileHelpers/Core/IFieldInfoCacheManipulator.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

FileHelpers/Core/ReflectionHelper.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,19 +268,7 @@ public static IEnumerable<FieldInfo> RecursiveGetFields(Type currentType)
268268

269269
FieldInfoCacheManipulator.ResetFieldInfoCache(currentType);
270270

271-
//var temp = currentType.GetMembers(BindingFlags.Public |
272-
// BindingFlags.NonPublic |
273-
// BindingFlags.Instance |
274-
// BindingFlags.GetField |
275-
// BindingFlags.GetProperty |
276-
// BindingFlags.DeclaredOnly);
277-
278-
//Debug.WriteLine(temp.Length);
279-
280-
//Array.Sort(temp, (x, y) => x.MetadataToken.CompareTo(y.MetadataToken));
281-
282-
//Debug.WriteLine(temp.Length);
283-
271+
284272
foreach (FieldInfo fi in currentType.GetFields(BindingFlags.Public |
285273
BindingFlags.NonPublic |
286274
BindingFlags.Instance |

FileHelpers/Csv/RecordIndexer.cs

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ namespace FileHelpers
1414
[EditorBrowsable(EditorBrowsableState.Advanced)]
1515
public sealed class RecordIndexer
1616
:IEnumerable<string>
17-
//, INotifyRead
1817
{
19-
18+
/// <summary>
19+
/// Get the record indexer, engine will load the lines into an array
20+
/// </summary>
2021
internal RecordIndexer()
2122
{}
2223

2324
[FieldQuoted(QuoteMode.OptionalForRead, MultilineMode.AllowForRead)]
24-
private string[] values;
25+
private string[] values = null;
2526

2627
/// <summary>
2728
/// The number of fields in the record
2829
/// </summary>
29-
3030
public int FieldCount
3131
{
3232
get { return values.Length; }
@@ -45,12 +45,19 @@ public string this[int index]
4545
}
4646
}
4747

48-
48+
/// <summary>
49+
/// Get the enumerator of the list
50+
/// </summary>
51+
/// <returns></returns>
4952
IEnumerator<string> IEnumerable<string>.GetEnumerator()
5053
{
5154
return new ArrayEnumerator(values);
5255
}
5356

57+
/// <summary>
58+
/// Get enumerator of the list
59+
/// </summary>
60+
/// <returns></returns>
5461
IEnumerator IEnumerable.GetEnumerator()
5562
{
5663
return ((IEnumerable<string>) this).GetEnumerator();
@@ -69,26 +76,51 @@ IEnumerator IEnumerable.GetEnumerator()
6976

7077
#region " ArrayEnumerator "
7178

79+
/// <summary>
80+
/// Create an enumerator off an array of strings
81+
/// </summary>
7282
private sealed class ArrayEnumerator : IEnumerator<string>
7383
{
84+
/// <summary>
85+
/// Array to return one at a time
86+
/// </summary>
7487
private string[] mValues;
88+
89+
/// <summary>
90+
/// Position in enumerator, -1 to start
91+
/// </summary>
7592
private int i;
93+
94+
/// <summary>
95+
/// Create an enumerator off a string array
96+
/// </summary>
97+
/// <param name="values">values to return one at a time</param>
7698
public ArrayEnumerator(string[] values)
7799
{
78100
mValues = values;
79101
i = -1;
80102
}
81103

104+
/// <summary>
105+
/// Get the current item we are working on
106+
/// </summary>
82107
string IEnumerator<string>.Current
83108
{
84109
get { return mValues[i]; }
85110
}
86111

112+
/// <summary>
113+
/// Clean up not needed
114+
/// </summary>
87115
public void Dispose()
88116
{
89117

90118
}
91119

120+
/// <summary>
121+
/// move the pointer along
122+
/// </summary>
123+
/// <returns></returns>
92124
public bool MoveNext()
93125
{
94126
i++;
@@ -99,11 +131,17 @@ public bool MoveNext()
99131
return true;
100132
}
101133

134+
/// <summary>
135+
/// Go back to the start
136+
/// </summary>
102137
public void Reset()
103138
{
104139
i = -1;
105140
}
106141

142+
/// <summary>
143+
/// Get the current element
144+
/// </summary>
107145
public object Current
108146
{
109147
get { return mValues[i]; }

FileHelpers/Dynamic/AttributesBuilder.cs

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,51 @@
1-
2-
31
using System;
42
using System.Text;
53

64
namespace FileHelpers.Dynamic
75
{
86

7+
/// <summary>
8+
/// Create attributes in the specified language and return as text to paste
9+
/// into code
10+
/// </summary>
911
internal sealed class AttributesBuilder
1012
{
13+
/// <summary>
14+
/// Attribute text is created here...
15+
/// </summary>
1116
StringBuilder mSb = new StringBuilder(250);
12-
NetLanguage mLeng;
17+
18+
/// <summary>
19+
/// C# or Visual Basic
20+
/// </summary>
21+
NetLanguage mLang;
1322

23+
/// <summary>
24+
/// Create an attribute in the language selected
25+
/// </summary>
26+
/// <param name="lang"></param>
1427
public AttributesBuilder(NetLanguage lang)
1528
{
16-
mLeng = lang;
29+
mLang = lang;
1730
}
1831

32+
/// <summary>
33+
/// Do we have any attributes, do we have to start and close VB attributes?
34+
/// </summary>
1935
private bool mFirst = true;
20-
36+
37+
/// <summary>
38+
/// Add an attribute, C# [att1] [att2], VB &lt;att1,_att2
39+
/// </summary>
40+
/// <param name="attribute"></param>
2141
public void AddAttribute(string attribute)
2242
{
2343
if (attribute == null || attribute == string.Empty)
2444
return;
2545

2646
if (mFirst)
2747
{
28-
switch(mLeng)
48+
switch(mLang)
2949
{
3050
case NetLanguage.CSharp:
3151
mSb.Append("[");
@@ -38,10 +58,10 @@ public void AddAttribute(string attribute)
3858
}
3959
else
4060
{
41-
switch(mLeng)
61+
switch(mLang)
4262
{
4363
case NetLanguage.VbNet:
44-
mSb.Append(", _");
64+
mSb.Append(", _"); // new line continuation
4565
mSb.Append(StringHelper.NewLine);
4666
mSb.Append(" ");
4767
break;
@@ -53,7 +73,7 @@ public void AddAttribute(string attribute)
5373

5474
mSb.Append(attribute);
5575

56-
switch(mLeng)
76+
switch(mLang)
5777
{
5878
case NetLanguage.CSharp:
5979
mSb.Append("]");
@@ -66,12 +86,16 @@ public void AddAttribute(string attribute)
6686

6787
}
6888

89+
/// <summary>
90+
/// Return all of attributes as text, if first then it is empty
91+
/// </summary>
92+
/// <returns></returns>
6993
public string GetAttributesCode()
7094
{
7195
if (mFirst == true)
7296
return string.Empty;
7397

74-
switch(mLeng)
98+
switch(mLang)
7599
{
76100
case NetLanguage.VbNet:
77101
mSb.Append("> _");

0 commit comments

Comments
 (0)