Ejemplo n.º 1
0
        public bool EA_OnContextItemDoubleClicked(EAAPI.Repository repository, string guid, EAAPI.ObjectType objectType)
        {
            bool result = false;

            if (objectType == EAAPI.ObjectType.otElement)
            {
                EAAPI.Element element = repository.GetElementByGuid(guid);

                ViewModelBase viewModel = null;

                viewModel = GetEditorViewModel(repository, element);

                if (viewModel != null)
                {
                    FMCElementPropertyWindow newAgentWindow = new FMCElementPropertyWindow();
                    newAgentWindow.DataContext = viewModel;
                    newAgentWindow.ShowDialog();
                    repository.AdviseElementChange(element.ElementID);
                    result = true;
                }
            }
            else if (objectType == EAAPI.ObjectType.otConnector)
            {
                EAAPI.Connector connector = repository.GetConnectorByGuid(guid) as EAAPI.Connector;
                if (connector != null && connector.Stereotype == "access type" && _mainViewModel != null)
                {
                    _mainViewModel.ShowConnectorDirectionDialogCommand.Execute(connector);
                    repository.AdviseConnectorChange(connector.ConnectorID);
                    result = true;
                }
            }
            return(result);
        }