diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-03 16:36:54 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-03 16:36:54 +0300 |
| commit | 856773f7eafb9d04500ede0cfae9c0e75231418b (patch) | |
| tree | d1b4f9577b5a47dd10fa7243823fd1016de1418e /Software/Visual_Studio/Utilities/Tango.MachineEM.UI | |
| parent | 94e4072838c235be4d48a4635e47204a39cdd78b (diff) | |
| download | Tango-856773f7eafb9d04500ede0cfae9c0e75231418b.tar.gz Tango-856773f7eafb9d04500ede0cfae9c0e75231418b.zip | |
Implemented StubsView & VM !!!
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.MachineEM.UI')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs index 3e2dde7c6..942908f2d 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs @@ -7,7 +7,6 @@ using Tango.Emulations.Emulators; using Tango.Logging; using Tango.SharedUI; using Tango.Core.Commands; -using Tango.Stubs; using Tango.Transport.Adapters; using Tango.Transport.Servers; using Tango.Transport.Transporters; @@ -43,35 +42,6 @@ namespace Tango.MachineEM.UI.ViewModels set { _log = value; RaisePropertyChanged(nameof(Log)); } } - /// <summary> - /// Gets or sets the available stubs. - /// </summary> - public List<AvailableStub> AvailableStubs { get; set; } - - private AvailableStub _selectedAvailableStub; - /// <summary> - /// Gets or sets the selected available stub. - /// </summary> - public AvailableStub SelectedAvailableStub - { - get { return _selectedAvailableStub; } - set - { - _selectedAvailableStub = value; RaisePropertyChanged(nameof(SelectedAvailableStub)); - OnStubSelected(value); - } - } - - private StubBase _selectedStub; - /// <summary> - /// Gets or sets the selected stub. - /// </summary> - public StubBase SelectedStub - { - get { return _selectedStub; } - set { _selectedStub = value; RaisePropertyChanged(nameof(SelectedStub)); } - } - private List<String> _ports; /// <summary> /// Gets or sets the ports. @@ -96,18 +66,6 @@ namespace Tango.MachineEM.UI.ViewModels #region Private Methods - /// <summary> - /// Called when available stub is selected. - /// </summary> - /// <param name="availableStub">The available stub.</param> - private void OnStubSelected(AvailableStub availableStub) - { - if (availableStub != null) - { - SelectedStub = availableStub.CreateInstance(Emulator.Transporter); - } - } - #endregion #region Commands @@ -161,12 +119,9 @@ namespace Tango.MachineEM.UI.ViewModels StartCommand = new RelayCommand(Start, (x) => !Emulator.IsStarted); StopCommand = new RelayCommand(Stop, (x) => Emulator.IsStarted); - RunCommand = new RelayCommand(RunSelectedStub, (x) => !_running); CancelCommand = new RelayCommand(Cancel, (x) => _running); ClearCommand = new RelayCommand(() => Log = String.Empty); - AvailableStubs = StubBase.GetAvailableStubs(StubDirection.ToMobile); - Ports = new List<string>() { "TCP", @@ -234,27 +189,6 @@ namespace Tango.MachineEM.UI.ViewModels InvalidateRelayCommands(); } - /// <summary> - /// Runs the selected stub. - /// </summary> - private async void RunSelectedStub() - { - _running = true; - InvalidateRelayCommands(); - var result = await SelectedStub.Run((response) => - { - _running = false; - Log += response + Environment.NewLine; - InvalidateRelayCommands(); - - }); - - Log += result + Environment.NewLine; - - _running = false; - InvalidateRelayCommands(); - } - private void Cancel() { |
