This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void DoSomething() { | |
while (true) { | |
var id = _rand.Next(); | |
if (id == 0) break; | |
if (id > 1) { | |
id += 1; | |
Console.Write(id); | |
break; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Runtime.InteropServices; | |
using System.Text.RegularExpressions; | |
namespace PServiceBus.Serializer.Xml { | |
public unsafe class XmlReaderEx : IDisposable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Runtime.InteropServices; | |
using System.Text.RegularExpressions; | |
namespace PServiceBus.Serializer.Xml { | |
public unsafe class XmlReaderEx : IDisposable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Xml; | |
namespace PServiceBus.Serializer.Xml { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics; | |
using System.Xml; | |
namespace SbVsXmlWriter { | |
class Program { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Xml; | |
namespace PServiceBus.Serializer.Xml { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Collections.Concurrent; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Xml; | |
using System.IO; | |
using System.Collections; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Collections.Concurrent; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Xml; | |
using System.IO; | |
using System.Collections; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string Serialize<T>(T obj) { | |
var sb = new StringBuilder(DEFAULT_SB_CAPACITY); | |
using (var writer = XmlWriter.Create(sb, | |
new XmlWriterSettings() { OmitXmlDeclaration = true })) { | |
WriteObject(obj, Normalize(obj.GetType().Name), writer); | |
writer.Flush(); | |
return sb.ToString(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Collections.Concurrent; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Xml; | |
using System.IO; |