public static void EventSink_WorldLoad() { Console.WriteLine("Loading Compendium Page Renderers"); if (!Directory.Exists(CompendiumRootPath)) { Directory.CreateDirectory(CompendiumRootPath); return; } string[] availableFiles = Directory.GetFiles(CompendiumRootPath, "*.xml"); foreach (string filename in availableFiles) { try { XDocument document = XDocument.Load(Path.Combine(CompendiumRootPath, filename)); CompendiumPageRenderer renderer = CompendiumPageRenderer.Deserialize(document); g_CompendiumRenderers.Add(renderer.Name, renderer); } catch (Exception e) { Console.WriteLine(e); } } }
public CompendiumPreviewPageGump(Mobile from, CompendiumPageRenderer renderer) : base(from, renderer) { Disposable = false; Closable = false; Resizable = false; }
public static CompendiumPageRenderer Deserialize(XDocument document) { CompendiumPageRenderer renderer = new CompendiumPageRenderer(); XElement page = document.Descendants("CompendiumArticle").First(); IEnumerable <XElement> compendiumElementsXml = page.Descendants("Element"); renderer.Name = page.Descendants("Name").First().Value; foreach (XElement xElement in compendiumElementsXml) { try { renderer.m_elements.Add(BaseCompendiumPageElement.CreateElement(xElement)); } catch { } } if (renderer.m_elements.Count <= 0) { renderer = null; } return(renderer); }
public CompendiumPageGump(Mobile from, CompendiumPageRenderer renderer) : base(from as PlayerMobile) { m_caller = from; Renderer = renderer; Disposable = true; Closable = true; Resizable = false; Dragable = true; }
public object Clone() { CompendiumPageRenderer renderer = new CompendiumPageRenderer(); renderer.Name = (string)this.Name.Clone(); renderer.SelectedElement = this.SelectedElement == null ? null : (BaseCompendiumPageElement)this.SelectedElement.Clone(); foreach (BaseCompendiumPageElement element in m_elements) { renderer.m_elements.Add((BaseCompendiumPageElement)element.Clone()); } return(renderer); }
public object Clone() { CompendiumPageRenderer renderer = new CompendiumPageRenderer(); renderer.Name = (string)this.Name.Clone(); renderer.SelectedElement = this.SelectedElement == null ? null : (BaseCompendiumPageElement)this.SelectedElement.Clone(); foreach (BaseCompendiumPageElement element in m_elements) { renderer.m_elements.Add((BaseCompendiumPageElement)element.Clone()); } return renderer; }
public object Clone() { var renderer = new CompendiumPageRenderer { Name = (string)Name.Clone(), SelectedElement = SelectedElement == null ? null : (BaseCompendiumPageElement)SelectedElement.Clone() }; foreach (var element in m_elements) { renderer.m_elements.Add((BaseCompendiumPageElement)element.Clone()); } return(renderer); }
public object Clone() { var renderer = new CompendiumPageRenderer { Name = (string)Name.Clone(), SelectedElement = SelectedElement == null ? null : (BaseCompendiumPageElement)SelectedElement.Clone() }; foreach (var element in m_elements) { renderer.m_elements.Add((BaseCompendiumPageElement)element.Clone()); } return renderer; }
public static CompendiumPageRenderer Deserialize(XDocument document) { var renderer = new CompendiumPageRenderer(); var page = document.Descendants("CompendiumArticle").First(); var compendiumElementsXml = page.Descendants("Element"); renderer.Name = page.Descendants("Name").First().Value; foreach (var xElement in compendiumElementsXml) { try { renderer.m_elements.Add(BaseCompendiumPageElement.CreateElement(xElement)); } catch { } } if (renderer.m_elements.Count <= 0) { renderer = null; } return renderer; }