What fun I'm having. I'm collaborating on a project for work. We're still using Visual Studio 2003 and .NET 1.1, but we're still wildly productive.
One interesting thing I've learned is that I lean on the libraries, while Paul, my counter-part leans on the language. He knows what language constructs to use and I know what BCL methods to use. Together we make an effective pair, but this realization helped us both better understand our weak areas. One can write lots of C in C#, if you know what I mean.
Do you lean on the language or the libraries?
We've been doing some fun stuff with XML lately, you might have noticed. We've used:
We've also used Helena's Xml Diff to do differences on the infoset, rather than the syntax.
Also. we're using:
class KindOfPartialSgmlButMoreOfAnOfxXmlWriter : XmlWriter
{
public KindOfPartialSgmlButMoreOfAnOfxXmlWriter(TextWriter w)
_htmlWriter = new HtmlTextWriter(w);
}
public override void Close()
_htmlWriter.Close();
private Stack _tags = new Stack();
private HtmlTextWriter _htmlWriter = null;
private bool _suppressNextEndElement = false;
private bool _suppressNextText = false;
private string _previousElement = null;
public override void WriteStartElement(string prefix, string localName, string ns)
_htmlWriter.WriteFullBeginTag(localName);
_previousElement = localName;
_tags.Push(localName);
public override void WriteString(string text)
if (_suppressNextText == false)
_htmlWriter.Write(text);
_suppressNextEndElement = true;
public override void WriteEndElement()
string endtag = _tags.Pop() as string;
if (_suppressNextEndElement && endtag == _previousElement)
_suppressNextEndElement = false;
else
_htmlWriter.WriteEndTag(endtag);
public override void Flush()
_htmlWriter.Flush();
public override void WriteWhitespace(string ws)
_htmlWriter.Write(ws);
public override void WriteRaw(string data)
_htmlWriter.Write(data);
public override void WriteChars(char[] buffer, int index, int count)
_htmlWriter.Write(buffer, index, count);
public override void WriteQualifiedName(string localName, string ns)
_htmlWriter.WriteBeginTag(localName);
public override void WriteEndAttribute()
_suppressNextText = false;
public override void WriteStartAttribute(string prefix, string localName, string ns)
_suppressNextText = true;
public override void WriteRaw(char[] buffer, int index, int count)
_htmlWriter.Write(buffer,index,count);
public override void WriteProcessingInstruction(string name, string text)
#region Stubs
...here are overriden versions of everything else from XmlWriter, stubbed and not used. Removed for tidiness
#endregion
Ads by The Lounge