Building an ErrorCollection Class
Ever notice how its always the smallest code tasks that take the longest to solve? Thats how it is with me!
I am working on an emailing program and I wanted to be able to build an ErrorCollection class, inheriting from the StringCollection base class since it would allow the representation of a set of strings. I was stupidly calculating the length of the strings wrong though and just wasted 45 minutes this morning.
-
StringEnumerator enumerator = base.GetEnumerator();
-
while (enumerator.MoveNext())
-
{
-
string rString = enumerator.Current.Replace("\r\n", "
-
");
-
if ((rString.LastIndexOf("
-
") == -1) || (rString.LastIndexOf("
-
") != rString.Length))
-
{
-
rString = rString + "
-
";
-
}
-
errors.Add(rString);
-
}
-
return errors;
Bah!
Related posts:
- ASP.NET Provider Exceptions (ProviderException)
- ToolPart Class With System.Reflection
- How To Use PolicyLevel Objects For Display And Debugging
- Using DescriptionAttribute And Reflection For Building Typed Collections Off Enumerations
- Building A Simple SharePoint 2007 / WSS v3 WebPart
No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URL























Articles & Research
SharePoint Architecture
Research Methodology
Personal/Off-Topic
Article Or Research Filed Under 
