Example #1
0
 /// <summary>
 /// 启动
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void StartAction()
 {
     try
     {
         if (!_isStart)
         {
             if (SetWifiData())
             {
                 _ap.Start();
                 StartChange(true);
             }
             else
             {
                 StartChange(false);
             }
         }
         else
         {
             Stop();
         }
     }
     catch (Exception ex)
     {
         StartChange(false);
         LogHelper.ShowErrorMessage(ex);
     }
 }
        private void LaunchSoftAP()
        {
            UI.WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(typeof(Particle.Setup.SetupResources));

            SoftAPSettings softAPSettings = new SoftAPSettings();

            softAPSettings.AppFrame           = Frame;
            softAPSettings.CompletionPageType = GetType();
            softAPSettings.Username           = TinkerData.Username;
            softAPSettings.CurrentDeviceNames = TinkerData.GetDeviceNames();
            softAPSettings.OnSoftAPExit      += SoftAPSettings_OnSoftAPExit;

#if WINDOWS_PHONE_APP
            hardwareButtonsBackPressed = new EventHandler <Windows.Phone.UI.Input.BackPressedEventArgs>(delegate(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
            {
                e.Handled = SoftAP.BackButtonPressed();
            });

            Windows.Phone.UI.Input.HardwareButtons.BackPressed += hardwareButtonsBackPressed;
#endif

            SoftAP.Start(softAPSettings);
        }