コード例 #1
0
        protected override async void PostNavigatedTo(NavigationEventArgs e)
        {
            if (SoftAP.SoftAPResult.ParticleDevice != null)
            {
                SoftAP.ResetSoftAPResult();
            }
            else if (e.NavigationMode == NavigationMode.Back)
            {
                return;
            }

            await SetupTinkerAsync();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: MainViewModel.cs プロジェクト: wisexie/Tool
        /// <summary>
        /// 加载事件
        /// </summary>
        protected override void Loaded()
        {
            base.Loaded();
            try
            {
                _ap             = new SoftAP();
                _timer          = new DispatcherTimer();
                _timer.Interval = new TimeSpan(0, 0, 4);
                _timer.Tick    += _timer_Tick;
                _timer.Start();

                var result = _ap.getSettings();
                Setting.Name     = result.SSID;
                Setting.Password = result.Password.Replace("\0", "");

                _hook = new KeyboardHook();
                _hook.KeyDownEvent += Hook_KeyDownEvent;
                _hook.Start();
            }
            catch (Exception ex)
            {
                LogHelper.ShowErrorMessage(ex);
            }
        }
コード例 #4
0
 private void BackButton_Click(object sender, RoutedEventArgs e)
 {
     SoftAP.BackButtonPressed();
 }