private void OpenExtension_Click(object sender, RoutedEventArgs e) { var service = UIUtilities.GetDataContext <DriveService>(sender); // services are children of the root folder var item = _server?.RootFolder?.ParseItem(service.FileName); if (item == null) { return; } dynamic window = new ShellUtilities.ShellBrowserWindow(); ShellUtilities.CoAllowSetForegroundWindow(window); window.Visible = true; window.Navigate2(item.IdList.Data); }
private void DeleteService_Click(object sender, RoutedEventArgs e) { var service = UIUtilities.GetDataContext <DriveService>(sender); if (this.ShowConfirm("Are you sure you want to remove the '" + service.Name + "' service? Note it can take some time if the number of synchronized files is important.") != MessageBoxResult.Yes) { return; } try { Settings.Current.RemoveDriveService(service); } catch (UnauthorizedAccessException) { this.ShowError("Unauthorized Access. You need to close and restart this program as an administrator to delete this service."); } _driveServices.Remove(service); }
private void OpenPath_Click(object sender, RoutedEventArgs e) => WindowsUtilities.OpenExplorer(UIUtilities.GetDataContext <DriveService>(sender).RootPath);
private void Drives_MouseDoubleClick(object sender, MouseButtonEventArgs e) => EditService(UIUtilities.GetDataContext <DriveService>(e.OriginalSource));
private void Edit_Click(object sender, RoutedEventArgs e) => EditService(UIUtilities.GetDataContext <DriveService>(sender));