예제 #1
0
파일: Compendium.cs 프로젝트: LordEnigma/UO
        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);
                }
            }
        }
예제 #2
0
 public CompendiumPreviewPageGump(Mobile from, CompendiumPageRenderer renderer)
     : base(from, renderer)
 {
     Disposable = false;
     Closable   = false;
     Resizable  = false;
 }
예제 #3
0
		public CompendiumPreviewPageGump(Mobile from, CompendiumPageRenderer renderer)
			: base(from, renderer)
		{
			Disposable = false;
			Closable = false;
			Resizable = false;
		}
예제 #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);
        }
예제 #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;
 }
예제 #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;
		}
예제 #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);
        }
예제 #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;
    }
예제 #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);
        }
예제 #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;
		}
예제 #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;
		}