Example #1
0
		// Constructor we use in creating page for a Tabbed
		// or TreeBased dialog.
		public SettingsPage( string key) : this()
		{
			this.key = key;
			this.title = key;
			int dot = key.LastIndexOf( '.' );
			if ( dot >= 0 ) title = key.Substring(dot+1);
            this.messageDisplay = new MessageDisplay("NUnit Settings");
		}
        protected override void OnLoad(EventArgs e)
        {
            try//2013-1-12:NUnit.Gui.ArxNet.Tests.NUnitFormArxNetTests.ShowModalDialog测试加
            {
                if (ServicesArxNet.TestLoader == null) return;//build29938fix
                if (ServicesArxNet.TestLoader.AssemblyInfo == null) return;////build29938fix

                this.Text = "Test Assemblies";
                this.TextBox.WordWrap = false;
                //this.TextBox.ContentsResized += new ContentsResizedEventHandler(TextBox_ContentsResized);
                this.TextBox.Font = new System.Drawing.Font(FontFamily.GenericMonospace, 8.25F);

                base.OnLoad(e);

                Process p = Process.GetCurrentProcess();
                int currentProcessId = p.Id;
                string currentDomainName = "";

                /*AppendProcessInfo(
                      currentProcessId,
                      Path.GetFileName(Assembly.GetEntryAssembly().Location),
                      RuntimeFramework.CurrentFramework);*/

                AppendProcessInfo(
                      currentProcessId,
                      Path.GetFileName(p.MainModule.FileName),
                      RuntimeFramework.CurrentFramework);//2013-1-12:NUnit.Gui.ArxNet.Tests.NUnitFormArxNetTests.ShowModalDialog测试改

                foreach (TestAssemblyInfo info in ServicesArxNet.TestLoader.AssemblyInfo)
                {
                    if (info.ProcessId != currentProcessId)
                    {
                        this.TextBox.AppendText("\r\n");
                        AppendProcessInfo(info);
                        currentProcessId = info.ProcessId;
                    }

                    if (info.DomainName != currentDomainName)
                    {
                        AppendDomainInfo(info);
                        currentDomainName = info.DomainName;
                    }

                    AppendAssemblyInfo(info);
                }

                TextBox.Select(0, 0);
                TextBox.ScrollToCaret();
            }
            /*2013-1-12:NUnit.Gui.ArxNet.Tests.NUnitFormArxNetTests.ShowModalDialog测试加*/
            catch (SystemException exception)
            {
                IMessageDisplay messageDisplay = new MessageDisplay("nunit");
                messageDisplay.Error("TestAssemblyInfoFormArxNet unable to Load", exception);
            }
            /*2013-1-12:NUnit.Gui.ArxNet.Tests.NUnitFormArxNetTests.ShowModalDialog测试加*/
        }