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

            if (CallScriptTextView != null)
            {
                CallScriptTextView.Dispose();
                CallScriptTextView = null;
            }
        }
コード例 #2
0
        void ReleaseDesignerOutlets()
        {
            if (CallButton != null)
            {
                CallButton.Dispose();
                CallButton = null;
            }

            if (PhoneNumberText != null)
            {
                PhoneNumberText.Dispose();
                PhoneNumberText = null;
            }
        }
コード例 #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            var TranslatedNumber = string.Empty;

            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                var Translator = new PhoneTranslator();
                TranslatedNumber = Translator.ToNumber(PhoneNumberText.Text);

                if (string.IsNullOrWhiteSpace(TranslatedNumber))
                {
                    CallButton.SetTitle("Llamar", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle($"Llamar al {TranslatedNumber}", UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                var URL = new Foundation.NSUrl($"tel:{TranslatedNumber}");
                if (!UIApplication.SharedApplication.OpenUrl(URL))
                {
                    var Alert = UIAlertController.Create("No soportado",
                                                         "El esquema 'tel:' no es soportado en este dispositivo",
                                                         UIAlertControllerStyle.Alert);
                    Alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                    PresentViewController(Alert, true, null);
                }
            };

            Button0.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("0"); };
            Button1.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("1"); };
            Button2.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("2"); };
            Button3.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("3"); };
            Button4.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("4"); };
            Button5.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("5"); };
            Button6.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("6"); };
            Button7.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("7"); };
            Button8.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("8"); };
            Button9.TouchUpInside        += (object sender, EventArgs e) => { ShowDisplay("9"); };
            ButtonAsterisc.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("*"); };
            ButtonSharp.TouchUpInside    += (object sender, EventArgs e) => { ShowDisplay("#"); };
        }
コード例 #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();



            TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
                // Convert the phone number with text to a number
                // using PhoneTranslator.cs
                translatedNumber = Core.PhonewordTranslator.ToNumber(
                    PhoneNumberText.Text);

                // Dismiss the keyboard if text field was tapped
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };


            CallButton.TouchUpInside += (object sender, EventArgs e) => {
                var url = new NSUrl("tel:" + translatedNumber);

                // Store the phone number for the history screen
                phoneNumbers.Add(translatedNumber);

                // Use URL handler with tel: prefix to invoke Apple's Phone app,
                // otherwise show an alert dialog

                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var av = new UIAlertView("Not supported",
                                             "Scheme 'tel:' is not supported on this device",
                                             null,
                                             "OK",
                                             null);
                    av.Show();
                }
            };
        }
コード例 #5
0
        public async override void ViewDidLoad()
        {
            base.ViewDidLoad();

            string translatedNumber = "";

            TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
                // Convert the phone number with text to a number
                // using PhoneTranslator.cs
                translatedNumber = PhoneTranslator.ToNumber(PhoneNumberText.Text);

                // Dismiss the keyboard if text field was tapped
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            CallButton.TouchUpInside += (object sender, EventArgs e) => {
                var url = new NSUrl("tel:" + translatedNumber);

                // Use URL handler with tel: prefix to invoke Apple's Phone app,
                // otherwise show an alert dialog

                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var alert = UIAlertController.Create("Not supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                    PresentViewController(alert, true, null);
                }
            };

            signatureView.Layer.BorderColor = UIColor.FromRGBA(184, 134, 11, 255).CGColor;
            signatureView.Layer.BorderWidth = 1f;

            signatureView.StrokeCompleted += (sender, e) => UpdateControls();
            signatureView.Cleared         += (sender, e) => UpdateControls();

            UpdateControls();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.

            string translatedNumber = "";

            //TODO: Step 1a: uncomment to wire up TranslateButton

            TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
                // Convert the phone number with text to a number - from PhoneTranslator.cs
                translatedNumber = Core.PhonewordTranslator.ToNumber(PhoneNumberText.Text);

                // Dismiss the keyboard - if Text Field was tapped
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call ", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };


            //TODO: Step 1b: uncomment to wire up CallButton

            // On "Call" button-up, try to dial a phone number
            CallButton.TouchUpInside += (object sender, EventArgs e) => {
                var url = new NSUrl("tel:" + translatedNumber);

                // Use URL handler with tel: prefix to invoke the Apple's Phone app, otherwise show alert dialog
                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var av = new UIAlertView("Not supported",
                                             "Scheme 'tel:' is not supported on this device",
                                             null,
                                             "OK",
                                             null);
                    av.Show();
                }
            };
        }
コード例 #7
0
        public override void ViewDidLoad()
        {
            Console.WriteLine("デバッグログの出力");

            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // Convert the phone number with text to a number
                // using PhoneTranslator.cs
                translatedNumber = PhoneTranslator.ToNumber(
                    PhoneNumberText.Text);

                // Dismiss the keyboard if text field was tapped
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call ", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber,
                                        UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                //Store the phone number that we're dialing in PhoneNumbers
                PhoneNumbers.Add(translatedNumber);

                // Use URL handler with tel: prefix to invoke Apple's Phone app...
                var url = new NSUrl("tel:" + translatedNumber);

                // otherwise show an alert dialog
                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var alert = UIAlertController.Create("Not supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                    PresentViewController(alert, true, null);
                }
            };
        }
コード例 #8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            CallButton.Enabled = false;

            string translatedNumber = "";

            TranslateButton.TouchUpInside += (sender, e) =>
            {
                translatedNumber = PhonewordTranslator.ToNumber(PhoneNumberText.Text);
                if (translatedNumber != null)
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
                else
                {
                    CallButton.SetTitle("Call", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
            };

            PhoneNumberText.ShouldReturn += delegate {
                PhoneNumberText.ResignFirstResponder();
                return(true);
            };

            CallButton.TouchUpInside += delegate
            {
                var alertPrompt = new UIAlertView("Dial Number?",
                                                  "Do you want to call " + translatedNumber + "?",
                                                  null, "No", "Yes");

                alertPrompt.Dismissed += (sender, e) => {
                    if (e.ButtonIndex >= alertPrompt.FirstOtherButtonIndex)
                    {
                        phoneNumbers.Add(translatedNumber);
                        NSUrl url = new NSUrl("tel:" + translatedNumber);
                        UIApplication.SharedApplication.OpenUrl(url);
                    }
                };

                alertPrompt.Show();
            };
        }
コード例 #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            string translateNumber = "";

            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                translateNumber = PhoneTranslator.ToNumber(PhoneNumberText.Text);

                PhoneNumberText.ResignFirstResponder();
                if (translateNumber == "")
                {
                    CallButton.SetTitle("Call ", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translateNumber,
                                        UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // Use URL handler with tel: prefix to invoke Apple's Phone app...
                var url = new NSUrl("tel:" + translateNumber);

                // ...otherwise show an alert dialog
                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var alert = UIAlertController.Create("Not supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                    PresentViewController(alert, true, null);
                }
            };

            // Perform any additional setup after loading the view, typically from a nib.
            Button.AccessibilityIdentifier = "myButton";
            Button.TouchUpInside          += delegate
            {
                var title = string.Format("{0} clicks!", count++);
                Button.SetTitle(title, UIControlState.Normal);
            };
        }
コード例 #10
0
        public void Raycast()
        {
            RaycastHit hitInformation;
            Vector3    endPos = traceStart.transform.forward * traceRange;

            Debug.DrawRay(traceStart.transform.position, endPos, Color.blue, 10.0f);
            if (Physics.Raycast(traceStart.transform.position, traceStart.transform.forward, out hitInformation, traceRange, 15, QueryTriggerInteraction.Ignore))
            {
                Debug.DrawLine(hitInformation.transform.position, hitInformation.transform.position, Color.black, 1.0f);
                Debug.Log(hitInformation.transform.name);
                CallButton callbutton = hitInformation.transform.gameObject.GetComponent <CallButton>();
                if (callbutton)
                {
                    callbutton.CallElevator();
                }
            }
        }
コード例 #11
0
        void ReleaseDesignerOutlets()
        {
            if (CallButton != null)
            {
                CallButton.Dispose();
                CallButton = null;
            }

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

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

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

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

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

            if (trafficLabel != null)
            {
                trafficLabel.Dispose();
                trafficLabel = null;
            }
        }
コード例 #12
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
                translatedNumber = Core.PhonewordTranslator.ToNumber(PhoneNumberText.Text);
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == string.Empty)
                {
                    CallButton.SetTitle("Call", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            CallButton.TouchUpInside += (object sender, EventArgs e) => {
                PhoneNumbers.Add(translatedNumber);

                var url = new NSUrl("tel:" + translatedNumber);

                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var av = new UIAlertView("Not supported", "Scheme 'tel:' is not supported on this device", null, "OK", null);
                    av.Show();
                }
            };

            CallHistoryButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                CallHistoryController callHistory = this.Storyboard.InstantiateViewController("CallHistoryController") as CallHistoryController;
                if (callHistory != null)
                {
                    callHistory.PhoneNumbers = PhoneNumbers;
                    this.NavigationController.PushViewController(callHistory, true);
                }
            };
            // Perform any additional setup after loading the view, typically from a nib.
        }
コード例 #13
0
ファイル: ViewController.cs プロジェクト: YonglianQian/IOSXA
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            //translatebutton
            string translatedNumber = "";

            TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
                // Convert the phone number with text to a number
                // using PhoneTranslator.cs
                translatedNumber = PhoneTranslator.ToNumber(PhoneNumberText.Text);

                // Dismiss the keyboard if text field was tapped
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };
            //callbutton
            CallButton.TouchUpInside += (object sender, EventArgs e) => {
                //var url = new NSUrl("tel:" + translatedNumber);
                //if (!UIApplication.SharedApplication.OpenUrl(url))
                //{
                //    var alert = UIAlertController.Create("Not supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert);
                //    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                //    PresentViewController(alert, true, null);
                //}

                Analytics.TrackEvent("Button is clicked at " + DateTime.Now.ToLongTimeString());

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

            var TranslatedNumber = string.Empty;

            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                var Translator = new PhoneTranslator();
                TranslatedNumber = Translator.ToNumber(PhoneNumberText.Text);
                if (string.IsNullOrWhiteSpace(TranslatedNumber))
                {
                    // No hay número a llamar
                    CallButton.SetTitle("Llamar", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    // Hay un posible número telefónico a llamar
                    CallButton.SetTitle($"Llamar al {TranslatedNumber}",
                                        UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                var URL = new Foundation.NSUrl($"tel:{TranslatedNumber}");
                // Utilizar el manejador de URL con el prefijo tel: para invocar a la
                // aplicación Phone de Apple, de lo contrario mostrar un diálogo de alerta.
                if (!UIApplication.SharedApplication.OpenUrl(URL))
                {
                    var Alert = UIAlertController.Create("No soportado",
                                                         "El esquema 'tel:' no es soportado en este dispositivo",
                                                         UIAlertControllerStyle.Alert);
                    Alert.AddAction(UIAlertAction.Create("Ok",
                                                         UIAlertActionStyle.Default, null));
                    PresentViewController(Alert, true, null);
                }
            };
        }
コード例 #15
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            string translatedNumber = "";

            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // PhoneTranslator.csを使用してテキストから電話番号に変換します
                translatedNumber = Core.PhonewordTranslator.ToNumber(PhoneNumberText.Text);
                // TextField以外がタップされたらキーボードをDismissします
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // 変換した電話番号を追加します
                PhoneNumbers.Add(translatedNumber);

                // 標準の電話アプリを呼び出すためにtel:のプリフィックスでURLハンドラーを使用します
                var url = new NSUrl("tel:" + translatedNumber);

                // できない場合はAlertViewを呼び出します。
                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var alert = UIAlertController.Create("Not Supported", "Scheme 'tel' is not supported on this device", UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
                    PresentViewController(alert, true, null);
                }
            };
        }
コード例 #16
0
        void ReleaseDesignerOutlets()
        {
            if (CallButton != null)
            {
                CallButton.Dispose();
                CallButton = null;
            }

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

            if (TranslateButton != null)
            {
                TranslateButton.Dispose();
                TranslateButton = null;
            }
        }
コード例 #17
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // PhoneTranslator.cs を使用してテキストから電話番号に変換します
                translatedNumber = Core.PhonewordTranslator.ToNumber(PhoneNumberText.Text);                 // TextField がタップされたらキーボードを Dismiss します
                PhoneNumberText.ResignFirstResponder();
                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call", UIControlState.Normal); CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal); CallButton.Enabled = true;
                }
            };
            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // 変換した電話番号を PhoneNumbers に追加します
                PhoneNumbers.Add(translatedNumber);

                var url = new NSUrl("tel:" + translatedNumber);
                // 標準の電話アプリを呼び出すために tel:のプリフィックスで URL ハンドラーを使用します
                // できない場合は AlertView を呼び出します。
                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var alert = UIAlertController.Create(
                        "Not supported", "Scheme 'tel:' is not supported on this device",
                        UIAlertControllerStyle.Alert
                        );
                    alert.AddAction(UIAlertAction.Create(
                                        "Ok",
                                        UIAlertActionStyle.Default,
                                        null
                                        ));
                    PresentViewController(alert, true, null);
                }
            };
        }
コード例 #18
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            var TranslatedNumber = string.Empty;

            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                var Translator = new PhoneTranslator();

                TranslatedNumber = Translator.ToNumber(PhoneNumberText.Text);
                if (string.IsNullOrWhiteSpace(TranslatedNumber))
                {
                    CallButton.SetTitle("Llamar", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle($"Llamar al {TranslatedNumber}", UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };


            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                var URL = new Foundation.NSUrl($"tel:{TranslatedNumber}");

                if (!UIApplication.SharedApplication.OpenUrl(URL))
                {
                    var Alert = UIAlertController.Create("No soportado",
                                                         "El esquema 'tel:' no es soportado en este dispositivo",
                                                         UIAlertControllerStyle.Alert);
                    Alert.AddAction(UIAlertAction.Create("OK",
                                                         UIAlertActionStyle.Default, null));

                    PresentViewController(Alert, true, null);
                }
            };
        }
コード例 #19
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            CallButton.Enabled = false;

            PhoneNumberText.ShouldReturn += (textField) => {
                textField.ResignFirstResponder();
                return(true);
            };

            PhoneNumberText.ClearsOnBeginEditing = true;

            TranslateButton.TouchUpInside += (sender, e) => {
                // *** SHARED CODE ***
                translatedNumber = Core.PhonewordTranslator.ToNumber(PhoneNumberText.Text);


                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call ", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };
            CallButton.TouchUpInside += (sender, e) => {
                NSUrl url = new NSUrl("tel:" + translatedNumber);
                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var av = new UIAlertView("Not supported"
                                             , "Scheme 'tel:' is not supported on this device"
                                             , null
                                             , "OK"
                                             , null);
                    av.Show();
                }
            };
        }
コード例 #20
0
ファイル: ViewController.cs プロジェクト: masonmil/sandbox
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.


            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                translatedNumber = PhoneTranslator.ToNumber(
                    PhoneNumberText.Text);

                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == string.Empty)
                {
                    CallButton.SetTitle("Call ", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                var url = new NSUrl("tel:" + translatedNumber);
                PhoneNumbers.Add(translatedNumber);

                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var alert = UIAlertController.Create("Not Supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                    PresentViewController(alert, true, null);
                }
            };
        }
コード例 #21
0
        void ReleaseDesignerOutlets()
        {
            if (CallButton != null)
            {
                CallButton.Dispose();
                CallButton = null;
            }

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

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

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

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

            if (SaveButton != null)
            {
                SaveButton.Dispose();
                SaveButton = null;
            }
        }
コード例 #22
0
 void ReleaseDesignerOutlets()
 {
     if (CallButton != null)
     {
         CallButton.Dispose();
         CallButton = null;
     }
     if (CallHistoryButton != null)
     {
         CallHistoryButton.Dispose();
         CallHistoryButton = null;
     }
     if (PhoneNumberText != null)
     {
         PhoneNumberText.Dispose();
         PhoneNumberText = null;
     }
     if (TranslateButton != null)
     {
         TranslateButton.Dispose();
         TranslateButton = null;
     }
 }
コード例 #23
0
ファイル: ViewController.cs プロジェクト: pulmuone/Phoneword
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            string translatedNumber = "";

            TranslateButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // Convert the phone number with text to a number
                // using PhoneTranslator.cs
                translatedNumber = PhoneTranslator.ToNumber(PhoneNumberText.Text);

                // 키보드 해제
                PhoneNumberText.ResignFirstResponder();

                if (translatedNumber == "")
                {
                    CallButton.SetTitle("Call", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };


            CallButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                PhoneNumbers.Add(translatedNumber);
                var url = new NSUrl("tel:" + translatedNumber);

                // Use URL handler with tel: prefix to invoke Apple's Phone app,
                // otherwise show an alert dialog

                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var alert = UIAlertController.Create("Not supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                    PresentViewController(alert, true, null);
                }
            };

            //Segue 없이 탐색
            //CallHistoryButton.TouchUpInside += (object sender, EventArgs e) =>
            //{
            //    CallHistoryController callHistory = this.Storyboard.InstantiateViewController("CallHistoryController") as CallHistoryController;
            //    if (callHistory != null)
            //    {
            //        callHistory.PhoneNumbers = PhoneNumbers;
            //        this.NavigationController.PushViewController(callHistory, true);
            //    }
            //};

            //CAGradientLayer gradient = new CAGradientLayer();
            //gradient.Frame = this.CallButton.Frame;
            //gradient.Colors = new CGColor[] {UIColor.Yellow.CGColor , UIColor.Blue.CGColor};
            //gradient.StartPoint = new CGPoint(0.0, 0.5);
            //gradient.EndPoint = new CGPoint(0.5, 0.5);
            //gradient.Locations = new NSNumber[] {Convert.NS(this.CallButton.Frame.Location.X), this.CallButton.Frame.Location.X };

            //CallButton.Layer.InsertSublayer(gradient, 0);
            //CallButton.Layer.CornerRadius = CallButton.Frame.Size.Height / 2;
            //CallButton.Layer.BorderWidth = 5.0f;
        }
コード例 #24
0
        void ReleaseDesignerOutlets()
        {
            if (Button0 != null)
            {
                Button0.Dispose();
                Button0 = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (TranslateButton != null)
            {
                TranslateButton.Dispose();
                TranslateButton = null;
            }
        }
コード例 #25
0
 public Floor(int id, CallButton button)
 {
     this.id     = id;
     this.button = button;
 }
コード例 #26
0
 private void Awake()
 {
     PlayerController.OnActivate += HandleActivate;
     _callButton = GetComponentInChildren <CallButton>();
 }
コード例 #27
0
ファイル: CallPage.cs プロジェクト: Igwar/BstuTesting
 public CallPage ClickCallButton()
 {
     CallButton.Click();
     return(this);
 }
コード例 #28
0
 internal void updateCell(Stores store)
 {
     phoneNumber    = store.PhoneNumber;
     NameLabel.Text = store.Name;
     CallButton.SetTitle("Ph: " + store.PhoneNumber, UIControlState.Normal);
 }
コード例 #29
0
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

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

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

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

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

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

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

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

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

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

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

            if (RatingButton != null)
            {
                RatingButton.Dispose();
                RatingButton = null;
            }
        }
コード例 #30
0
        // PrepareForSegue is only used when a Segue is created in the storyboard
        // our final implementation handles this transition in code when
        // CallHistoryButton is pressed

//		public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender)
//		{
//			base.PrepareForSegue (segue, sender);
//
//			// set the View Controller that’s powering the screen we’re
//			// transitioning to
//
//			var callHistoryContoller = segue.DestinationViewController as CallHistoryController;
//
//			//set the Table View Controller’s list of phone numbers to the
//			// list of dialed phone numbers
//
//			if (callHistoryContoller != null) {
//				callHistoryContoller.PhoneNumbers = PhoneNumbers;
//			}
//		}

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.

            // Start with the CallButton Disabled
            CallButton.Enabled = false;

            // Code for when TranslateButton is pressed
            TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
                // Convert the phone number with text to a number
                // using PhoneTranslator.cs
                translatedNumber = Core.PhonewordTranslator.ToNumber(
                    PhoneNumberText.Text);

                // Dismiss the keyboard if text field was tapped
                PhoneNumberText.ResignFirstResponder();


                if (translatedNumber == "")
                {
                    // If the Translate Button was pressed with no input entered, set the Call Button
                    // to its original state
                    CallButton.SetTitle("Call", UIControlState.Normal);
                    CallButton.Enabled = false;
                }
                else
                {
                    // If the Translate Button was pressed with an input, add the translated number
                    // to the Call Button title and enable the Button to be pressed.
                    CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                    CallButton.Enabled = true;
                }
            };

            // Code for when CallHistoryButton is pressed
            CallHistoryButton.TouchUpInside += (object sender, EventArgs e) => {
                // Launches a new instance of CallHistoryController
                CallHistoryController callHistory = this.Storyboard.InstantiateViewController("CallHistoryController") as CallHistoryController;
                if (callHistory != null)
                {
                    // Set the PhoneNumbers List in the CallHistoryController to the PhoneNumbersList in this View Controller
                    callHistory.PhoneNumbers = PhoneNumbers;
                    // Push the callHistoryController onto the NavigationController's stack
                    this.NavigationController.PushViewController(callHistory, true);
                }
            };

            // Code for when CallButton is pressed
            CallButton.TouchUpInside += (object sender, EventArgs e) => {
                //store the phone number that we're dialing in PhoneNumbers
                // only if a number has been entered
                if (translatedNumber != "")
                {
                    PhoneNumbers.Add(translatedNumber);
                }

                //build the new url
                var url = new NSUrl("tel:" + translatedNumber);

                // Use URL handler with tel: prefix to invoke Apple's Phone app,
                // otherwise show an alert dialog

                if (!UIApplication.SharedApplication.OpenUrl(url))
                {
                    var av = new UIAlertView("Not supported",
                                             "Scheme 'tel:' is not supported on this device",
                                             null,
                                             "OK",
                                             null);
                    av.Show();
                }
            };
        }