Compare commits
No commits in common. "ec2c0a9969943d29fff0c3881d7ccae2610c9a52" and "7b5b6709bdfda2591593c34d8d15beada268d2b0" have entirely different histories.
ec2c0a9969
...
7b5b6709bd
102
InputDialog.cs
102
InputDialog.cs
|
@ -1,102 +0,0 @@
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace Microsoft.Windows.Controls
|
|
||||||
{
|
|
||||||
public class InputDialogResult
|
|
||||||
{
|
|
||||||
public bool IsOk { get; set; }
|
|
||||||
public string Result { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class InputDialog
|
|
||||||
{
|
|
||||||
public static InputDialogResult Show(string title, string promptText, string defaultValue = "")
|
|
||||||
{
|
|
||||||
var dialog = new Window
|
|
||||||
{
|
|
||||||
Title = title,
|
|
||||||
Width = 400,
|
|
||||||
Height = 200, // Aumentado para dar más espacio
|
|
||||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
|
||||||
Owner = Application.Current.MainWindow,
|
|
||||||
ResizeMode = ResizeMode.NoResize
|
|
||||||
};
|
|
||||||
|
|
||||||
var grid = new Grid { Margin = new Thickness(10) };
|
|
||||||
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // Prompt
|
|
||||||
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(10) }); // Spacing
|
|
||||||
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // TextBox
|
|
||||||
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(20) }); // Spacing
|
|
||||||
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // Buttons
|
|
||||||
|
|
||||||
var promptLabel = new TextBlock
|
|
||||||
{
|
|
||||||
Text = promptText,
|
|
||||||
TextWrapping = TextWrapping.Wrap,
|
|
||||||
Margin = new Thickness(0, 0, 0, 5)
|
|
||||||
};
|
|
||||||
Grid.SetRow(promptLabel, 0);
|
|
||||||
|
|
||||||
var inputBox = new TextBox
|
|
||||||
{
|
|
||||||
Text = defaultValue,
|
|
||||||
Height = 23
|
|
||||||
};
|
|
||||||
Grid.SetRow(inputBox, 2);
|
|
||||||
|
|
||||||
var buttonPanel = new StackPanel
|
|
||||||
{
|
|
||||||
Orientation = Orientation.Horizontal,
|
|
||||||
HorizontalAlignment = HorizontalAlignment.Right
|
|
||||||
};
|
|
||||||
Grid.SetRow(buttonPanel, 4);
|
|
||||||
|
|
||||||
var okButton = new Button
|
|
||||||
{
|
|
||||||
Content = "Aceptar",
|
|
||||||
Width = 75,
|
|
||||||
Height = 23,
|
|
||||||
Margin = new Thickness(0, 0, 10, 0),
|
|
||||||
IsDefault = true
|
|
||||||
};
|
|
||||||
|
|
||||||
var cancelButton = new Button
|
|
||||||
{
|
|
||||||
Content = "Cancelar",
|
|
||||||
Width = 75,
|
|
||||||
Height = 23,
|
|
||||||
IsCancel = true
|
|
||||||
};
|
|
||||||
|
|
||||||
buttonPanel.Children.Add(okButton);
|
|
||||||
buttonPanel.Children.Add(cancelButton);
|
|
||||||
|
|
||||||
grid.Children.Add(promptLabel);
|
|
||||||
grid.Children.Add(inputBox);
|
|
||||||
grid.Children.Add(buttonPanel);
|
|
||||||
|
|
||||||
dialog.Content = grid;
|
|
||||||
|
|
||||||
var result = new InputDialogResult();
|
|
||||||
|
|
||||||
okButton.Click += (s, e) =>
|
|
||||||
{
|
|
||||||
result.Result = inputBox.Text;
|
|
||||||
result.IsOk = true;
|
|
||||||
dialog.Close();
|
|
||||||
};
|
|
||||||
|
|
||||||
cancelButton.Click += (s, e) =>
|
|
||||||
{
|
|
||||||
result.IsOk = false;
|
|
||||||
dialog.Close();
|
|
||||||
};
|
|
||||||
|
|
||||||
inputBox.Focus();
|
|
||||||
dialog.ShowDialog();
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
108
MainWindow.xaml
108
MainWindow.xaml
|
@ -3,89 +3,65 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewmodels="clr-namespace:DirectoryCreator.ViewModels" mc:Ignorable="d" Title="Crear Directorios Base"
|
xmlns:viewmodels="clr-namespace:DirectoryCreator.ViewModels" mc:Ignorable="d" Title="Crear Directorios Base"
|
||||||
Height="550" Width="800" WindowStartupLocation="CenterScreen" MinWidth="600" MinHeight="400">
|
Height="300" Width="500" WindowStartupLocation="CenterScreen">
|
||||||
|
|
||||||
<Window.Icon>
|
<Window.Icon>
|
||||||
<BitmapImage UriSource="/Assets/app.png" />
|
<BitmapImage UriSource="/Assets/app.png" />
|
||||||
</Window.Icon>
|
</Window.Icon>
|
||||||
|
|
||||||
<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="0">
|
<Grid>
|
||||||
<Grid Margin="25">
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- Barra superior con el tema -->
|
||||||
|
<Border Background="{DynamicResource SecondaryBackground}" Padding="5">
|
||||||
|
<DockPanel LastChildFill="True">
|
||||||
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="Tema Oscuro" Margin="0,0,5,0" VerticalAlignment="Center" />
|
||||||
|
<CheckBox IsChecked="{Binding IsDarkTheme}" VerticalAlignment="Center" />
|
||||||
|
</StackPanel>
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- Contenido principal -->
|
||||||
|
<Grid Grid.Row="1" Margin="20">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="20" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="20" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="20" />
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Configuration Section -->
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||||
<Border Grid.Row="0" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<TextBlock Text="Configuración:" VerticalAlignment="Center" />
|
||||||
<DockPanel>
|
<ComboBox Margin="10,0" ItemsSource="{Binding AvailableConfigurations}"
|
||||||
<TextBlock Text="Configuración:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
SelectedItem="{Binding SelectedConfiguration}" DisplayMemberPath="Description" MinWidth="200"
|
||||||
<Button Content="Editar" Command="{Binding EditConfigurationsCommand}" DockPanel.Dock="Right"
|
VerticalContentAlignment="Center" />
|
||||||
Padding="25,8" Margin="15,0,0,0" />
|
<Button Content="Editar Configuraciones" Command="{Binding EditConfigurationsCommand}" />
|
||||||
<ComboBox ItemsSource="{Binding AvailableConfigurations}"
|
</StackPanel>
|
||||||
SelectedItem="{Binding SelectedConfiguration}" DisplayMemberPath="Description" Height="35"
|
|
||||||
Margin="5,0" VerticalContentAlignment="Center" />
|
|
||||||
</DockPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Project Management Section -->
|
<TextBlock Grid.Row="2" Text="Last Project:" />
|
||||||
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<TextBlock Grid.Row="2" Margin="100,0,0,0" Text="{Binding LastProjectNumber}" />
|
||||||
<DockPanel>
|
|
||||||
<TextBlock Text="Proyecto Actual:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
|
||||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="15,0,0,0">
|
|
||||||
<Button Content="Renombrar" Command="{Binding RenameProjectCommand}" Padding="20,8"
|
|
||||||
Margin="0,0,10,0" />
|
|
||||||
<Button Content="Eliminar" Command="{Binding DeleteProjectCommand}" Padding="20,8"
|
|
||||||
Background="LightPink" />
|
|
||||||
</StackPanel>
|
|
||||||
<ComboBox ItemsSource="{Binding ExistingProjects}" SelectedItem="{Binding SelectedProject}"
|
|
||||||
Height="35" Margin="5,0" VerticalContentAlignment="Center" />
|
|
||||||
</DockPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Project Info Section -->
|
<TextBlock Grid.Row="4" Text="Base Path:" />
|
||||||
<Border Grid.Row="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<TextBlock Grid.Row="4" Margin="100,0,0,0" Text="{Binding BasePath}" />
|
||||||
<StackPanel>
|
|
||||||
<DockPanel Margin="0,0,0,15">
|
|
||||||
<TextBlock Text="Último Proyecto:" MinWidth="120" FontWeight="SemiBold" />
|
|
||||||
<TextBlock Text="{Binding LastProjectNumber}" Margin="5,0" />
|
|
||||||
</DockPanel>
|
|
||||||
<DockPanel>
|
|
||||||
<TextBlock Text="Ruta Base:" MinWidth="120" FontWeight="SemiBold" />
|
|
||||||
<Button Content="Abrir" Command="{Binding OpenBaseFolderCommand}" DockPanel.Dock="Right"
|
|
||||||
Padding="20,5" />
|
|
||||||
<TextBlock Text="{Binding BasePath}" Margin="5,0" TextWrapping="Wrap" />
|
|
||||||
</DockPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- New Project Section -->
|
<TextBlock Grid.Row="6" Text="New Project Name:" />
|
||||||
<Border Grid.Row="6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<TextBox Grid.Row="6" Margin="100,0,0,0"
|
||||||
<DockPanel>
|
Text="{Binding NewProjectName, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
<TextBlock Text="Nuevo Proyecto:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
|
||||||
<TextBox Text="{Binding NewProjectName, UpdateSourceTrigger=PropertyChanged}" Height="35"
|
|
||||||
Margin="5,0" VerticalContentAlignment="Center" />
|
|
||||||
</DockPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Actions Section -->
|
<StackPanel Grid.Row="8" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Border Grid.Row="8" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<Button Content="Abrir Carpeta Base" Command="{Binding OpenBaseFolderCommand}" Padding="20,10"
|
||||||
<DockPanel>
|
Margin="0,0,10,0" />
|
||||||
<CheckBox Content="Tema Oscuro" IsChecked="{Binding IsDarkTheme}" VerticalAlignment="Center" />
|
<Button Content="Crear Directorios" Command="{Binding CreateDirectoriesCommand}" Padding="20,10" />
|
||||||
<Button Content="Crear Directorios" Command="{Binding CreateDirectoriesCommand}"
|
</StackPanel>
|
||||||
DockPanel.Dock="Right" Padding="25,10" Background="{DynamicResource ButtonBackground}"
|
|
||||||
FontWeight="SemiBold" />
|
|
||||||
</DockPanel>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
|
@ -111,6 +111,16 @@ namespace DirectoryCreator.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
partial void OnSelectedConfigurationChanged(FolderConfig value)
|
||||||
|
{
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
currentConfig = value;
|
||||||
|
BasePath = value.BasePath;
|
||||||
|
LoadLastProjectNumber();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
private void OpenBaseFolder()
|
private void OpenBaseFolder()
|
||||||
{
|
{
|
||||||
|
@ -231,208 +241,6 @@ namespace DirectoryCreator.ViewModels
|
||||||
Properties.Settings.Default.Save();
|
Properties.Settings.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
private ObservableCollection<string> existingProjects = new();
|
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
private string selectedProject;
|
|
||||||
|
|
||||||
private void LoadExistingProjects()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(BasePath) || !Directory.Exists(BasePath))
|
|
||||||
{
|
|
||||||
ExistingProjects = new ObservableCollection<string>();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var directories = Directory.GetDirectories(BasePath)
|
|
||||||
.Select(d => new DirectoryInfo(d).Name)
|
|
||||||
.OrderByDescending(name => name)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
ExistingProjects = new ObservableCollection<string>(directories);
|
|
||||||
|
|
||||||
// Seleccionar el LastProjectNumber si existe
|
|
||||||
if (ExistingProjects.Count > 0)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(LastProjectNumber) && ExistingProjects.Contains(LastProjectNumber))
|
|
||||||
{
|
|
||||||
SelectedProject = LastProjectNumber;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SelectedProject = ExistingProjects[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show($"Error al cargar proyectos existentes: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
ExistingProjects = new ObservableCollection<string>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
partial void OnSelectedConfigurationChanged(FolderConfig value)
|
|
||||||
{
|
|
||||||
if (value != null)
|
|
||||||
{
|
|
||||||
currentConfig = value;
|
|
||||||
BasePath = value.BasePath;
|
|
||||||
LoadLastProjectNumber();
|
|
||||||
LoadExistingProjects(); // Cargar proyectos existentes cuando cambia la configuración
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[RelayCommand]
|
|
||||||
private async Task RenameProject()
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(SelectedProject))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Por favor seleccione un proyecto para renombrar", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = Microsoft.Windows.Controls.InputDialog.Show(
|
|
||||||
"Renombrar Proyecto",
|
|
||||||
"Ingrese el nuevo nombre del proyecto:",
|
|
||||||
SelectedProject);
|
|
||||||
|
|
||||||
if (result.IsOk)
|
|
||||||
{
|
|
||||||
string newName = result.Result;
|
|
||||||
if (string.IsNullOrWhiteSpace(newName))
|
|
||||||
{
|
|
||||||
MessageBox.Show("El nombre no puede estar vacío", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
foreach (var structure in currentConfig.FolderStructures)
|
|
||||||
{
|
|
||||||
var basePath = structure.BasePath.Replace("{year}", DateTime.Now.Year.ToString());
|
|
||||||
var oldPath = Path.Combine(basePath, SelectedProject);
|
|
||||||
var newPath = Path.Combine(basePath, newName);
|
|
||||||
|
|
||||||
if (Directory.Exists(oldPath))
|
|
||||||
{
|
|
||||||
if (Directory.Exists(newPath))
|
|
||||||
{
|
|
||||||
MessageBox.Show($"Ya existe un directorio con el nombre: {newName}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Directory.Move(oldPath, newPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MessageBox.Show("Proyecto renombrado exitosamente!", "Éxito", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
LoadExistingProjects(); // Recargar la lista de proyectos
|
|
||||||
SelectedProject = newName;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show($"Error al renombrar el proyecto: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Agregar este método en la clase MainWindowViewModel
|
|
||||||
[RelayCommand]
|
|
||||||
private void DeleteProject()
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(SelectedProject))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Por favor seleccione un proyecto para eliminar", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Recopilar todos los directorios a verificar
|
|
||||||
List<string> directoriesToCheck = new List<string>();
|
|
||||||
List<string> nonEmptyDirectories = new List<string>();
|
|
||||||
|
|
||||||
// Primero encontrar todos los directorios del proyecto
|
|
||||||
foreach (var structure in currentConfig.FolderStructures)
|
|
||||||
{
|
|
||||||
var basePath = structure.BasePath.Replace("{year}", DateTime.Now.Year.ToString());
|
|
||||||
var projectPath = Path.Combine(basePath, SelectedProject);
|
|
||||||
|
|
||||||
if (Directory.Exists(projectPath))
|
|
||||||
{
|
|
||||||
directoriesToCheck.Add(projectPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!directoriesToCheck.Any())
|
|
||||||
{
|
|
||||||
MessageBox.Show("No se encontraron directorios para eliminar.", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verificar que todos los directorios estén vacíos
|
|
||||||
foreach (var directory in directoriesToCheck)
|
|
||||||
{
|
|
||||||
if (!IsDirectoryEmpty(directory))
|
|
||||||
{
|
|
||||||
nonEmptyDirectories.Add(directory);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Si hay directorios con contenido, mostrar mensaje y cancelar
|
|
||||||
if (nonEmptyDirectories.Any())
|
|
||||||
{
|
|
||||||
string message = "Los siguientes directorios contienen archivos y no pueden ser eliminados:\n\n";
|
|
||||||
message += string.Join("\n", nonEmptyDirectories);
|
|
||||||
message += "\n\nDebe vaciar estos directorios antes de poder eliminar el proyecto.";
|
|
||||||
MessageBox.Show(message, "Directorios no vacíos", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Si todos están vacíos, pedir confirmación
|
|
||||||
var result = MessageBox.Show(
|
|
||||||
$"Se eliminarán los siguientes directorios:\n\n{string.Join("\n", directoriesToCheck)}\n\n¿Está seguro que desea continuar?",
|
|
||||||
"Confirmar eliminación",
|
|
||||||
MessageBoxButton.YesNo,
|
|
||||||
MessageBoxImage.Warning);
|
|
||||||
|
|
||||||
if (result == MessageBoxResult.Yes)
|
|
||||||
{
|
|
||||||
// Eliminar todos los directorios
|
|
||||||
foreach (var directory in directoriesToCheck)
|
|
||||||
{
|
|
||||||
if (Directory.Exists(directory))
|
|
||||||
{
|
|
||||||
Directory.Delete(directory, false); // false porque ya sabemos que están vacíos
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MessageBox.Show("Proyecto eliminado exitosamente!", "Éxito", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
LoadExistingProjects(); // Recargar la lista de proyectos
|
|
||||||
SelectedProject = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show($"Error al eliminar el proyecto: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool IsDirectoryEmpty(string path)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return !Directory.EnumerateFileSystemEntries(path, "*", SearchOption.AllDirectories).Any();
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
private void CreateDirectories()
|
private void CreateDirectories()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue