Esempio n. 1
0
 public Braces(CsWriter wtr)
 {
     _wtr = wtr;
     _wtr.WriteLine("{");
     _wtr.Indent++;
     _wtr._open.Add(this);
 }
Esempio n. 2
0
 void IDisposable.Dispose()
 {
     if (_wtr != null && _wtr._open.Remove(this))
     {
         _wtr.Indent--;
         _wtr.WriteLine("}");
         _wtr = null;
     }
 }
        public void TestBasicWriter()
        {
            using (CsWriter w = new CsWriter())
            {
                w.AddNamespaces("System");
                using(w.WriteNamespace("CSharpTest"))
                using (w.WriteClass("class Net"))
                { }

                string msg = w.ToString();
                Assert.IsTrue(msg.Contains("using System;"));
                Assert.IsTrue(msg.Contains("DebuggerNonUserCodeAttribute"));
                Assert.IsTrue(msg.Contains("CompilerGenerated"));
                Assert.IsTrue(msg.Contains("class Net"));
            }
        }
 void IDisposable.Dispose()
 {
     if (_wtr != null && _wtr._open.Remove(this))
     {
         _wtr.Indent--;
         _wtr.WriteLine("}");
         _wtr = null;
     }
 }
 public Braces(CsWriter wtr)
 {
     _wtr = wtr;
     _wtr.WriteLine("{");
     _wtr.Indent++;
     _wtr._open.Add(this);
 }