mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-27 17:01:41 +01:00
Replace OpenUrlCommand by a RelayCommand.
This commit is contained in:
1 parent
a46a48e1df
commit
c913c601de
8 files changed
+3
-51
No files matched your search
@@ -1,33 +0,0 @@
|
||||
// <copyright file="OpenUrlCommand.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Commands
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Input;
|
||||
|
||||
public class OpenUrlCommand : ICommand
|
||||
{
|
||||
public OpenUrlCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public event EventHandler CanExecuteChanged;
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
string url = parameter as string;
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Process.Start(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,8 @@ namespace FileConverter.ConversionJobs
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FileConverter.Commands;
|
||||
using FileConverter.Diagnostics;
|
||||
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
|
||||
@@ -136,7 +136,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="ApplicationTerminateArgs.cs" />
|
||||
<Compile Include="Commands\OpenUrlCommand.cs" />
|
||||
<Compile Include="Controls\ConversionJobControl.xaml.cs">
|
||||
<DependentUpon>ConversionJobControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -2,13 +2,9 @@
|
||||
|
||||
namespace FileConverter.ViewModels
|
||||
{
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FileConverter.Commands;
|
||||
using FileConverter.ConversionJobs;
|
||||
using FileConverter.Services;
|
||||
|
||||
using GalaSoft.MvvmLight;
|
||||
|
||||
@@ -2,13 +2,9 @@
|
||||
|
||||
namespace FileConverter.ViewModels
|
||||
{
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FileConverter.Commands;
|
||||
using FileConverter.ConversionJobs;
|
||||
using FileConverter.Services;
|
||||
|
||||
using GalaSoft.MvvmLight;
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace FileConverter.ViewModels
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FileConverter.Commands;
|
||||
using FileConverter.ConversionJobs;
|
||||
using FileConverter.Services;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace FileConverter.ViewModels
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
@@ -13,7 +14,6 @@ namespace FileConverter.ViewModels
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FileConverter.Commands;
|
||||
using FileConverter.ConversionJobs;
|
||||
using FileConverter.Services;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace FileConverter.ViewModels
|
||||
private string releaseNoteContent;
|
||||
private bool displaySeeChangeLogLink = true;
|
||||
|
||||
private OpenUrlCommand openUrlCommand;
|
||||
private RelayCommand<string> openUrlCommand;
|
||||
private RelayCommand getChangeLogContentCommand;
|
||||
private RelayCommand movePresetUpCommand;
|
||||
private RelayCommand movePresetDownCommand;
|
||||
@@ -236,7 +236,7 @@ namespace FileConverter.ViewModels
|
||||
{
|
||||
if (this.openUrlCommand == null)
|
||||
{
|
||||
this.openUrlCommand = new OpenUrlCommand();
|
||||
this.openUrlCommand = new RelayCommand<string>((url) => Process.Start(url));
|
||||
}
|
||||
|
||||
return this.openUrlCommand;
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
|
||||
namespace FileConverter.ViewModels
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
using FileConverter.Commands;
|
||||
using FileConverter.ConversionJobs;
|
||||
using FileConverter.Services;
|
||||
|
||||
using GalaSoft.MvvmLight;
|
||||
|
||||
Reference in new issue
Block a user