コード例 #1
0
ファイル: fmUpdate.cs プロジェクト: nghoang/tvkpme
 public fmUpdate(MainApp mainApp)
 {
     System.Guid desiredGuid = System.Guid.NewGuid();
     setup_path = Path.GetTempPath() + desiredGuid.ToString() + ".exe";
     InitializeComponent();
     this.mainApp = mainApp;
 }
コード例 #2
0
ファイル: ctlAdvertisement.cs プロジェクト: nghoang/tvkpme
 internal void SetTimer(int p, MainApp mainApp)
 {
     main = mainApp;
     lbTimer.Visible = true;
     currentTime = p;
     tmAds.Enabled = true;
 }
コード例 #3
0
ファイル: fmUpdate.cs プロジェクト: nghoang/tvkpme
        public UpdateActivity(MainApp main, string response)
        {
            try
            {
                if (response.Trim() != "")
                {
                    act = int.Parse(response.Split('#')[0]);
                }
            }
            catch (Exception ex)
            {
            }

            switch (act)
            {
                case 0 //current version
                :

                    if (main != null)
                        main.ShowMessage("You are using lastest version", "System notification");
                    break;
                case 8 //current version quiet
                :

                    break;
                case 1 //older version
                :

                    lastestVersion = response.Split('#')[1];
                    if (main != null)
                        main.AskUpdate();
                    break;
                case 2 //newer version
                :

                    if (main != null)
                        main.ShowMessage("You could be using illegal version. Please download the lastest version.", "System notification");
                    System.Diagnostics.Process.Start("http://www.tvking.tv");
                    if (main != null)
                        main.Close();
                    break;
                case 3 //show message
                :

                    if (main != null)
                        main.ShowMessage(response.Split('#')[1], "System notification");
                    break;
                case 4 //show message & update
                :

                    if (main != null)
                        main.ShowMessage(response.Split('#')[1], "System notification");
                    if (main != null)
                        main.AskUpdate();
                    break;
                case 5 //show message & close app
                :

                    if (main != null)
                        main.ShowMessage(response.Split('#')[1], "System notification");
                    if (main != null)
                        main.Close();
                    break;
                case 7 //error
                :

                    if (main != null)
                        main.ShowMessage("Our server currently cannot be connected", "System notification");
                    break;
                case 6 //show message & close app & open website
                :

                    if (main != null)
                        main.ShowMessage(response.Split('#')[1], "System notification");
                    System.Diagnostics.Process.Start(response.Split('#')[2]);
                    if (main != null)
                        main.Close();
                    break;
            }
        }