Пример #1
0
        protected override void OnCreateControl( )
        {
            if (!this.DesignMode)
            {
                this.g_device_service = GraphicsDeviceService.AddInstance(this.Handle, this.ClientSize.Width, this.ClientSize.Height);

                this.services = new ServiceContainer( );
                this.services.AddService <IGraphicsDeviceService>(this.g_device_service);

                this.timer = Stopwatch.StartNew( );
                this.Initialize( );

                Application.Idle += delegate { this.Invalidate( ); };
            }

            base.OnCreateControl( );
        }
Пример #2
0
        protected override void Dispose( bool disposing )
        {
            if ( this.g_device_service != null ) {
                this.timer.Stop( );
                this.timer = null;
                this.services.RemoveService( this.g_device_service );
                this.g_device_service.Dispose( disposing );
                this.g_device_service = null;
            }

            base.Dispose( disposing );
        }
Пример #3
0
        protected override void OnCreateControl( )
        {
            if ( !this.DesignMode ) {
                this.g_device_service = GraphicsDeviceService.AddInstance( this.Handle, this.ClientSize.Width, this.ClientSize.Height );

                this.services = new ServiceContainer( );
                this.services.AddService<IGraphicsDeviceService>( this.g_device_service );

                this.timer = Stopwatch.StartNew( );
                this.Initialize( );

                Application.Idle += delegate { this.Invalidate( ); };
            }

            base.OnCreateControl( );
        }