Пример #1
0
            public override object Load(XmlReader reader, ref Element current)
            {
                string file = null;

                try
                {
                    file = GameLoader.GetTemplateAttribute(reader, "ref");
                    if (file.Length == 0)
                    {
                        return(null);
                    }
                    string    path      = WorldModel.GetExternalPath(file);
                    XmlReader newReader = XmlReader.Create(path);
                    return(LoadIncludeElement(path, file, newReader));
                }
                catch (IncludeFileMissingException ifme)
                {
                    try
                    {
                        XmlReader newReader = WorldModel.CreateXmlReader(ifme.missingInclude);
                        return(LoadIncludeElement(ifme.missingInclude, file, newReader));
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.ToString());
                        return(null);
                    }
                }
            }