Пример #1
0
            public void Visit(TagBlockTagLayoutField field)
            {
                var className = MakeName(field.ElementLayout.Name);

                _writer.WriteLine("{0}struct {1};", _indent, className);
                using (var blockWriter = new StringWriter())
                {
                    var blockBuilder = new ClassBuilder(blockWriter, _indentLevel);
                    blockBuilder.Begin(className, field.ElementLayout.Size, field.ElementLayout.GroupTag);
                    field.ElementLayout.Accept(blockBuilder);
                    blockBuilder.End();
                    _subBlocks.Enqueue(blockWriter.ToString());
                }
                var type = string.Format("TagBlock<{0}>", className);

                AddElement(type, field.Name);
            }
            public void Visit(TagBlockTagLayoutField field)
            {
                string className;

                if (field.ElementLayout.Name != field.Name)
                {
                    className = MakeName(field.ElementLayout.Name);
                }
                else
                {
                    className = MakeName(field.ElementLayout.Name + " Block");
                }
                using (var blockWriter = new StringWriter())
                {
                    var blockBuilder = new ClassBuilder(blockWriter, _indentLevel);
                    blockBuilder.Begin(className, field.ElementLayout.Size, field.DataAlign, field.ElementLayout.GroupTag);
                    field.ElementLayout.Accept(blockBuilder);
                    blockBuilder.End();
                    _subBlocks.Enqueue(blockWriter.ToString());
                }
                var blockType = string.Format("List<{0}>", className);

                AddElement(blockType, field.Name);
            }
 public void Visit(TagBlockTagLayoutField field)
 {
     var className = MakeName(field.ElementLayout.Name);
     _writer.WriteLine("{0}struct {1};", _indent, className);
     using (var blockWriter = new StringWriter())
     {
         var blockBuilder = new ClassBuilder(blockWriter, _indentLevel);
         blockBuilder.Begin(className, field.ElementLayout.Size, field.ElementLayout.GroupTag);
         field.ElementLayout.Accept(blockBuilder);
         blockBuilder.End();
         _subBlocks.Enqueue(blockWriter.ToString());
     }
     var type = string.Format("TagBlock<{0}>", className);
     AddElement(type, field.Name);
 }
 public void Visit(TagBlockTagLayoutField field)
 {
     string className;
     if (field.ElementLayout.Name != field.Name)
         className = MakeName(field.ElementLayout.Name);
     else
         className = MakeName(field.ElementLayout.Name + " Block");
     using (var blockWriter = new StringWriter())
     {
         var blockBuilder = new ClassBuilder(blockWriter, _indentLevel);
         blockBuilder.Begin(className, field.ElementLayout.Size, field.DataAlign, field.ElementLayout.GroupTag);
         field.ElementLayout.Accept(blockBuilder);
         blockBuilder.End();
         _subBlocks.Enqueue(blockWriter.ToString());
     }
     var blockType = string.Format("List<{0}>", className);
     AddElement(blockType, field.Name);
 }