diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..1ff0c42
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
index 176c449..e03a477 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,29 +1,356 @@
-Thumbs.db
-*.obj
-*.exe
-*.pdb
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
*.user
-*.aps
-*.pch
-*.vspscc
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
*_i.c
*_p.c
-*.ncb
-*.suo
-*.sln.docstates
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
*.tlb
+*.tli
*.tlh
-*.bak
-*.cache
-*.ilk
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
*.log
-[Bb]in
-[Dd]ebug*/
-*.lib
-*.sbr
-obj/
-[Rr]elease*/
-_ReSharper*/
-[Tt]est[Rr]esult*
+*.vspscc
*.vssscc
-$tf*/
\ No newline at end of file
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
diff --git a/Library/FreeImage.dll b/Library/FreeImage.dll
index 3ce0a70..ddf9120 100644
Binary files a/Library/FreeImage.dll and b/Library/FreeImage.dll differ
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e9a36bf
--- /dev/null
+++ b/README.md
@@ -0,0 +1,29 @@
+# **UIEdit: User Interface Editor for Angelica Engine Games**
+**UIEdit** is a powerful and intuitive user interface editing tool designed specifically for developers and designers working with the **Angelica Engine**—a modern game engine known for its flexibility and performance in 2D and 3D game development.
+
+## 🔧 **Core Features**
+- **WYSIWYG Interface**: UIEdit offers a "What You See Is What You Get" environment, allowing creators to visually design and manipulate UI elements in real time.
+- **Drag-and-Drop Editing**: Easily place, resize, and align UI components such as buttons, panels, sliders, and text fields with precision.
+- **Live Preview Mode**: Instantly preview how the UI will appear and behave in-game, with support for multiple screen resolutions and aspect ratios.
+- **Component-Based Architecture**: Each UI element is modular and customizable, supporting properties like animations, transitions, and event bindings.
+- **Theme and Style Management**: Create and apply consistent visual themes across your game’s interface, including fonts, colors, and textures.
+- **Localization Support**: Built-in tools for managing multilingual text and dynamic content updates.
+
+## 🧩 **Integration with Angelica Engine**
+- **Seamless Workflow**: UIEdit integrates directly with Angelica Engine’s asset pipeline, enabling real-time updates and synchronization between UI design and game logic.
+- **Script Binding**: Easily bind UI elements to game scripts using Angelica’s scripting language or visual scripting tools.
+- **Prefab System**: Save and reuse UI layouts as prefabs, making it easy to maintain consistency across menus, HUDs, and dialogs.
+
+## 🛠️ **Developer-Friendly Tools**
+- **Hierarchy and Layer Management**: Organize UI elements in a clear, tree-based structure with support for z-ordering and grouping.
+- **Event System**: Define interactive behaviors using a robust event system that supports mouse, touch, and controller input.
+- **Debugging Tools**: Visualize hitboxes, anchors, and layout constraints to fine-tune UI performance and responsiveness.
+
+## 🎮 **Use Cases**
+- Main menus, pause screens, and settings panels
+- In-game HUDs (health bars, minimaps, scoreboards)
+- Dialogue systems and inventory interfaces
+- Custom editor tools for modding or user-generated content
+
+## 🛠️ Contributing
+We welcome contributions! Please read our contributing guide to get started.
diff --git a/UIEdit.sln b/UIEdit.sln
index f3e0266..4878936 100644
--- a/UIEdit.sln
+++ b/UIEdit.sln
@@ -1,20 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30413.136
+MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UIEdit", "UIEdit\UIEdit.csproj", "{0AE589BD-158A-40B9-B4FF-7ED3314712F1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0AE589BD-158A-40B9-B4FF-7ED3314712F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0AE589BD-158A-40B9-B4FF-7ED3314712F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0AE589BD-158A-40B9-B4FF-7ED3314712F1}.Debug|x86.ActiveCfg = Debug|x86
+ {0AE589BD-158A-40B9-B4FF-7ED3314712F1}.Debug|x86.Build.0 = Debug|x86
{0AE589BD-158A-40B9-B4FF-7ED3314712F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0AE589BD-158A-40B9-B4FF-7ED3314712F1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0AE589BD-158A-40B9-B4FF-7ED3314712F1}.Release|x86.ActiveCfg = Release|x86
+ {0AE589BD-158A-40B9-B4FF-7ED3314712F1}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {ED290364-8B8C-47AA-A59E-734CD8000A74}
+ EndGlobalSection
EndGlobal
diff --git a/UIEdit/App.config b/UIEdit/App.config
index 8e15646..744f56d 100644
--- a/UIEdit/App.config
+++ b/UIEdit/App.config
@@ -1,6 +1,21 @@
-
+
+
+
+
+
+
-
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UIEdit/Controllers/LayoutController.cs b/UIEdit/Controllers/LayoutController.cs
index bbacc69..91854a1 100644
--- a/UIEdit/Controllers/LayoutController.cs
+++ b/UIEdit/Controllers/LayoutController.cs
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Linq;
+using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@@ -8,235 +9,746 @@
using System.Xml;
using UIEdit.Models;
using UIEdit.Utils;
+using UIEdit.Windows;
-namespace UIEdit.Controllers {
- public class LayoutController {
+namespace UIEdit.Controllers
+{
+ public class LayoutController
+ {
public string SourceText { get; set; }
- public UIDialog Dialog { get; set; }
+ public static UIDialog Dialog { get; set; }
- public Exception Parse(string text, string path) {
- var isValid = true;
- try {
+ public Exception Parse(string text, string path)
+ {
+ try
+ {
var tmpFileName = string.Format(@"{0}\tmp.xml", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));
File.WriteAllText(tmpFileName, text);
var xmlDoc = new XmlDocument();
xmlDoc.Load(tmpFileName);
- Dialog = new UIDialog {
- Name = xmlDoc.DocumentElement.Attributes["Name"].Value
- };
+ Dialog = new UIDialog();
+
+ if (xmlDoc.DocumentElement.Attributes.Cast().Any(t => t.Name == "Name"))
+ Dialog.Name = xmlDoc.DocumentElement.Attributes["Name"].Value;
if (xmlDoc.DocumentElement.Attributes.Cast().Any(t => t.Name == "Width"))
Dialog.Width = Convert.ToDouble(xmlDoc.DocumentElement.Attributes["Width"].Value);
if (xmlDoc.DocumentElement.Attributes.Cast().Any(t => t.Name == "Height"))
Dialog.Height = Convert.ToDouble(xmlDoc.DocumentElement.Attributes["Height"].Value);
- if (xmlDoc.DocumentElement.ChildNodes.Cast().Any(t => t.Name == "Resource")) {
- var dlgRes = xmlDoc.DocumentElement.ChildNodes.Cast().FirstOrDefault(t => t.Name == "Resource");
- if (dlgRes.ChildNodes.Cast().Any(t=>t.Name == "FrameImage"))
- Dialog.FrameImage = new UIResourceFrameImage {
- FileName = string.Format(@"{0}\{1}", path, dlgRes.ChildNodes.Cast().FirstOrDefault(t => t.Name == "FrameImage").Attributes["FileName"].Value)
- };
+ if (xmlDoc.DocumentElement.ChildNodes.Cast().Any(t => t.Name == "Resource"))
+ {
+ var dlgRes = xmlDoc.DocumentElement.ChildNodes.Cast().First(t => t.Name == "Resource");
+ if (dlgRes.ChildNodes.Cast().Any(t => t.Name == "FrameImage"))
+ Dialog.FrameImage = string.Format(@"{0}\{1}", path, dlgRes.ChildNodes.Cast().First(t => t.Name == "FrameImage").Attributes["FileName"].Value);
}
+ var xmlDocChilds = xmlDoc.DocumentElement.ChildNodes;
+
+ var childNode = xmlDocChilds.Cast().Where(t => t.Name == "EDIT");
+ foreach (var element in childNode)
+ {
+ var editControl = new UIEditBox();
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) editControl.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) editControl.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) editControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) editControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) editControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Hint"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Hint");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String"))
+ editControl.Hint = textNode.Attributes["String"].Value;
+ }
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Text"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Text");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String")) editControl.Text = textNode.Attributes["String"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "Hint")) editControl.Hint = textNode.Attributes["Hint"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "FontSize")) editControl.FontSize = Convert.ToDouble(textNode.Attributes["FontSize"].Value);
+ if (textNode.Attributes.Cast().Any(t => t.Name == "Color")) editControl.Color = textNode.Attributes["Color"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "FontName")) editControl.FontName = textNode.Attributes["FontName"].Value;
+ }
+
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Resource"))
+ {
+ var resourceNode = element.ChildNodes.Cast().First(node => node.Name == "Resource");
- foreach (XmlNode element in xmlDoc.DocumentElement.ChildNodes) {
- switch (element.Name) {
- case "IMAGEPICTURE":
- var imageControl = new UIImagePicture {
- Name = element.Attributes["Name"].Value,
- FileName = element.FirstChild != null && element.FirstChild.FirstChild != null
- ? string.Format(@"{0}\{1}", path, element.FirstChild.FirstChild.Attributes["FileName"].Value)
- : ""
- };
- if (element.Attributes.Cast().Any(t=>t.Name == "x")) imageControl.X = Convert.ToDouble(element.Attributes["x"].Value);
- if (element.Attributes.Cast().Any(t=>t.Name == "y")) imageControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Width")) imageControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Height")) imageControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
- Dialog.ImagePictures.Add(imageControl);
- break;
- case "SCROLL":
- var scrollControl = new UIScroll {
- Name = element.Attributes["Name"].Value
- };
- if (element.Attributes.Cast().Any(t => t.Name == "x")) scrollControl.X = Convert.ToDouble(element.Attributes["x"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "y")) scrollControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Width")) scrollControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Height")) scrollControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
- foreach (var node in element.ChildNodes.Cast().Where(node => node.Name == "Resource")) {
- var upImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "UpImage");
- if (upImage != null) scrollControl.UpImage = string.Format(@"{0}\{1}", path, upImage.Attributes["FileName"].Value);
-
- var downImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "DownImage");
- if (downImage != null) scrollControl.DownImage = string.Format(@"{0}\{1}", path, downImage.Attributes["FileName"].Value);
-
- var scrollImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "ScrollImage");
- if (scrollImage != null) scrollControl.ScrollImage = string.Format(@"{0}\{1}", path, scrollImage.Attributes["FileName"].Value);
-
- var barFrameImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "BarFrameImage");
- if (barFrameImage != null) scrollControl.BarFrameImage = string.Format(@"{0}\{1}", path, barFrameImage.Attributes["FileName"].Value);
- }
- Dialog.Scrolls.Add(scrollControl);
- break;
- case "RADIO":
- var radioControl = new UIRadioButton {
- Name = element.Attributes["Name"].Value,
- };
- if (element.Attributes.Cast().Any(t => t.Name == "x")) radioControl.X = Convert.ToDouble(element.Attributes["x"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "y")) radioControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Width")) radioControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Height")) radioControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
- if (element.ChildNodes != null && element.ChildNodes[0].Name == "Hint") {
- radioControl.Hint = element.ChildNodes != null
- ? element.ChildNodes[0].Attributes["String"].Value
- : "";
- }
- foreach (var node in element.ChildNodes.Cast().Where(node => node.Name == "Resource")) {
- var normalImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "NormalImage");
- if (normalImage != null) radioControl.NormalImage = string.Format(@"{0}\{1}", path, normalImage.Attributes["FileName"].Value);
-
- var checkedImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "CheckedImage");
- if (checkedImage != null) radioControl.CheckedImage = string.Format(@"{0}\{1}", path, checkedImage.Attributes["FileName"].Value);
-
- }
- Dialog.RadioButtons.Add(radioControl);
- break;
- case "STILLIMAGEBUTTON":
- var buttonControl = new UIStillImageButton {
- Name = element.Attributes["Name"].Value,
- };
- if (element.Attributes.Cast().Any(t => t.Name == "x")) buttonControl.X = Convert.ToDouble(element.Attributes["x"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "y")) buttonControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Width")) buttonControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Height")) buttonControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
- if (element.ChildNodes != null && element.ChildNodes[0].Name == "Hint") {
- buttonControl.Hint = element.ChildNodes != null
- ? element.ChildNodes[0].Attributes["String"].Value
- : "";
- }
- if (element.ChildNodes.Cast().Any(node => node.Name == "Text")) {
- var textNode = element.ChildNodes.Cast().First(node => node.Name == "Text");
- if (textNode.Attributes.Cast().Any(t => t.Name == "String")) buttonControl.Text = textNode.Attributes["String"].Value;
- if (textNode.Attributes.Cast().Any(t => t.Name == "FontSize")) buttonControl.FontSize = Convert.ToDouble(textNode.Attributes["FontSize"].Value);
- if (textNode.Attributes.Cast().Any(t => t.Name == "Color")) buttonControl.Color = textNode.Attributes["Color"].Value;
- if (textNode.Attributes.Cast().Any(t => t.Name == "OutlineColor")) buttonControl.OutlineColor = textNode.Attributes["OutlineColor"].Value;
- if (textNode.Attributes.Cast().Any(t => t.Name == "InnerColor")) buttonControl.InnerColor = textNode.Attributes["InnerColor"].Value;
- }
- foreach (var node in element.ChildNodes.Cast().Where(node => node.Name == "Resource")) {
- var upImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "FrameUpImage");
- if (upImage != null) buttonControl.UpImage = string.Format(@"{0}\{1}", path, upImage.Attributes["FileName"].Value);
-
- var downImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "FrameDownImage");
- if (downImage != null) buttonControl.DownImage = string.Format(@"{0}\{1}", path, downImage.Attributes["FileName"].Value);
-
- var hoverImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "FrameOnHoverImage");
- if (hoverImage != null) buttonControl.HoverImage = string.Format(@"{0}\{1}", path, hoverImage.Attributes["FileName"].Value);
-
- }
- Dialog.StillImageButtons.Add(buttonControl);
- break;
- case "LABEL":
- var labelControl = new UILabel {
- Name = element.Attributes["Name"].Value,
- };
- if (element.Attributes.Cast().Any(t => t.Name == "x")) labelControl.X = Convert.ToDouble(element.Attributes["x"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "y")) labelControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Width")) labelControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Height")) labelControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
- if (element.ChildNodes.Cast().Any(node => node.Name == "Text")) {
- var textNode = element.ChildNodes.Cast().First(node => node.Name == "Text");
- if (textNode.Attributes.Cast().Any(t => t.Name == "String")) labelControl.Text = textNode.Attributes["String"].Value;
- if (textNode.Attributes.Cast().Any(t => t.Name == "FontSize")) labelControl.FontSize = Convert.ToDouble(textNode.Attributes["FontSize"].Value);
- if (textNode.Attributes.Cast().Any(t => t.Name == "Color")) labelControl.Color = textNode.Attributes["Color"].Value;
- if (textNode.Attributes.Cast().Any(t => t.Name == "OutlineColor")) labelControl.OutlineColor = textNode.Attributes["OutlineColor"].Value;
- if (textNode.Attributes.Cast().Any(t => t.Name == "TextUpperColor")) labelControl.TextUpperColor = textNode.Attributes["TextUpperColor"].Value;
- if (textNode.Attributes.Cast().Any(t => t.Name == "TextLowerColor")) labelControl.TextLowerColor = textNode.Attributes["TextLowerColor"].Value;
- }
- Dialog.Labels.Add(labelControl);
- break;
- case "EDIT":
- var editControl = new UIEditBox {
- Name = element.Attributes["Name"].Value
- };
- if (element.Attributes.Cast().Any(t => t.Name == "x")) editControl.X = Convert.ToDouble(element.Attributes["x"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "y")) editControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Width")) editControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
- if (element.Attributes.Cast().Any(t => t.Name == "Height")) editControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
- if (element.ChildNodes.Cast().Any(node => node.Name == "Text")) {
- var textNode = element.ChildNodes.Cast().First(node => node.Name == "Text");
- if (textNode.Attributes.Cast().Any(t => t.Name == "String")) editControl.Text = textNode.Attributes["String"].Value;
- if (textNode.Attributes.Cast().Any(t => t.Name == "FontSize")) editControl.FontSize = Convert.ToDouble(textNode.Attributes["FontSize"].Value);
- if (textNode.Attributes.Cast().Any(t => t.Name == "Color")) editControl.Color = textNode.Attributes["Color"].Value;
- }
- foreach (var node in element.ChildNodes.Cast().Where(node => node.Name == "Resource")) {
- var frameImage = node.ChildNodes.Cast().FirstOrDefault(t => t.Name == "FrameImage");
- if (frameImage != null) editControl.FrameImage = new UIResourceFrameImage { FileName = string.Format(@"{0}\{1}", path, frameImage.Attributes["FileName"].Value) };
- }
- Dialog.Edits.Add(editControl);
- break;
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "FrameImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "FrameImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ editControl.FrameImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
}
+ Dialog.Edits.Add(editControl);
+ }
+ childNode = xmlDocChilds.Cast().Where(t => t.Name == "IMAGEPICTURE");
+ foreach (var element in childNode)
+ {
+ var imageControl = new UIImagePicture();
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Resource"))
+ {
+ var resourceNode = element.ChildNodes.Cast().First(t => t.Name == "Resource");
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "FrameImage"))
+ {
+ XmlNode frameImageNode = resourceNode.ChildNodes.Cast().FirstOrDefault(t => t.Name == "FrameImage");
+ if (frameImageNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ imageControl.FileName = string.Format(@"{0}\{1}", path, frameImageNode.Attributes["FileName"].Value);
+ if (frameImageNode.Attributes.Cast().Any(t => t.Name == "Frames"))
+ imageControl.Frames = Convert.ToInt32(frameImageNode.Attributes["Frames"].Value);
+ }
+ }
+
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) imageControl.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) imageControl.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) imageControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) imageControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) imageControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Hint"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Hint");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String"))
+ imageControl.Hint = textNode.Attributes["String"].Value;
+ }
+
+ Dialog.ImagePictures.Add(imageControl);
+ }
+ childNode = xmlDocChilds.Cast().Where(t => t.Name == "SCROLL");
+ foreach (var element in childNode)
+ {
+ var scrollControl = new UIScroll();
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) scrollControl.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) scrollControl.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) scrollControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) scrollControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) scrollControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Resource"))
+ {
+ var resourceNode = element.ChildNodes.Cast().First(t => t.Name == "Resource");
+
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "UpImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().FirstOrDefault(t => t.Name == "UpImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ scrollControl.UpImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "DownImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "DownImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ scrollControl.DownImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "ScrollImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "ScrollImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ scrollControl.ScrollImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "BarFrameImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "BarFrameImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ scrollControl.BarFrameImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ }
+ Dialog.Scrolls.Add(scrollControl);
+ }
+ childNode = xmlDocChilds.Cast().Where(t => t.Name == "PROGRESS");
+ foreach (var element in childNode)
+ {
+ var progressBar = new UIProgressBar();
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) progressBar.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) progressBar.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) progressBar.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) progressBar.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) progressBar.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Resource"))
+ {
+ var resourceNode = element.ChildNodes.Cast().First(t => t.Name == "Resource");
+
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "FrameImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "FrameImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ progressBar.FrameImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "FillImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "FillImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ progressBar.FillImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ }
+ Dialog.ProgressBars.Add(progressBar);
+ }
+ childNode = xmlDocChilds.Cast().Where(t => t.Name == "RADIO");
+ foreach (var element in childNode)
+ {
+ var radioControl = new UIRadioButton();
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) radioControl.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) radioControl.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) radioControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) radioControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) radioControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Hint"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Hint");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String"))
+ radioControl.Hint = textNode.Attributes["String"].Value;
+ }
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Resource"))
+ {
+ var resourceNode = element.ChildNodes.Cast().First(node => node.Name == "Resource");
+
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "NormalImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "NormalImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ radioControl.NormalImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ // Not used
+ //if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "CheckedImage"))
+ //{
+ // var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "CheckedImage");
+ // if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ // radioControl.CheckedImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ //}
+ }
+ Dialog.RadioButtons.Add(radioControl);
+ }
+ childNode = xmlDocChilds.Cast().Where(t => t.Name == "CHECK");
+ foreach (var element in childNode)
+ {
+ var checkBox = new UICheckBox();
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) checkBox.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) checkBox.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) checkBox.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) checkBox.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) checkBox.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Hint"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Hint");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String"))
+ checkBox.Hint = textNode.Attributes["String"].Value;
+ }
+
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Resource"))
+ {
+ var resourceNode = element.ChildNodes.Cast().First(node => node.Name == "Resource");
+
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "NormalImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "NormalImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ checkBox.NormalImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ // Not used
+ //if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "CheckedImage"))
+ //{
+ // var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "CheckedImage");
+ // if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ // checkBox.CheckedImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ //}
+ }
+ Dialog.CheckBoxes.Add(checkBox);
+
+ }
+ childNode = xmlDocChilds.Cast().Where(t => t.Name == "STILLIMAGEBUTTON");
+ foreach (var element in childNode)
+ {
+ var buttonControl = new UIStillImageButton();
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) buttonControl.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) buttonControl.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) buttonControl.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) buttonControl.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) buttonControl.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Hint"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Hint");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String"))
+ buttonControl.Hint = textNode.Attributes["String"].Value;
+ }
+
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Text"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Text");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String")) buttonControl.Text = textNode.Attributes["String"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "FontSize")) buttonControl.FontSize = Convert.ToDouble(textNode.Attributes["FontSize"].Value);
+ if (textNode.Attributes.Cast().Any(t => t.Name == "FontName")) buttonControl.FontName = textNode.Attributes["FontName"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "Color")) buttonControl.Color = textNode.Attributes["Color"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "OutlineColor")) buttonControl.OutlineColor = textNode.Attributes["OutlineColor"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "InnerColor")) buttonControl.InnerColor = textNode.Attributes["InnerColor"].Value;
+ }
+
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Resource"))
+ {
+ var resourceNode = element.ChildNodes.Cast().First(node => node.Name == "Resource");
+
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "FrameUpImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "FrameUpImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ buttonControl.FrameUpImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ // Not used
+ //if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "FrameDownImage"))
+ //{
+ // var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "FrameDownImage");
+ // if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ // buttonControl.FrameDownImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ //}
+ //if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "FrameOnHoverImage"))
+ //{
+ // var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "FrameOnHoverImage");
+ // if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ // buttonControl.FrameOnHoverImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ //}
+ }
+ Dialog.StillImageButtons.Add(buttonControl);
+ }
+ childNode = xmlDocChilds.Cast().Where(t => t.Name == "LIST");
+ foreach (var element in childNode)
+ {
+ var listBox = new UIListBox();
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) listBox.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) listBox.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) listBox.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) listBox.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) listBox.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "MultiLine")) listBox.MultiLine = element.Attributes["MultiLine"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "LineSpace")) listBox.LineSpace = Convert.ToInt32(element.Attributes["LineSpace"].Value);
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Hint"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Hint");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String"))
+ listBox.Hint = textNode.Attributes["String"].Value;
+ }
+
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Text"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Text");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String")) listBox.Text = textNode.Attributes["String"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "FontSize")) listBox.FontSize = Convert.ToDouble(textNode.Attributes["FontSize"].Value);
+ if (textNode.Attributes.Cast().Any(t => t.Name == "FontName")) listBox.FontName = textNode.Attributes["FontName"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "Color")) listBox.Color = textNode.Attributes["Color"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "OutlineColor")) listBox.OutlineColor = textNode.Attributes["OutlineColor"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "InnerTextColor")) listBox.InnerTextColor = textNode.Attributes["InnerTextColor"].Value;
+ }
+
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Resource"))
+ {
+ var resourceNode = element.ChildNodes.Cast().First(node => node.Name == "Resource");
+
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "FrameImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "FrameImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ listBox.FrameImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "HilightImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "HilightImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ listBox.HilightImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "UpImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "UpImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ listBox.UpImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "DownImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "DownImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ listBox.DownImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "ScrollImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "ScrollImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ listBox.ScrollImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ if (resourceNode.ChildNodes.Cast().Any(t => t.Name == "BarImage"))
+ {
+ var imagePathNode = resourceNode.ChildNodes.Cast().First(t => t.Name == "BarImage");
+ if (imagePathNode.Attributes.Cast().Any(t => t.Name == "FileName"))
+ listBox.BarImage = string.Format(@"{0}\{1}", path, imagePathNode.Attributes["FileName"].Value);
+ }
+ }
+ Dialog.ListBoxes.Add(listBox);
+ }
+ childNode = xmlDocChilds.Cast().Where(t => t.Name == "TREE");
+ foreach (var element in childNode)
+ {
+ var Tree = new UITree();
+ if (element.Attributes.Cast().Any(t => t.Name == "Name")) Tree.Name = element.Attributes["Name"].Value;
+ if (element.Attributes.Cast().Any(t => t.Name == "x")) Tree.X = Convert.ToDouble(element.Attributes["x"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "y")) Tree.Y = Convert.ToDouble(element.Attributes["y"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Width")) Tree.Width = Convert.ToDouble(element.Attributes["Width"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Height")) Tree.Height = Convert.ToDouble(element.Attributes["Height"].Value);
+ if (element.Attributes.Cast().Any(t => t.Name == "Indent")) Tree.Indent = Convert.ToInt32(element.Attributes["Indent"].Value);
+ if (element.ChildNodes.Cast().Any(t => t.Name == "Hint"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Hint");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String"))
+ Tree.Hint = textNode.Attributes["String"].Value;
+ }
+
+ if (element.ChildNodes.Cast().Any(node => node.Name == "Text"))
+ {
+ var textNode = element.ChildNodes.Cast().First(node => node.Name == "Text");
+ if (textNode.Attributes.Cast().Any(t => t.Name == "String")) Tree.Text = textNode.Attributes["String"].Value;
+ if (textNode.Attributes.Cast().Any(t => t.Name == "FontSize")) Tree.FontSize = Convert.ToDouble(textNode.Attributes["FontSize"].Value);
+ if (textNode.Attributes.Cast