コード例 #1
0
        public override void Init()
        {
            view.Init();
            if( game.checkTask != null && game.checkTask.Done )
                SuccessfulUpdateCheck( game.checkTask );
            checkTask = new UpdateCheckTask();
            checkTask.CheckForUpdatesAsync();

            game.Window.Keyboard.KeyDown += KeyDown;
            game.Window.Keyboard.KeyUp += KeyUp;
            SetWidgetHandlers();
            Resize();
        }
コード例 #2
0
 void SuccessfulUpdateCheck( UpdateCheckTask task )
 {
     if( task.LatestDev == null || task.LatestStable == null ) return;
     dev = task.LatestDev; view.LastDev = dev.TimeBuilt;
     stable = task.LatestStable; view.LastStable = stable.TimeBuilt;
     Resize();
 }
コード例 #3
0
ファイル: MainScreen.cs プロジェクト: Retatta/ClassicalSharp
        void SuccessfulUpdateCheck( UpdateCheckTask task )
        {
            if( updateDone ) return;
            string latestVer = game.checkTask.LatestStable.Version.Substring( 1 );
            int spaceIndex = Program.AppName.LastIndexOf( ' ' );
            string currentVer = Program.AppName.Substring( spaceIndex + 1 );
            bool update = new Version( latestVer ) > new Version( currentVer );

            view.updateText = update ? "&aNew release available" : "&eUp to date     ";
            updateDone = true;
            game.MakeBackground();
            Resize();
            SelectWidget( selectedWidget );
        }