Beispiel #1
0
        /// <summary>
        /// Adds an Xml tab for the specified configuration
        /// </summary>
        /// <param name="configuration"></param>
        private void AddXmlTabForConfiguration(XmlConfiguration configuration)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new AddXmlTabForConfigurationInvoker(this.AddXmlTabForConfiguration), new object[] { configuration });
                return;
            }

            try
            {
                this.tabControlXmlViews.SuspendLayout();

                XmlConfigurationXmlBehindViewer view = new XmlConfigurationXmlBehindViewer();
                view.Xml = configuration.ToXml();

                TabPage page = new TabPage(configuration.ElementName);
                page.Controls.Add(view);
                view.Parent = page;
                view.Dock   = DockStyle.Fill;

                this.tabControlXmlViews.TabPages.Add(page);
                this.tabControlXmlViews.ResumeLayout(true);
            }
            catch (System.Exception systemException)
            {
                System.Diagnostics.Trace.WriteLine(systemException);
            }
        }
		/// <summary>
		/// Adds an Xml tab for the specified configuration
		/// </summary>
		/// <param name="configuration"></param>
		private void AddXmlTabForConfiguration(XmlConfiguration configuration)
		{
			if (this.InvokeRequired)
			{
				this.Invoke(new AddXmlTabForConfigurationInvoker(this.AddXmlTabForConfiguration), new object[] {configuration});
				return;
			}

			try
			{
				this.tabControlXmlViews.SuspendLayout();

				XmlConfigurationXmlBehindViewer view = new XmlConfigurationXmlBehindViewer();
				view.Xml = configuration.ToXml();

				TabPage page = new TabPage(configuration.ElementName);
				page.Controls.Add(view);
				view.Parent = page;
				view.Dock = DockStyle.Fill;
				
				this.tabControlXmlViews.TabPages.Add(page);				
				this.tabControlXmlViews.ResumeLayout(true);
			}
			catch(System.Exception systemException)
			{
				System.Diagnostics.Trace.WriteLine(systemException);
			}
		}