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