Exemple #1
0
        void OnSuspendingWorkspace(AbstractWorkspace <StoredSession> workspace)
        {
            // Make sure the workspace is aware about all latest open windows.
            UpdateWindowAssociations();

            bool isSuspended = false;

            AbstractWorkspace <StoredSession> .WorkspaceEventHandler onSuspended = w => isSuspended = true;
            workspace.SuspendedWorkspace += onSuspended;

            // While awaiting full suspension in background, make sure list of remaining open windows is updated.
            var awaitSuspend = new BackgroundWorker();

            awaitSuspend.DoWork += (sender, args) =>
            {
                while (!isSuspended)
                {
                    UpdateWindowAssociations();
                    Thread.Sleep(TimeSpan.FromSeconds(1));
                }
            };
            awaitSuspend.RunWorkerCompleted += (sender, args) =>
            {
                workspace.SuspendedWorkspace -= onSuspended;
            };
            awaitSuspend.RunWorkerAsync();
        }
Exemple #2
0
 /// <summary>
 /// The theme manager constructor
 /// </summary>
 /// <param name="eventAggregator">The injected event aggregator</param>
 /// <param name="logger">The injected logger</param>
 public ThemeManager(AbstractWorkspace workspace, IEventAggregator eventAggregator, ILoggerService logger)
 {
     Themes           = new ObservableCollection <ITheme>();
     _eventAggregator = eventAggregator;
     _logger          = logger;
     m_workspace      = workspace;
 }
        public ProjectToolViewModel(IUnityContainer container, AbstractWorkspace workspace)
        {
            _workspace = workspace;
            _container = container;
            Name       = "Project";
            Title      = "Project";
            ContentId  = "Project";
            _model     = new ProjectToolModel();//.Resolve<ICommandManager>(), container.Resolve<IMenuService>());
            Model      = _model;
            IsVisible  = true;

            _view             = new ProjectToolView();
            _view.DataContext = _model;
            View = _view;

            // _aggregator = _container.Resolve<IEventAggregator>();
            VEFModule.EventAggregator.GetEvent <LogEvent>().Subscribe(AddLog);

            _logger = _container.Resolve(typeof(ILoggerService), "") as ILoggerService;



            //CVMProject p1 = ((CVMProject)Workspace.This.VMTV.List[0]);
            //// CVMCategory cdata = new CVMCategory() { Name = "Data" };
            //// p1.Items.Add(cdata);

            ////------------- Scenes ----------------------
            //CVMCategory cScenes = new CVMCategory() { Name = "Scenes" };

            //p1.Items.Add(cScenes);

            //CVMScene sv = new CVMScene() { Name = "Scene 1" };
            //sv.Items.Add(new CVMCategory() { Name = "Cameras" });
            //sv.Items.Add(new CVMCategory() { Name = "Models" });
            //sv.Items.Add(new CVMCategory() { Name = "Sound" });
            //cScenes.Items.Add(sv);
            //// Workspace.This.VMTV.List.Add(new CVMProject() { Name = "Proj2" });

            ////------------- Models ----------------------
            //CVMCategory cModels = new CVMCategory() { Name = "Models" };
            //CVMCategory cChars = new CVMCategory() { Name = "Characters" };
            //CVMModel cModel = new CVMModel() { Name = "OgreHead", File = "ogrehead.mesh" };
            //CVMModel cModel2 = new CVMModel() { Name = "Human", File = "human.mesh" };

            //cChars.Items.Add(cModel);
            //cChars.Items.Add(cModel2);
            //cModels.Items.Add(cChars);
            //CVMCategory cCreatures = new CVMCategory() { Name = "Creatures" };
            //cModels.Items.Add(cCreatures);
            //p1.Items.Add(cModels);

            ////------------------ Sounds -------------------------
            //CVMCategory cSounds = new CVMCategory() { Name = "Sounds" };
            //p1.Items.Add(cSounds);

            ////------------------ Particles -------------------------
            //CVMCategory cParticles = new CVMCategory() { Name = "Particles" };
            //p1.Items.Add(cParticles);
        }
 /// <summary>
 /// Constructor for Open file service
 /// </summary>
 /// <param name="container">The injected container</param>
 /// <param name="eventAggregator">The injected event aggregator</param>
 /// <param name="logger">The injected logger</param>
 public OpenDocumentService(ILoggerService logger,
                            AbstractWorkspace workspace, IContentHandlerRegistry handler,
                            IRecentViewSettings recentSettings)
 {
     _logger         = logger;
     _dialog         = new OpenFileDialog();
     _workspace      = workspace;
     _handler        = handler as ContentHandlerRegistry;
     _recentSettings = recentSettings as RecentViewSettings;
 }
Exemple #5
0
 public AtlasViewModel(AbstractWorkspace workspace, ICommandManager commandManager, ILoggerService logger,
                       IMenuService menuService)
     : base(workspace, commandManager, menuService)
 {
     // ICommand mOpenCOMCommand;
     //OpenCOMCommand mOpenComCommand;
     // mOpenComCommand = new Commands.OpenCOMCommand();
     // mOpenCOMCommand = new DelegateCommand<OpenCOMCommand>(
     //                           mOpenComCommand.OnSubmit, mOpenComCommand.CanSubmit);
 }
Exemple #6
0
 /// <summary>
 /// Constructor for Open file service
 /// </summary>
 /// <param name="container">The injected container</param>
 /// <param name="eventAggregator">The injected event aggregator</param>
 /// <param name="logger">The injected logger</param>
 public OpenDocumentService(IUnityContainer container, IEventAggregator eventAggregator, ILoggerService logger,
                            AbstractWorkspace workspace, IContentHandlerRegistry handler,
                            IRecentViewSettings recentSettings)
 {
     _container       = container;
     _eventAggregator = eventAggregator;
     _logger          = logger;
     _dialog          = new OpenFileDialog();
     _workspace       = workspace;
     _handler         = handler as ContentHandlerRegistry;
     _recentSettings  = recentSettings as RecentViewSettings;
 }
Exemple #7
0
        public CodeBoxViewModel(IUnityContainer container, AbstractWorkspace workspace)
        {
            _workspace = workspace;
            _container = container;
            Name       = "CodeBox";

            IsVisible = false;

            _model = new CodeBoxModel();

            _view             = new CodeBoxView();
            _view.DataContext = _model;

            _aggregator = _container.Resolve <IEventAggregator>();
        }
Exemple #8
0
        public ConsoleViewModel(IUnityContainer container, AbstractWorkspace workspace)
        {
            _workspace = workspace;
            _container = container;
            Name       = "Console";
            Title      = "Console";
            ContentId  = "Console";

            _view             = new ConsoleView();
            _view.DataContext = _model;
            View = _view;

            //_model = new ConsoleModel();
            //Model = _model;
            IsVisible = false;
        }
Exemple #9
0
        public LoggerToolViewModel(AbstractWorkspace workspace)
        {
            _workspace = workspace;
            Name       = "Logger";
            Title      = "Logger";
            ContentId  = "Logger";
            _model     = new LoggerModel();
            Model      = _model;
            IsVisible  = false;

            _view             = new LoggerToolView();
            _view.DataContext = _model;
            View = _view;

            VEFModule.EventAggregator.GetEvent <LogEvent>().Subscribe(AddLog);
        }
Exemple #10
0
        void OnForceSuspendRequested(AbstractWorkspace <StoredSession> workspace)
        {
            var virtualDesktop = (VirtualDesktop)workspace;

            // TODO: Is there any way to always support this? The internal WindowSnapshot constructor assumes the windows are part of the currently visible desktop.
            if (!virtualDesktop.IsVisible)
            {
                throw new InvalidOperationException("Can only transfer windows when the desktop is currently visible.");
            }

            // Move windows from the forcefully suspended workspace to the startup workspace.
            List <WindowSnapshot> snapshots = virtualDesktop.Windows.Select(w => new WindowSnapshot(virtualDesktop, w.WindowInfo)).ToList();

            virtualDesktop.RemoveWindows(snapshots);
            StartupWorkspace.AddWindows(snapshots);
        }
Exemple #11
0
        public PropertiesToolViewModel(AbstractWorkspace workspace)
        {
            Name      = "Properties";
            Title     = "Eigenschaften";
            ContentId = "Properties";
            _model    = new PropertiesToolModel();//.Resolve<ICommandManager>(), container.Resolve<IMenuService>());
            Model     = _model;
            IsVisible = true;

            _view             = new PropertiesToolView();
            _view.DataContext = _model;
            View = _view;

            //    VEFModule.EventAggregator.GetEvent<LogEvent>().Subscribe(AddLog);

            //     _logger = _container.Resolve<ILoggerService>();
        }
        public LoggerViewModel(IUnityContainer container, AbstractWorkspace workspace)
        {
            _workspace = workspace;
            _container = container;
            Name       = "Logger";
            Title      = "Logger";
            ContentId  = "Logger";
            _model     = new LoggerModel();
            Model      = _model;
            IsVisible  = false;

            _view             = new LoggerView();
            _view.DataContext = _model;
            View = _view;

            _aggregator = _container.Resolve <IEventAggregator>();
            _aggregator.GetEvent <LogEvent>().Subscribe(AddLog);
        }
Exemple #13
0
        public OutputViewModel(AbstractWorkspace workspace)
        {
            Name      = "Output";
            Title     = "Output";
            ContentId = "Output";

            //   var test = container.Resolve<IOutputService>("MOS");
            _model = new OutputModel(VEFModule.UnityContainer.Resolve(typeof(IOutputService), "") as IOutputService);
            // new OutputModel();
            Model     = _model;
            IsVisible = false;

            _view             = new OutputToolView();
            _view.DataContext = _model;
            View = _view;

            VEFModule.EventAggregator.GetEvent <OutputEvent>().Subscribe(AddLog);
        }
Exemple #14
0
        public SceneGraphToolViewModel(AbstractWorkspace workspace)
        {
            _workspace = workspace;
            Name       = "SceneGraph";
            Title      = "SceneGraph";
            ContentId  = "SceneGraph";
            _model     = new SceneGraphToolModel();
            Model      = _model;
            IsVisible  = true;

            _view             = new SceneGraphToolView();
            _view.DataContext = _model;
            View = _view;

            //_aggregator = _container.Resolve<IEventAggregator>();
            //_aggregator.GetEvent<LogEvent>().Subscribe(AddLog);

            //_logger = _container.Resolve<ILoggerService>();
        }
Exemple #15
0
 public ThemeManager(AbstractWorkspace workspace, IEventAggregator eventAggregator, ILoggerService logger)
     : base(workspace, eventAggregator, logger)
 {
 }
Exemple #16
0
 public MDViewModel(AbstractWorkspace workspace, ICommandManager commandManager, ILoggerService logger,
                    IMenuService menuService)
     : base(workspace, commandManager, logger, menuService)
 {
 }
Exemple #17
0
 public ThemeManagerWPF(AbstractWorkspace workspace)
     : base(workspace)
 {
 }
Exemple #18
0
 /// <summary>
 /// The theme manager constructor
 /// </summary>
 /// <param name="eventAggregator">The injected event aggregator</param>
 /// <param name="logger">The injected logger</param>
 public ThemeManager(AbstractWorkspace workspace)
 {
     Themes = new ObservableCollection <ITheme>();
     //     _logger = VEFModule.UnityContainer.Resolve(typeof(ILoggerService), "ILoggerService") as ILoggerService;
     m_workspace = workspace;
 }
Exemple #19
0
 public NonGenericWorkspace(AbstractWorkspace <TSession> workspace)
 {
     Inner = workspace;
 }