Exemplo n.º 1
0
        internal void LeaveElement(string name)
        {
#if DEBUG_CLASS
            Console.WriteLine("Leave {0}", name);
            Console.WriteLine(this);
#endif
            CurrentElement = CurrentElement.Parent;
        }
Exemplo n.º 2
0
        internal void EnterElement(string name, IEnumerable <Property> properties)
        {
#if DEBUG_CLASS
            Console.WriteLine("Enter {0}", name);
            Console.WriteLine(this);
#endif
            LanguageElement cur = CurrentElement;
            CurrentElement = new LanguageElement(name, CurrentElement, properties);
            if (cur == null)
            {
                RootElement = CurrentElement;
            }
            else
            {
                cur.Add(CurrentElement);
            }
        }
Exemplo n.º 3
0
        internal void CopyFrom(LanguageData other)
        {
#if DEBUG_CLASS
            Console.WriteLine("Copy {0}", other);
            Console.WriteLine(this);
#endif
            if (other.RootElement != null)
            {
                LanguageElement cur = CurrentElement;
                other.RootElement.Parent = CurrentElement;
                CurrentElement           = other.RootElement;
                if (cur == null)
                {
                    RootElement = CurrentElement;
                }
                else
                {
                    cur.Add(CurrentElement);
                }
            }
        }
Exemplo n.º 4
0
 public LanguageElement(string name, LanguageElement parent, IEnumerable <Property> properties)
 {
     Name       = name;
     Parent     = parent;
     Properties = properties.ToDictionary(p => p.Name, p => p.Value);
 }
Exemplo n.º 5
0
 internal LanguageText(string text, LanguageElement parent)
 {
     Text   = text;
     Parent = parent;
 }