Exemplo n.º 1
0
        public override Window CreateEditDialog(Window owner, ISemanticNetwork semanticNetwork, ILanguage language)
        {
            var control = new ProcessesStatementControl
            {
                Statement = this,
            };

            control.Initialize(semanticNetwork, language);
            var dialog = new EditDialog
            {
                Owner                 = owner,
                Editor                = control,
                Title                 = language.GetExtension <ILanguageProcessesModule>().Statements.Names.Processes,
                SizeToContent         = SizeToContent.WidthAndHeight,
                MinWidth              = 200,
                MinHeight             = 100,
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
            };

            dialog.Localize(language);
            return(dialog);
        }
Exemplo n.º 2
0
        public Window CreateEditDialog(Window owner, Semantics.ISemanticNetwork semanticNetwork, ILanguage language)
        {
            updateAttributes(Repositories.Attributes, language);
            var control = new ConceptControl
            {
                EditValue = this,
            };

            control.Initialize(semanticNetwork, language);
            var dialog = new EditDialog
            {
                Owner                 = owner,
                Editor                = control,
                Title                 = language.GetExtension <IWpfUiModule>().Misc.Concept,
                SizeToContent         = SizeToContent.WidthAndHeight,
                MinWidth              = 200,
                MinHeight             = 100,
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
            };

            dialog.Localize(language);
            return(dialog);
        }
Exemplo n.º 3
0
        private void renameKnowledgeClick(object sender, RoutedEventArgs e)
        {
            var semanticNetworkNode = SelectedItem as SemanticNetworkNode;

            if (semanticNetworkNode == null)
            {
                return;
            }

            var editingName = semanticNetworkNode.SemanticNetwork.Name;

            var control = new LocalizedStringVariableControl();

            control.Localize(_application.CurrentLanguage);
            control.EditValue = ViewModels.LocalizedString.From(editingName);

            var dialog = new EditDialog
            {
                Owner                 = _owner,
                Editor                = control,
                Title                 = editingName.GetValue(_application.CurrentLanguage),
                SizeToContent         = SizeToContent.WidthAndHeight,
                MinWidth              = 200,
                MinHeight             = 100,
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
            };

            dialog.Localize(_application.CurrentLanguage);

            if (dialog.ShowDialog() == true)
            {
                var command = _commandsFactory.CreateRenameCommand(control.EditValue, _semanticNetworkNode, _application);
                _changeController.Perform(command);
                semanticNetworkNode.RefreshView();
            }
        }