Axiom.Framework.Configuration.WinFormConfigurationDialog.cmdOk_Click C# (CSharp) Метод

cmdOk_Click() защищенный Метод

protected cmdOk_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
		protected void cmdOk_Click( object sender, EventArgs e )
		{
			if ( cboRenderSystems.SelectedItem == null )
			{
				SWF.MessageBox.Show( "Please select a rendering system.", "Axiom", SWF.MessageBoxButtons.OK, SWF.MessageBoxIcon.Exclamation );
				this.DialogResult = SWF.DialogResult.Cancel;
				return;
			}

			Axiom.Graphics.RenderSystem system = (Axiom.Graphics.RenderSystem)cboRenderSystems.SelectedItem;

			string errorMsg = system.ValidateConfigOptions();
			if ( !String.IsNullOrEmpty( errorMsg ) )
			{
				SWF.MessageBox.Show( errorMsg, "Axiom", SWF.MessageBoxButtons.OK, SWF.MessageBoxIcon.Exclamation );
				this.DialogResult = SWF.DialogResult.Cancel;
				return;
			}

			Engine.RenderSystem = system;
			this.DialogResult = SWF.DialogResult.OK;
			this.Close();
		}