Beispiel #1
0
        internal void LeaveElement(string name)
        {
#if DEBUG_CLASS
            Console.WriteLine("Leave {0}", name);
            Console.WriteLine(this);
#endif
            CurrentElement = CurrentElement.Parent;
        }
Beispiel #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);
            }
        }
Beispiel #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);
                }
            }
        }
 public LanguageElement(string name, LanguageElement parent, IEnumerable <Property> properties)
 {
     Name       = name;
     Parent     = parent;
     Properties = properties.ToDictionary(p => p.Name, p => p.Value);
 }
Beispiel #5
0
 internal LanguageText(string text, LanguageElement parent)
 {
     Text   = text;
     Parent = parent;
 }