Ejemplo n.º 1
0
 public void Visit(CilProperty property)
 {
     WritePropertyHeader(property);
     WriteIndentation();
     _writer.WriteLine('{');
     WritePropertyBody(property);
     WriteIndentation();
     _writer.WriteLine('}');
     _writer.WriteLine();
 }
Ejemplo n.º 2
0
 public PropertyNode(CilProperty cp)
 {
     _property = cp;
     if (cp.HasGetter)
     {
         _children.Add(new MethodNode(cp.Getter));
     }
     if (cp.HasSetter)
     {
         _children.Add(new MethodNode(cp.Setter));
     }
 }
Ejemplo n.º 3
0
 private void WritePropertyHeader(CilProperty property)
 {
     WriteIndentation();
     _writer.Write(".property ");
     if (_options.ShowBytes)
     {
         _writer.Write("/* {0:X8} */ ", property.Token);
     }
     _writer.WriteLine(property.GetDecodedSignature());
     if (property.HasDefault)
     {
         WriteIndentation();
         _writer.WriteLine(string.Format(" = {0}", property.DefaultValue.GetValueString()));
     }
 }
Ejemplo n.º 4
0
        private void WritePropertyBody(CilProperty property)
        {
            Indent();
            foreach (var attribute in property.CustomAttributes)
            {
                attribute.Accept(this);
            }
            if (property.HasGetter)
            {
                WriteIndentation();
                _writer.Write(".get ");
                WritePropertyOrEventAccessor(property.Getter);
            }

            if (property.HasSetter)
            {
                WriteIndentation();
                _writer.Write(".set ");
                WritePropertyOrEventAccessor(property.Setter);
            }

            Unindent();
        }
Ejemplo n.º 5
0
 private void WritePropertyHeader(CilProperty property)
 {
     WriteIndentation();
     _writer.Write(".property ");
     if (_options.ShowBytes)
         _writer.Write("/* {0:X8} */ ", property.Token);
     _writer.WriteLine(property.GetDecodedSignature());
     if (property.HasDefault)
     {
         WriteIndentation();
         _writer.WriteLine(string.Format(" = {0}", property.DefaultValue.GetValueString()));
     }
 }
Ejemplo n.º 6
0
        private void WritePropertyBody(CilProperty property)
        {
            Indent();
            foreach (var attribute in property.CustomAttributes)
            {
                attribute.Accept(this);
            }
            if (property.HasGetter)
            {
                WriteIndentation();
                _writer.Write(".get ");
                WritePropertyOrEventAccessor(property.Getter);
            }

            if (property.HasSetter)
            {
                WriteIndentation();
                _writer.Write(".set ");
                WritePropertyOrEventAccessor(property.Setter);
            }

            Unindent();
        }
Ejemplo n.º 7
0
 public void Visit(CilProperty property)
 {
     WritePropertyHeader(property);
     WriteIndentation();
     _writer.WriteLine('{');
     WritePropertyBody(property);
     WriteIndentation();
     _writer.WriteLine('}');
     _writer.WriteLine();
 }