75 lines
1.6 KiB
C#
75 lines
1.6 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.IO;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Windows.Input;
|
|||
|
|
|||
|
namespace sikFtpClient.ViewModel
|
|||
|
{
|
|||
|
public class LocalDiscElementViewModel : BaseViewModel
|
|||
|
{
|
|||
|
private string path;
|
|||
|
private string name;
|
|||
|
private bool isSent;
|
|||
|
|
|||
|
public string Name
|
|||
|
{
|
|||
|
get { return name; }
|
|||
|
set
|
|||
|
{
|
|||
|
name = value;
|
|||
|
OnPropertyChanged();
|
|||
|
}
|
|||
|
}
|
|||
|
public string Path
|
|||
|
{
|
|||
|
get { return path; }
|
|||
|
set
|
|||
|
{
|
|||
|
path = value;
|
|||
|
OnPropertyChanged();
|
|||
|
}
|
|||
|
}
|
|||
|
public bool IsSent
|
|||
|
{
|
|||
|
get { return true; }
|
|||
|
set
|
|||
|
{
|
|||
|
this.isSent = value;
|
|||
|
OnPropertyChanged();
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
public bool CanUpload()
|
|||
|
{
|
|||
|
if (File.Exists(path))
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
public void Upload()
|
|||
|
{
|
|||
|
//connection send
|
|||
|
IsSent = true;
|
|||
|
}
|
|||
|
RelayCommand uploadCommand;
|
|||
|
public ICommand SaveCommand
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (uploadCommand == null)
|
|||
|
{
|
|||
|
uploadCommand = new RelayCommand(param => this.Upload(),
|
|||
|
param => this.CanUpload());
|
|||
|
}
|
|||
|
return uploadCommand;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|