public void AssertViewModelIsValid()
        {
            var viewModel = new MockViewModel();
            var instance = new ProjectExplorerView(viewModel);

            Assert.AreEqual(viewModel, instance.DataContext);
        }
        public ProjectExplorerViewModel(IProjectExplorerToolboxToolbarService toolbarService,
                                        IEventAggregator eventAggregator)
            : base(toolbarService)
        {
            _eventAggregator = eventAggregator;

            Name      = "Project Explorer";
            Title     = "Project Explorer";
            ContentId = "Project Explorer";//TODO : Move to constants
            IsVisible = false;


            _view = new ProjectExplorerView(this);
            View  = _view;



            Root = new ProjectTreeViewItem(null, false)
            {
                DisplayName = "Project A"
            };

            var pluginsFolder = new FolderTreeViewItem(Root, false)
            {
                DisplayName = "Plugins Folder"
            };
            var pluginCs = new CsCodeTreeViewItem(pluginsFolder, false)
            {
                DisplayName = "Plugin.cs"
            };


            var executionFolder = new FolderTreeViewItem(Root, false)
            {
                DisplayName = "Execution Folder"
            };


            var businessUnits_Execution_Designer = new ExecutionDesignerTreeViewItem(executionFolder, false)
            {
                DisplayName = "BusinessUnits.xml"
            };
            var businessUnits_Execution = new ExecutionTreeViewItem(businessUnits_Execution_Designer, false)
            {
                DisplayName = "Project A Execution 1.cs"
            };


            var tempCs = new CsCodeTreeViewItem(Root, false)
            {
                DisplayName = "Temp.cs"
            };


            OnPropertyChanged(() => Root);
        }
Ejemplo n.º 3
0
        internal void Run()
        {
            _explorer = new ProjectExplorerView(this);
            _workspace = new WorkspaceView("Main", this);
            _explorer.Show();
            _workspace.Show();

            FileName = LastFileNameFileHandle.String;
            if(FileName == null)
                OnOpen();
            if(FileName == null)
                return;

            var t = new System.Timers.Timer(TimeSpan.FromSeconds(2).TotalMilliseconds) {AutoReset = true};
            t.Elapsed += (s, e) => CheckForSave();
            t.Enabled = true;

            EnsureDragDropController();
            Application.Run(this);
        }