コード例 #1
0
ファイル: MyMoodViewController.cs プロジェクト: ruscal/myMood
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Console.WriteLine("ViewDidLoad");

            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("DatabaseReset:"), "DatabaseReset", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("RemoteNotificationRecieved:"), "RemoteNotificationRecieved", null);

            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("HideSupportScreen:"), "HideSupportScreen", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("ShowSupportScreen:"), "ShowSupportScreen", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("ForceVersionUpdate:"), "ForceVersionUpdate", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("PromptsUpdated:"), "PromptsUpdated", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("SyncingWithServer:"), "SyncingWithServer", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("SyncWithServerComplete:"), "SyncWithServerComplete", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("newPromptRecieved:"), "newPromptRecieved", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("newPromptBackgroundRecieved:"), "newPromptBackgroundRecieved", null);

            btnInfo.TouchUpInside += (object sender, EventArgs e) => {
                //ShowHelp ();
                NavigateToIntroduction();
            };
            btnReport.TouchUpInside += (object sender, EventArgs e) => {
                ShowReport();
            };

            btnInterest.TouchUpInside += (object sender, EventArgs e) => {
                ShowInterest();
            };

            SupportBtn.TouchUpInside += (object sender, EventArgs e) => {
                ShowSupportScreen();
            };

            UpdateBtn.TouchUpInside += (object sender, EventArgs e) => {
                this.NavigateToUpdateApp();
            };

            this.tableView.AddNewMood += (object sender, AddNewResponseEventArgs e) => {
                this.AddNewMood(e.CurrentPrompt);
            };

            syncStatusBtnView = new SyncStatusButtonView(new RectangleF(10, 12, 25, 22));
            this.Add(syncStatusBtnView);
            SupportBtn.Hidden = true;



            // Perform any additional setup after loading the view, typically from a nib.
            //Refresh ();
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("SyncingWithServer:"), "SyncingWithServer", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("SyncWithServerComplete:"), "SyncWithServerComplete", null);

            syncStatusBtnView = new SyncStatusButtonView(new RectangleF(300, 80, 25, 22));
            this.Add(syncStatusBtnView);

            CancelBtn.TouchUpInside += (object sender, EventArgs e) => {
                this.NavigationController.PopViewControllerAnimated(true);
            };

            SyncDataBtn.TouchUpInside += (object sender, EventArgs e) => {
                NSNotificationCenter.DefaultCenter.PostNotificationName("SyncDataAndNotifications", null);
            };

            RefreshViewBtn.TouchUpInside += (object sender, EventArgs e) => {
                Refresh();
            };

            SaveChangesBtn.TouchUpInside += (object sender, EventArgs e) => {
                SaveApp();
            };

            LogsBtn.TouchUpInside += (object sender, EventArgs e) => {
                ShowLogs();
            };

            PromptsBtn.TouchUpInside += (object sender, EventArgs e) => {
                ShowPrompts();
            };

            NotificationsBtn.TouchUpInside += (object sender, EventArgs e) => {
                ShowNotifications();
            };

            Refresh();
        }