Ejemplo n.º 1
0
 private void InitCommands()
 {
     _toSystem = new FlexiableCommand(() =>
     {
         DeviceSelectionObserver.Instance.CurrentDevice.Reboot2System();
     })
     {
         CanExecuteProp = false
     };
     _toRecovery = new FlexiableCommand(() =>
     {
         DeviceSelectionObserver.Instance.CurrentDevice.Reboot2Recovery();
     })
     {
         CanExecuteProp = false
     };;
     _toFastboot = new FlexiableCommand(() =>
     {
         DeviceSelectionObserver.Instance.CurrentDevice.Reboot2Fastboot();
     })
     {
         CanExecuteProp = false
     };;
     _to9008 = new FlexiableCommand(() =>
     {
         DeviceSelectionObserver.Instance.CurrentDevice.Reboot29008();
     })
     {
         CanExecuteProp = false
     };
 }
Ejemplo n.º 2
0
 public VMDeviceBar()
 {
     if (IsDesignMode())
     {
         return;
     }
     ConnectDevice = new FlexiableCommand((p) =>
     {
         openFxManager.RunExtension("ENetDeviceConnecter");
     });
     DisconnectDevice = new FlexiableCommand((p) =>
     {
         openFxManager.RunExtension("ENetDeviceDisconnecter");
     });
     OpenDeviceNetDebugging = new FlexiableCommand((p) =>
     {
         openFxManager.RunExtension("EOpenUsbDeviceNetDebugging");
     });
     devicesManager.ConnectedDevicesChanged += (s, e) =>
     {
         Devices = e.Devices;
         if (Devices.Count() >= 1)
         {
             SelectedDevice = Devices.First();
         }
     };
     RefreshCommandState();
 }
Ejemplo n.º 3
0
 public VMDefaultInformation()
 {
     Donate = new FlexiableCommand(() =>
     {
         (App.Current.MainWindow as MainWindow).DialogHost.ShowDialog(new ContentDonate());
     });
     ViewOpenSource = new FlexiableCommand(() =>
     {
         (App.Current.MainWindow as MainWindow).DialogHost.ShowDialog(new ContentOpenSource());
     });
 }
Ejemplo n.º 4
0
 public VMMore()
 {
     OpenLibsView = new FlexiableCommand(() =>
     {
         new LibsWindow().ShowDialog();
     });
     OpenExtFloder = new FlexiableCommand(() =>
     {
         Process.Start(BuildInfo.DEFAULT_EXTENSION_PATH);
     });
     ApiVersion = BuildInfo.SDK_VERSION.ToString();
 }
Ejemplo n.º 5
0
 public VMHome()
 {
     Donate = new FlexiableCommand(() =>
     {
         DialogHost.Show(new ContentDonate());
     });
     OpenUrl = new FlexiableCommand((args) =>
     {
         try
         {
             Process.Start(args.ToString());
         }
         catch { }
     });
 }
Ejemplo n.º 6
0
 public VMConnectDevices()
 {
     ConnectDevice = new FlexiableCommand((p) =>
     {
         new ContentConnectNetDevice().Show();
     });
     DisconnectDevice = new FlexiableCommand((p) =>
     {
         new ContentDisconnectDevice().Show();
     });
     OpenDeviceNetDebugging = new FlexiableCommand((p) =>
     {
         new ContentEnableDeviceNetDebugging().Show();
     });
     ConnectedDevicesListener.Instance.DevicesChanged += ConnectedDevicesChanged;
 }
Ejemplo n.º 7
0
 public VMConnectDevices()
 {
     ConnectDevice = new FlexiableCommand((p) =>
     {
         AtmbContext.Instance.NewExtensionThread("ENetDeviceConnecter")?.Start();
     });
     DisconnectDevice = new FlexiableCommand((p) =>
     {
         AtmbContext.Instance.NewExtensionThread("ENetDeviceDisconnecter")?.Start();
     });
     OpenDeviceNetDebugging = new FlexiableCommand((p) =>
     {
         AtmbContext.Instance.NewExtensionThread("EOpenUsbDeviceNetDebugging")?.Start();
     });
     ConnectedDevicesListener.Instance.DevicesChanged += ConnectedDevicesChanged;
 }
Ejemplo n.º 8
0
 public VMMore()
 {
     OpenExtFloder = new FlexiableCommand(() =>
     {
         Process.Start(Manager.InternalManager.ExtensionPath);
     });
     OpenUrl = new FlexiableCommand((para) =>
     {
         try
         {
             Process.Start(para.ToString());
         }
         catch { }
     });
     ApiVersion = BuildInfo.SDK_VERSION.ToString();
 }
Ejemplo n.º 9
0
        public VMContentChoice(ChoicerContentStartArgs args)
        {
            Model    = args;
            DoChoice = new FlexiableCommand((para) =>
            {
                switch (para)
                {
                case "R":
                    args.DidChoice(ChoicerResult.Right);
                    break;

                case "C":
                    args.DidChoice(ChoicerResult.Center);
                    break;

                default:
                    args.DidChoice(ChoicerResult.Cancel);
                    break;
                }
            });
        }
Ejemplo n.º 10
0
 public VMPOTD()
 {
     Click = new FlexiableCommand(() =>
     {
         try
         {
             Process.Start(url);
         }
         catch (Exception e)
         {
             SLogger.Warn(this, "Click potd is failed", e);
         }
     });
     new PotdGetter().Try((result) =>
     {
         App.Current.Dispatcher.Invoke(() =>
         {
             SettingBy(result);
         });
     });
 }
Ejemplo n.º 11
0
 private void InitCommands()
 {
     _toSystem = new FlexiableCommand(() =>
     {
         var thread = AtmbContext.Instance.NewExtensionThread("ERebooter");
         thread.Data[KEY_REBOOT_OPTION] = SYSTEM;
         thread.Start();
     })
     {
         CanExecuteProp = false
     };
     _toRecovery = new FlexiableCommand(() =>
     {
         var thread = AtmbContext.Instance.NewExtensionThread("ERebooter");
         thread.Data[KEY_REBOOT_OPTION] = RECOVERY;
         thread.Start();
     })
     {
         CanExecuteProp = false
     };;
     _toFastboot = new FlexiableCommand(() =>
     {
         var thread = AtmbContext.Instance.NewExtensionThread("ERebooter");
         thread.Data[KEY_REBOOT_OPTION] = FASTBOOT;
         thread.Start();
     })
     {
         CanExecuteProp = false
     };;
     _to9008 = new FlexiableCommand(() =>
     {
         var thread = AtmbContext.Instance.NewExtensionThread("ERebooter");
         thread.Data[KEY_REBOOT_OPTION] = _9008;
         thread.Start();
     })
     {
         CanExecuteProp = false
     };
 }
Ejemplo n.º 12
0
 public VMDeviceBar()
 {
     ConnectDevice = new FlexiableCommand((p) =>
     {
         ExtensionBridge.Start("ENetDeviceConnecter");
     });
     DisconnectDevice = new FlexiableCommand((p) =>
     {
         ExtensionBridge.Start("ENetDeviceDisconnecter");
     });
     OpenDeviceNetDebugging = new FlexiableCommand((p) =>
     {
         ExtensionBridge.Start("EOpenUsbDeviceNetDebugging");
     });
     ConnectedDevicesListener.Instance.DevicesChanged += (s, e) =>
     {
         Devices = e.Devices;
         if (Devices.Count() >= 1)
         {
             SelectedDevice = Devices.First();
         }
     };
     RefreshCommandState();
 }
Ejemplo n.º 13
0
 public VMTapper()
 {
     Input    = new FlexiableCommand(InputImpl);
     executor = new HestExecutor();
 }
Ejemplo n.º 14
0
 public VMDisconnectDevice()
 {
     Disconnect           = new FlexiableCommand(DisconnectImpl);
     DisconnectAndDisable = new FlexiableCommand(DisconnectAndDisableImpl);
 }
Ejemplo n.º 15
0
 public VMOldExtension()
 {
     Execute = new FlexiableCommand(p => _Execute());
 }
Ejemplo n.º 16
0
 private void InitCommands()
 {
     _toSystem = new FlexiableCommand(() =>
     {
         Task.Run(() => {
             if (running)
             {
                 return;
             }
             running = true;
             DeviceSelectionObserver.Instance.CurrentDevice.Reboot2System();
             running = false;
         });
     })
     {
         CanExecuteProp = false
     };
     _toRecovery = new FlexiableCommand(() =>
     {
         Task.Run(() => {
             if (running)
             {
                 return;
             }
             running = true;
             DeviceSelectionObserver.Instance.CurrentDevice.Reboot2Recovery();
             running = false;
         });
     })
     {
         CanExecuteProp = false
     };;
     _toFastboot = new FlexiableCommand(() =>
     {
         Task.Run(() => {
             if (running)
             {
                 return;
             }
             running = true;
             DeviceSelectionObserver.Instance.CurrentDevice.Reboot2Fastboot();
             running = false;
         });
     })
     {
         CanExecuteProp = false
     };;
     _to9008 = new FlexiableCommand(() =>
     {
         Task.Run(() => {
             if (running)
             {
                 return;
             }
             running = true;
             DeviceSelectionObserver.Instance.CurrentDevice.Reboot29008();
             running = false;
         });
     })
     {
         CanExecuteProp = false
     };
 }