Show() public method

public Show ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
コード例 #1
0
        public async void SetComponent(ComponentBase component)
        {
            _currentComponent = component;
            this.Content = null;

            var newControl = component.MainControl;

            if (newControl == null)
            {
                throw new Exception("The component " + component.GetType().Name + " does not define a Control.  Every component needs a control");
            }
            this.Content = newControl;

            await component.Show();
        }
コード例 #2
0
ファイル: InstallForm.cs プロジェクト: vchelaru/FlatRedBall
        public async void SetComponent(ComponentBase component)
        {
            _currentComponent = component;
            Controls.Clear();

            var newControl = component.MainControl;

            if (newControl == null)
            {
                throw new Exception("The component " + component.GetType().Name + " does not define a Control.  Every component needs a control");
            }


            var host = new ElementHost();
            host.Child = newControl;

            Controls.Add(host);
            host.Dock = DockStyle.Fill;
            host.Margin = new System.Windows.Forms.Padding(0);

            await component.Show();
        }