aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsViewVM.cs
blob: a82624c8a3162b7477bd5f2f4e775dd6fff46fb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.MachineStudio.Common.Notifications;

namespace Tango.MachineStudio.DB.ViewModels
{
    public class RmlsViewVM : DbTableViewModel<Rml>
    {
        public RmlsViewVM(INotificationProvider notification) : base(notification)
        {
        }
    }
}
"> Tango.Core.Commands; using Tango.Scripting.IDE.ProjectTypes; using Tango.SharedUI; using Microsoft.WindowsAPICodePack.Dialogs; using Microsoft.Win32; namespace Tango.Scripting.IDE.Dialogs { public class NewProjectViewVM : BaseProjectDialogVM { /// <summary> /// Gets or sets the last solution locations. /// </summary> public ObservableCollection<String> LastSolutionPaths { get; set; } private String _solutionName = "App1"; public String SolutionName { get { return _solutionName; } set { _solutionName = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } } #region Commands public RelayCommand BrowseFileCommand { get; set; } #endregion public NewProjectViewVM(List<IProjectType> projectTypes) : base(projectTypes) { Title = "New Project"; BrowseFileCommand = new RelayCommand(BrowseFile); } public NewProjectViewVM(IEnumerable<String> lastSolutionFolders, List<IProjectType> projectTypes) : this(projectTypes) { LastSolutionPaths = new ObservableCollection<string>(lastSolutionFolders); ProjectLocation = LastSolutionPaths.FirstOrDefault(); } private void BrowseFile() { CommonOpenFileDialog dialog = new CommonOpenFileDialog(); dialog.InitialDirectory = LastSolutionPaths.LastOrDefault<string>(); dialog.IsFolderPicker = true; if (dialog.ShowDialog() == CommonFileDialogResult.Ok) { if (Directory.Exists(dialog.FileName) == true) { if (false == LastSolutionPaths.Contains(dialog.FileName)) { LastSolutionPaths.Add(dialog.FileName); } ProjectLocation = dialog.FileName; } } } protected override bool CanOK() { return base.CanOK() && !String.IsNullOrWhiteSpace(SolutionName); } } }