Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 private void OpenPath_Click(object sender, RoutedEventArgs e) => WindowsUtilities.OpenExplorer(UIUtilities.GetDataContext <DriveService>(sender).RootPath);
Exemplo n.º 4
0
 private void Drives_MouseDoubleClick(object sender, MouseButtonEventArgs e) => EditService(UIUtilities.GetDataContext <DriveService>(e.OriginalSource));
Exemplo n.º 5
0
 private void Edit_Click(object sender, RoutedEventArgs e) => EditService(UIUtilities.GetDataContext <DriveService>(sender));