Exemplo n.º 1
0
        public void Reload()
        {
            Items.Clear();

            Resources["language"] = _application.CurrentLanguage;

            Items.Add(_semanticNetworkNode  = new SemanticNetworkNode(_application));
            _semanticNetworkNode.IsExpanded = true;
        }
Exemplo n.º 2
0
        public virtual IEditCommand CreateDeleteCommand(ExtendedTreeNode node, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
        {
            var conceptNode = node as ConceptNode;

            if (conceptNode != null)
            {
                return(new DeleteConceptCommand(conceptNode.Concept, semanticNetworkNode, application));
            }

            var statementNode = node as StatementNode;

            if (statementNode != null)
            {
                return(new DeleteStatementCommand(statementNode.Statement, semanticNetworkNode, application));
            }

            return(null);
        }
Exemplo n.º 3
0
        public virtual IEditCommand CreateAddCommand(IKnowledgeViewModel viewModel, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
        {
            var conceptViewModel = viewModel as Concept;

            if (conceptViewModel != null)
            {
                return(new AddConceptCommand(conceptViewModel, semanticNetworkNode, application));
            }

            var statementViewModel = viewModel as StatementViewModel;

            if (statementViewModel != null)
            {
                return(new AddStatementCommand(statementViewModel, semanticNetworkNode, application));
            }

            return(null);
        }
Exemplo n.º 4
0
        public virtual IEditCommand CreateEditCommand(IKnowledgeViewModel viewModel, SemanticNetworkNode semanticNetworkNode, IInventorApplication application, IViewModelFactory viewModelFactory)
        {
            var conceptViewModel = viewModel as Concept;

            if (conceptViewModel != null)
            {
                var previousVersion = new Concept(conceptViewModel.BoundObject);
                return(new EditConceptCommand(conceptViewModel, previousVersion, semanticNetworkNode, application));
            }

            var statementViewModel = viewModel as StatementViewModel;

            if (statementViewModel != null)
            {
                var previousVersion = viewModelFactory.CreateStatementByInstance(statementViewModel.BoundStatement, application.CurrentLanguage);
                return(new EditStatementCommand(statementViewModel, previousVersion, semanticNetworkNode, application));
            }

            return(null);
        }
Exemplo n.º 5
0
 public EditConceptCommand(ViewModels.Concept viewModel, ViewModels.Concept previousVersion, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
     : base(semanticNetworkNode, application)
 {
     ViewModel       = viewModel;
     PreviousVersion = previousVersion;
 }
Exemplo n.º 6
0
 public AddStatementCommand(StatementViewModel viewModel, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
     : base(semanticNetworkNode, application)
 {
     ViewModel = viewModel;
 }
Exemplo n.º 7
0
 public EditStatementCommand(StatementViewModel viewModel, StatementViewModel previousVersion, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
     : base(semanticNetworkNode, application)
 {
     ViewModel       = viewModel;
     PreviousVersion = previousVersion;
 }
Exemplo n.º 8
0
 public DeleteConceptCommand(IConcept concept, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
     : base(semanticNetworkNode, application)
 {
     Concept = concept;
 }
Exemplo n.º 9
0
 public virtual IEditCommand CreateRenameCommand(LocalizedString name, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
 {
     return(new RenameSemanticNetworkCommand(semanticNetworkNode, name, application));
 }
Exemplo n.º 10
0
 public AddConceptCommand(ViewModels.Concept viewModel, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
     : base(semanticNetworkNode, application)
 {
     ViewModel = viewModel;
 }
Exemplo n.º 11
0
 protected BaseEditCommand(SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
 {
     SemanticNetworkNode = semanticNetworkNode;
     Application         = application;
 }
Exemplo n.º 12
0
 public DeleteStatementCommand(IStatement statement, SemanticNetworkNode semanticNetworkNode, IInventorApplication application)
     : base(semanticNetworkNode, application)
 {
     Statement = statement;
 }
Exemplo n.º 13
0
 public RenameSemanticNetworkCommand(SemanticNetworkNode semanticNetworkNode, LocalizedString newName, IInventorApplication application)
     : base(semanticNetworkNode, application)
 {
     PreviousName = LocalizedString.From(SemanticNetwork.Name);
     NewName      = newName;
 }