Beispiel #1
0
        private void Parse()
        {
            var blocks = new List <CodeBlock>();

            foreach (var block in GetCodeBlocks())
            {
                switch (block.Type)
                {
                case ".assembly":
                    var assembly = AssemblyBlock.Parse(block);
                    blocks.Add(assembly);
                    break;

                case ".class":
                    var clazz = ClassBlock.Parse(block);
                    blocks.Add(clazz);
                    break;

                default:
                    blocks.Add(block);
                    break;
                }
            }

            Blocks = blocks;
        }
Beispiel #2
0
        public void AddAssembly(AssemblyBlock assembly)
        {
            var index = Blocks.FindLastIndex(block => block is AssemblyBlock);

            Blocks.Insert(index + 1, assembly);
        }