Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
 public CompendiumPreviewPageGump(Mobile from, CompendiumPageRenderer renderer)
     : base(from, renderer)
 {
     Disposable = false;
     Closable   = false;
     Resizable  = false;
 }
Ejemplo n.º 3
0
		public CompendiumPreviewPageGump(Mobile from, CompendiumPageRenderer renderer)
			: base(from, renderer)
		{
			Disposable = false;
			Closable = false;
			Resizable = false;
		}
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public CompendiumPageGump(Mobile from, CompendiumPageRenderer renderer)
     : base(from as PlayerMobile)
 {
     m_caller   = from;
     Renderer   = renderer;
     Disposable = true;
     Closable   = true;
     Resizable  = false;
     Dragable   = true;
 }
Ejemplo n.º 6
0
		public CompendiumPageGump(Mobile from, CompendiumPageRenderer renderer)
			: base(from as PlayerMobile)
		{
			m_caller = from;
			Renderer = renderer;
			Disposable = true;
			Closable = true;
			Resizable = false;
			Dragable = true;
		}
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
    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;
    }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
		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;
		}
Ejemplo n.º 11
0
		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;
		}