Ejemplo n.º 1
0
        protected void CloneInto(BaseConstruct newBaseConstruct)
        {
            newBaseConstruct.Name     = Name;
            newBaseConstruct.Omit     = Omit;
            newBaseConstruct.Comments = Comments.Clone();

            //newBaseConstruct.Attributes.Clear();
            //foreach(AttributeSection att in Attributes)
            //{
            //    AttributeSection att1 = (AttributeSection)att.Clone();
            //    att1.ParentObject = newBaseConstruct;
            //    newBaseConstruct.Attributes.Add(att1);
            //}

            newBaseConstruct.emptyPlaceholders.Clear();
            foreach (EmptyPlaceholder eph in emptyPlaceholders)
            {
                EmptyPlaceholder clone = (EmptyPlaceholder)eph.Clone();
                clone.ParentObject = newBaseConstruct;
                newBaseConstruct.emptyPlaceholders.Add(clone);
            }
            newBaseConstruct._Attributes.Clear();
            foreach (Attribute attr in _Attributes)
            {
                Attribute clone = (Attribute)attr.Clone();

                AttributeSection parentSec = new AttributeSection(null);
                parentSec.Target = ((AttributeSection)attr.ParentObject).Target;
                parentSec.AddAttribute(clone);
                newBaseConstruct.AddAttributeSection(parentSec);
            }

            newBaseConstruct.Index                = Index;
            newBaseConstruct.InputLength          = InputLength;
            newBaseConstruct.InputStartPos        = InputStartPos;
            newBaseConstruct.Language             = Language;
            newBaseConstruct.NumberOfLines        = NumberOfLines;
            newBaseConstruct.OutputOffset         = OutputOffset;
            newBaseConstruct.PreceedingBlankLines = PreceedingBlankLines;
            newBaseConstruct.XmlComments.Clear();
            foreach (string xml in XmlComments)
            {
                newBaseConstruct.XmlComments.Add(xml);
            }
        }
Ejemplo n.º 2
0
        public void EmptyPlaceholder()
        {
            EmptyPlaceholder inter = new EmptyPlaceholder(controller, "asdfasd", 2);

            CodeRoot root = CreateClassAndNamespace(inter);

            CodeRootMap map = new CodeRootMap();

            map.AddCodeRoot(root, Version.User);
            map.AddCodeRoot(root, Version.NewGen);
            map.AddCodeRoot(root, Version.PrevGen);

            string result = map.GetMergedCodeRoot().ToString();

            Assert.That(result, Is.EqualTo(root.ToString()));
            Assertions.StringContains(result, "class Class1");
            Assertions.StringContains(result, "[Serializable(true)]");
            Assertions.StringContains(result, "namespace ArchAngel.Tests");
            Assertions.StringContains(result, "asdfasd", 0);
        }
 public VBEmptyPlaceholderPrinter(EmptyPlaceholder obj)
 {
     this.obj = obj;
 }
 public VBEmptyPlaceholderPrinter(EmptyPlaceholder obj)
 {
     this.obj = obj;
 }
        public void EmptyPlaceholder()
        {
            EmptyPlaceholder inter = new EmptyPlaceholder(controller, "asdfasd", 2);

            Assert.That(inter.IsTheSame(inter.Clone(), ComparisonDepth.Outer), Is.True);
        }