예제 #1
0
        private void DataClientOnCurrentProjectChangeEventHandler(Project newCurrentProject)
        {
            _aPlayAwareShell = (IAPlayAwareShell)Shell;

            Title = "APlayTest [" + newCurrentProject.ProjectDetail.Name + "]";
            _aPlayAwareShell.Project = newCurrentProject;
        }
예제 #2
0
        public SheetDocumentViewModel(Sheet sheet,
                                      IInspectorTool inspectorTool,
                                      IAPlayAwareShell shell,
                                      Action <SheetDocumentViewModel> onOpenedChanged,
                                      Client client)
        {
            _sheet         = sheet;
            _inspectorTool = inspectorTool;
            _shell         = shell;

            _onOpenedChanged = onOpenedChanged;
            _client          = client;

            _name = _sheet.Name;


            SheetId     = _sheet.Id;
            DisplayName = _name;

            _symbolVms   = new BindableCollection <SymbolBaseViewModel>();
            _connections = new BindableCollection <ConnectionViewModel>();

            foreach (var blockSymbol in _sheet.BlockSymbols)
            {
                _symbolVms.Add(new BlockViewModel(blockSymbol, _client, _inspectorTool));
            }

            foreach (var connector in _sheet.Connectors)
            {
                _symbolVms.Add(new ConnectorViewModel(connector, client, _inspectorTool));
            }

            foreach (var connection in _sheet.Connections)
            {
                _connections.Add(new ConnectionViewModel(connection, _client, _inspectorTool));
            }


            _sheet.NameChangeEventHandler += _sheet_NameChangeEventHandler;

            _sheet.BlockSymbolsAddEventHandler      += OnBlockSymbolsAddEventHandler;
            _sheet.BlockSymbolsInsertAtEventHandler += OnBlockSymbolsInsertAtEventHandler;
            _sheet.BlockSymbolsRemoveAtEventHandler += OnBlockSymbolsRemoveAtEventHandler;

            _sheet.ConnectorsAddEventHandler      += OnConnectorAddEventHandler;
            _sheet.ConnectorsInsertAtEventHandler += OnConnectorInsertAtEventHandler;
            _sheet.ConnectorsRemoveAtEventHandler += OnConnectorRemoveAtEventHandler;

            _sheet.ConnectionsAddEventHandler      += OnConnectionsAddEventHandler;
            _sheet.ConnectionsRemoveEventHandler   += OnConnectionsRemoveEventHandler;
            _sheet.ConnectionsRemoveAtEventHandler += OnConnectionsRemoveAtEventHandler;
            _sheet.ConnectionsInsertAtEventHandler += OnConnectionsInsertAtEventHandler;
        }
예제 #3
0
        public UndoHistoryViewModel(IAPlayAwareShell shell)
        {
            _shell = shell;
            _shell.UndoManagerChanged += ShellOnUndoManagerChanged;

            DisplayName = "History";

            History = new ObservableCollection <HistoryEntry>();

            if (_shell.UndoManager != null)
            {
                SetUndoHistory(_shell.UndoManager);
            }
        }
예제 #4
0
        public SheetTreeViewModel(IAPlayAwareShell shell, IInspectorTool inspectorTool)
        {
            _shell         = shell;
            _inspectorTool = inspectorTool;

            DisplayName = "Sheet Tree";
            Sheets      = new BindableCollection <SheetDocumentViewModel>();

            _shell.ProjectChanged += OnProjectChanged;

            if (shell.Project != null)
            {
                if (shell.Project.SheetManager.Sheets != null)
                {
                    Sheets.AddRange(shell.Project.SheetManager.Sheets.Select(sheet => new SheetDocumentViewModel(sheet,
                                                                                                                 inspectorTool, shell, OnOpenedChanged, _shell.Client)));
                }
            }
        }
 public ViewSheetTreeCommandHandler(IAPlayAwareShell shell)
 {
     _shell = shell;
 }