Beispiel #1
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     chooser            = new AddressChooserTask();
     chooser.Completed += new EventHandler <AddressResult>(chooser_Completed);
     chooser.Show();
 }
        private void StackPanel_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            AddressChooserTask phoneNumberChooserTask = new AddressChooserTask();

            phoneNumberChooserTask.Completed += phoneNumberChooserTask_Completed;
            phoneNumberChooserTask.Show();
        }
Beispiel #3
0
        private void btnAddress_Click(object sender, RoutedEventArgs e)
        {
            AddressChooserTask act = new AddressChooserTask();

            act.Completed += address_Completed;
            act.Show();
        }
Beispiel #4
0
        private void addEmail_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            AddressChooserTask addressTask = new AddressChooserTask();

            addressTask.Completed += addressTask_Completed;
            addressTask.Show();
        }
 private void webBrowser_ScriptNotify(object sender, NotifyEventArgs e)
 {
     if (e.Value == "chooseAddress")
     {
         var task = new AddressChooserTask();
         task.Completed += task_Completed;
         task.Show();
     }
 }
 private void webBrowser_ScriptNotify(object sender, NotifyEventArgs e)
 {
     if (e.Value == "chooseAddress")
     {
         var task = new AddressChooserTask();
         task.Completed += task_Completed;
         task.Show();
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     AddressChooserTask task = new AddressChooserTask();
     task.Completed += (s, a) =>
     {
         if (a.TaskResult == TaskResult.OK)
             MessageBox.Show(a.Address, a.DisplayName, MessageBoxButton.OK);
     };
     task.Show();
 }
 private void addressChooser_Click(object sender, EventArgs e)
 {
     // with a local task, the completed event will be called when returning from dormant,
     // but WILL NOT be called when returning from tombstone.
     AddressChooserTask task = new AddressChooserTask();
     task.Completed += (object sender2, AddressResult e2) =>
     {
         if (e2.Error == null && e2.TaskResult == TaskResult.OK)
             System.Diagnostics.Debug.WriteLine("{0}: {1}", e2.DisplayName, e2.Address);
     };
     task.Show();
 }
Beispiel #9
0
        private void addressChooser_Click(object sender, EventArgs e)
        {
            // with a local task, the completed event will be called when returning from dormant,
            // but WILL NOT be called when returning from tombstone.
            AddressChooserTask task = new AddressChooserTask();

            task.Completed += (object sender2, AddressResult e2) =>
            {
                if (e2.Error == null && e2.TaskResult == TaskResult.OK)
                {
                    System.Diagnostics.Debug.WriteLine("{0}: {1}", e2.DisplayName, e2.Address);
                }
            };
            task.Show();
        }
Beispiel #10
0
        /// <summary>
        /// Address Chooser
        /// </summary>
        /// <param name="parameters"></param>
        public void chooseContact(string parameters)
        {
            // WP8 does not allow the editing of the contact.  Just return NOT AVAILABLE IN WINDOES PHONE 8 message
            string js = "javascript: var e = document.createEvent('Events');" +
                        "e.initEvent('intel.xdk.contacts.choose',true,true);e.success=false;" +
                        "e.error='NOT AVAILABLE IN WINDOES PHONE 8';document.dispatchEvent(e);";

            //InjectJS("javascript:" + js);
            InvokeCustomScript(new ScriptCallback("eval", new string[] { js }), true);
            return;


            try
            {
                if (busy == true)
                {
                    js = "javascript: var e = document.createEvent('Events');" +
                         "e.initEvent('intel.xdk.contacts.busy',true,true);e.success=false;" +
                         "e.message='busy';document.dispatchEvent(e);";
                    //InjectJS("javascript:" + js);
                    InvokeCustomScript(new ScriptCallback("eval", new string[] { js }), true);
                    return;
                }
                busy = true;

                addressChooserTask            = new AddressChooserTask();
                addressChooserTask.Completed += new EventHandler <AddressResult>(addressChooserTask_Completed);
                addressChooserTask.Show();
            }
            catch (Exception e)
            {
                js = string.Format(" var e = document.createEvent('Events');" +
                                   "e.initEvent('intel.xdk.contacts.choose',true,true);" +
                                   "e.success=false;e.error='{0}';document.dispatchEvent(e);", "There was a problem choosing a contact.");
                //InjectJS("javascript:" + js);
                InvokeCustomScript(new ScriptCallback("eval", new string[] { js }), true);
            }
        }
Beispiel #11
0
 private void GetContactAddressButtonTap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     var addressChooserTask = new AddressChooserTask();
     addressChooserTask.Completed += (s, r) =>
         {
             if (r.TaskResult == TaskResult.OK)
             {
                 if (((Button)sender).Tag.Equals("start"))
                 {
                     this.startingInput.Text = r.Address;
                 }
                 else
                 {
                     this.endingInput.Text = r.Address;
                 }
             }
         };
     addressChooserTask.Show();
 }
Beispiel #12
0
 private void addEmail_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     AddressChooserTask addressTask = new AddressChooserTask();
     addressTask.Completed += addressTask_Completed;
     addressTask.Show();
 }
 private void Import_Click(object sender, EventArgs e)
 {
     addressTask            = new AddressChooserTask();
     addressTask.Completed += new EventHandler <AddressResult>(addressTask_Completed);
     addressTask.Show();
 }
 private void EscolherEndereco_Click(object sender, RoutedEventArgs e)
 {
     addressChooserTask = new AddressChooserTask();
     addressChooserTask.Completed += AddressChooserTask_Completed;
     addressChooserTask.Show();
 }
Beispiel #15
0
 private void Contact_Click(object sender, EventArgs e)
 {
     addressChooserTask            = new AddressChooserTask();
     addressChooserTask.Completed += new EventHandler <AddressResult>(ContactSearch_Completed);
     addressChooserTask.Show();
 }
Beispiel #16
0
 public static void SelectContactAddress(Action<string, Exception> addressSelected)
 {
     var task = new AddressChooserTask();
     task.Completed += (s, e) => addressSelected.ExecuteIfNotNull(e.Address, e.Error);
     task.Show();
 }
Beispiel #17
0
 private void SearchButton_Click(object sender, RoutedEventArgs e)
 {
     addressTask.Show();
 }
 private void Import_Click(object sender, EventArgs e)
 {
     addressTask = new AddressChooserTask();
     addressTask.Completed += new EventHandler<AddressResult>(addressTask_Completed);
     addressTask.Show();
 }
 private void Address_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     act.Show();
 }