public override void VisitEntity(CactusStack<IEntity2> current)
        {
            // Build a list of primary key fields:
            List<IEntityField2> primaryKeyFields = new List<IEntityField2>(current.Value.PrimaryKeyFields);
            List<IEntityField2> dirtyFields = new List<IEntityField2>();

            // Print the details:
            string prefix;

            if (current.Value.IsNew)
            {
                prefix = "[New]    ";
            }
            else if (current.Value.IsDirty)
            {
                prefix = "[Dirty]  ";
            }
            else
            {
                prefix = "         ";
            }

            string line = string.Format("{0}{1}{2} ({3}{4}{5})",
                prefix,
                "".PadLeft((current.Count - 1) * 4),
                EntityGraphPrintingVisitor.GetShortEntityName(current.Value),
                EntityGraphPrintingVisitor.GetFieldValuesDebugString(current.Value.PrimaryKeyFields, false),
                current.Value.IsDirty ? "; " : "",
                EntityGraphPrintingVisitor.GetFieldValuesDebugString(EntityGraphPrintingVisitor.GetDirtyFields(current.Value), true));

            _builder.AppendLine(line);
        }
        public override void VisitEntity(CactusStack<IEntity2> current)
        {
            if (!_predicate(current.Value)) return;

            int indent = 0;

            ReferenceLabeller labeller = new ReferenceLabeller();

            Console.WriteLine("Matching entity found:");

            StringBuilder builder = new StringBuilder();

            foreach (IEntity2 entity in current.Values)
            {
                EntityGraphPrintingVisitor.PrintCurrentEntity(builder, indent, entity, labeller, new string[] { });

                indent++;
            }

            Console.Write(builder.ToString());
        }
        public static NamespaceName Parse(string dottedName)
        {
            CactusStack<string> top = null;

            foreach (string part in dottedName.Split('.'))
            {
                if (top == null)
                {
                    top = new CactusStack<string>(part);
                }
                else
                {
                    top = top.Push(part);
                }
            }

            return new NamespaceName(top);
        }
 protected NamespaceName(CactusStack<string> name)
 {
     _name = name;
 }
 public NamespaceName(NamespaceName name, string identifier)
 {
     _name = name._name.Push(identifier);
 }
 public NamespaceName(string identifier)
 {
     _name = new CactusStack<string>(identifier);
 }
 public ProtocolIdentifier(ProtocolIdentifier protocolIdentifier, int number)
 {
     _numbers = protocolIdentifier._numbers.Push(number);
 }
 public ProtocolIdentifier(int number)
 {
     _numbers = new CactusStack<int>(number);
 }
 public virtual void VisitEntity(CactusStack<IEntity2> current)
 {
 }
 public virtual void VisitAlreadyVisitedEntity(CactusStack<IEntity2> cactusStack)
 {
 }
 public virtual void EndVisitingChildren(CactusStack<IEntity2> current)
 {
 }
 public override void VisitEntity(CactusStack<IEntity2> current)
 {
     _isDirty = _isDirty || current.Value.IsDirty;
 }