コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (AvailableLabel != null)
            {
                AvailableLabel.Dispose();
                AvailableLabel = null;
            }

            if (mapView != null)
            {
                mapView.Dispose();
                mapView = null;
            }

            if (MarkLocButton != null)
            {
                MarkLocButton.Dispose();
                MarkLocButton = null;
            }

            if (ProgressFinishButton != null)
            {
                ProgressFinishButton.Dispose();
                ProgressFinishButton = null;
            }

            if (TaskDescLabel != null)
            {
                TaskDescLabel.Dispose();
                TaskDescLabel = null;
            }
        }
コード例 #2
0
        private void UpdateText()
        {
            int numMore = taskData.MinNumMarkers - markers.Count;

            if (numMore > 0)
            {
                ProgressFinishButton.SetTitle(string.Format("{0} more marker{1} needed!",
                                                            numMore,
                                                            (numMore > 1) ? "s" : ""),
                                              UIControlState.Disabled);
                ProgressFinishButton.Enabled = false;
            }
            else
            {
                ProgressFinishButton.SetTitle("Save and Finish", UIControlState.Normal);
                ProgressFinishButton.Enabled = true;
            }

            if (taskData.MaxNumMarkers == 0)
            {
                AvailableLabel.Text = "Place as many markers as you like!";
            }
            else
            {
                int numAvail = taskData.MaxNumMarkers - markers.Count;

                AvailableLabel.TextColor = (numAvail > 0) ? UIColor.Black : UIColor.Red;
                AvailableLabel.Text      = string.Format("You can place {0} more marker{1}",
                                                         numAvail, (numAvail != 1) ? "s" : "");
            }
        }