LoadUI() public method

Loads the UI from an XML document embedded in a stream
public LoadUI ( Stream configStream ) : void
configStream Stream Stream with XML document
return void
Esempio n. 1
0
		/// <summary>
		///
		/// </summary>
		/// <returns></returns>
		public Form NewMainWindow()
		{
			XWindow form = new XWindow();
			ImageHolder holder = new ImageHolder ();

			//noticed that we only have one size of image, so we are sticking it in both the small and the large lists
			form.AddLargeImageList(holder.miscImages, new string[]{"chat", "wheelchair", "food", "basinet", "submit"});
			form.AddLargeImageList(holder.airportImages, new string[]{"defaultLocation","USA", "Italy"});
			form.AddSmallImageList(holder.miscImages, new string[]{"chat", "wheelchair", "food", "basinet", "submit"});
			form.AddSmallImageList(holder.airportImages, new string[]{"defaultLocation","USA", "Italy"});
			form.LoadUI(ConfigurationPath);//Argument("x"));
			form.Show();
			return form;
		}
Esempio n. 2
0
		public override void FixtureSetup()
		{
			base.FixtureSetup();

			// load a persisted version of the property table.
			m_settingsPath = Path.Combine(TempPath, "settingsBackup");
			if (!Directory.Exists(m_settingsPath))
				Directory.CreateDirectory(m_settingsPath);

			m_window = new XWindow();
			m_window.PropertyTable.UserSettingDirectory = m_settingsPath;
			// delete any existing property table settings.
			m_window.PropertyTable.RemoveLocalAndGlobalSettings();
			//m_window.PropertyTable.SetProperty("PreferredUILibrary", "FlexUIAdapter.dll");
			m_window.LoadUI(ConfigurationFilePath);
		}
Esempio n. 3
0
		public void ZCreateUIfromStream()
		{
			Assembly assembly = Assembly.GetExecutingAssembly();
			using (System.IO.Stream stream =
				assembly.GetManifestResourceStream("XCore.basicTest.xml"))
			{
				Assert.IsNotNull(stream, "Couldn't get the XML file.");

				using (XCore.XWindow window = new XWindow())
				{
					window.PropertyTable.UserSettingDirectory = m_settingsPath;
					window.LoadUI(stream);

					ITestableUIAdapter adapter = (ITestableUIAdapter)window.MenuAdapter;
					Assert.AreEqual(adapter.GetItemCountOfGroup("Vowels"), 5);
				}
			}
		}
Esempio n. 4
0
		protected void ReopenWindow()
		{
			m_window.Close();
			m_window.Dispose();
			m_window = new XWindow();
			m_window.PropertyTable.UserSettingDirectory = m_settingsPath;
			//m_window.PropertyTable.SetProperty("PreferredUILibrary", "FlexUIAdapter.dll");
			m_window.LoadUI(ConfigurationFilePath);
			m_window.SuspendWindowSizePersistence();
			m_window.Show();
			m_window.ResumeWindowSizePersistence();
		}