void ControllerLoop() { if (XBoxIO.FindXBox()) { if (XBoxIO.XBox.Gamepad == null) { MessageBox.Show("Unable To Access Gamepad", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); return; } else { XBoxIO.XBox.Gamepad.InitializeControllerHook(); XBoxIO.XBox.Gamepad.OverrideControllers(true); } } else { Application.Exit(); return; } running = true; while (running) { AcceptKeyboardInput(input, inputState); AcceptMouseInput(input, inputState); } }
void StartStream() { lock (XBoxIO.XBox) { if (XBoxIO.XBox.Connected == false && XBoxIO.FindXBox() == false) { checkLiveStream.Text = "Live Stream (Off)"; return; } if (videoStream != null) { videoStream.End(); } videoStream = new XboxVideoStream(XBoxIO.XBox, (XboxVideoStream.VideoSize)cboStreamSize.SelectedItem, XboxVideoStream.VideoQuality.Regular, (XboxVideoStream.VideoPresentationInterval)cboFrameInterval.SelectedItem); videoStream.Begin(); checkLiveStream.Text = "Live Stream (On)"; } }
private void cmdApply_Click(object sender, EventArgs e) { if (XBoxIO.FindXBox() == false) { return; } XBoxIO.XBox.SetLEDState((LEDState)cboState1.SelectedItem, (LEDState)cboState2.SelectedItem, (LEDState)cboState3.SelectedItem, (LEDState)cboState4.SelectedItem); }
bool FindXbox() { Enabled = false; if (XBoxIO.FindXBox() == false) { Enabled = true; return(false); } return(true); }
public SystemProperties() { InitializeComponent(); if (XBoxIO.FindXBox() == false) { Close(); } xboxProperties.SelectedObject = XBoxIO.XBox; }
void cmdReset_Click(object sender, EventArgs e) { if (FindXbox() == false) { return; } XBoxIO.XBox.Reset(); XBoxIO.FindXBox(); CompletedOperation(); }
static void Main() { Control.CheckForIllegalCrossThreadCalls = false; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); XBoxIO.LoadSettings(); if (XBoxIO.FindXBox()) { ShowController(); } }
private void downloadFileWorker_DoWork(object sender, DoWorkEventArgs e) { FileInformation selectedFile = (FileInformation)((object[])e.Argument)[0]; string filename = (string)((object[])e.Argument)[1]; string workingDir = CurrentDirectory; if (selectedFile.Attributes == FileAttributes.Directory) { XBoxIO.DownloadDirectory(selectedFile, workingDir, StatusChanged); } else { XBoxIO.DownloadFile(selectedFile, workingDir, SFD.FileName, StatusChanged); } }
void ResumeStream() { lock (XBoxIO.XBox) { if (XBoxIO.XBox.Connected == false && XBoxIO.FindXBox() == false) { checkLiveStream.Text = "Live Stream (Off)"; return; } LiveStreamPaused = false; videoStream.Restart(); checkLiveStream.Text = "Live Stream (On)"; } }
void cmdCyclePower_Click(object sender, EventArgs e) { if (FindXbox() == false) { return; } try { XBoxIO.XBox.DmReboot(BootFlag.Cold, null); } catch { } finally { XBoxIO.FindXBox(); } CompletedOperation(); }
static void Main() { Control.CheckForIllegalCrossThreadCalls = false; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); LoadExecutables(); _LEDStateChanger = new LEDStateChanger(); _memoryHacker = new MemoryHacker(); XBoxIO.LoadSettings(); if (XBoxIO.FindXBox()) { ShowXBoxExplorer(); } }
void sendFileWorker_DoWork(object sender, DoWorkEventArgs e) { string workingDir = CurrentDirectory; List <FileInformation> files = (List <FileInformation>)e.Argument; foreach (FileInformation fi in files) { if (fi.Attributes == FileAttributes.Directory) { XBoxIO.SendDirectory(fi, workingDir, StatusChanged); } else { XBoxIO.SendFile(fi, workingDir, StatusChanged); } } }
void deleteFileWorker_DoWork(object sender, DoWorkEventArgs e) { string workingDir = CurrentDirectory; List <FileInformation> files = (List <FileInformation>)e.Argument; foreach (FileInformation fi in files) { lblStatus.Text = "Deleting: " + fi.Name; if (fi.Attributes == FileAttributes.Directory) { XBoxIO.DeleteDirectory(fi, workingDir, StatusChanged); } else { XBoxIO.XBox.DeleteFile(Path.Combine(workingDir, fi.Name)); } } }