aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-05-20 14:21:01 +0300
committerAvi Levkovich <avi@twine-s.com>2020-05-20 14:21:01 +0300
commitbe4ac49d0ebea7e988189f44452f8d2311934f78 (patch)
treead20d3f85d61d9a4ea60f29aa71a7b451700a80c /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchro
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Commands;
using Tango.MachineStudio.Common.Notifications;
using Tango.PMR.Integration;
using Tango.SharedUI;

namespace Tango.MachineStudio.UI.ViewModels
{
    /// <summary>
    /// Represents the machine login dialog, view model.
    /// </summary>
    /// <seealso cref="Tango.MachineStudio.Common.Notifications.DialogViewVM" />
    public class MachineLoginViewVM : DialogViewVM
    {
        /// <summary>
        /// Gets or sets the machine password.
        /// </summary>
        public String Password { get; set; }

        /// <summary>
        /// Gets or sets the intent.
        /// </summary>
        public ExternalBridgeLoginIntent Intent { get; set; }

        /// <summary>
        /// Gets or sets the login command.
        /// </summary>
        public RelayCommand<String> LoginCommand { get; set; }

        /// <summary>
        /// Gets or sets the cancel command.
        /// </summary>
        public RelayCommand CancelCommand { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="MachineLoginViewVM"/> class.
        /// </summary>
        public MachineLoginViewVM()
        {
            Intent = ExternalBridgeLoginIntent.FullControl;
            LoginCommand = new RelayCommand<string>(Login);
            CancelCommand = new RelayCommand(Cancel);
        }

        /// <summary>
        /// Invoked when user presses the login button.
        /// </summary>
        /// <param name="password">The password.</param>
        private void Login(string password)
        {
            Password = password;
            Accept();
        }
    }
}