void compositionNameTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (allowUpdater.IsUpdateAllowed)
            {
                /* Do not change the name of main composition! */
                if (composition.Equals(AutosarApplication.GetInstance().Compositions.GetMainComposition()))
                {
                    return;
                }

                String newName = (sender as TextBox).Text;
                if (NameUtils.CheckComponentName(newName))
                {
                    composition.Name = newName;

                    compositionTab.Header = "Composition: " + composition.Name;

                    TreeViewItem item = tree.GetItem(composition);
                    if (item != null)
                    {
                        item.Header = composition.Name;
                    }

                    AutosarApplication.GetInstance().UpdateNamesOfConnectionLines();
                    tree.UpdateAutosarTreeView();
                }
            }
        }
        public void AddField()
        {
            ClientServerOperation currOperation = GetCurrentCsOperation();

            if (currOperation != null)
            {
                currOperation.Fields.Add(new ClientServerOperationField());
                tree.UpdateAutosarTreeView();
                RefreshGridView();
            }
        }
 void nameTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (allowUpdater.IsUpdateAllowed)
     {
         String newName = (sender as TextBox).Text;
         if (NameUtils.CheckComponentName(newName))
         {
             datatype.Name = newName;
             autosarTree.UpdateAutosarTreeView(null);
         }
     }
 }
 void nameTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (allowUpdater.IsUpdateAllowed)
     {
         String newName = (sender as TextBox).Text;
         if (NameUtils.CheckComponentName(newName))
         {
             datatype.Name = newName;
             AutosarApplication.GetInstance().SyncronizePerInstanceMemory(null, true);
             autosarTree.UpdateAutosarTreeView(null);
         }
     }
 }
Esempio n. 5
0
        public void Viewport_MouseLeftButtonUp(Point sceneCoordinates)
        {
            /* Add Connection Line command started */
            if (this.AddConnectionLineActive == true)
            {
                Object newSelectedObject;
                bool   clicked = AutosarApplication.GetInstance().ActiveComposition.GetClickedObject(sceneCoordinates, out newSelectedObject);

                /* if we check in main composition */
                if (!clicked)
                {
                    CompositionInstance mainComposition = AutosarApplication.GetInstance().Compositions.GetMainComposition();
                    foreach (CompositionInstance composition in AutosarApplication.GetInstance().Compositions)
                    {
                        if (!composition.Equals(mainComposition))
                        {
                            clicked = composition.IsClicked(sceneCoordinates, out newSelectedObject);
                            if (clicked)
                            {
                                break;
                            }
                        }
                    }
                }

                if (newSelectedObject is PortPainter)
                {
                    PortPainter startPort = connectionPainter.Port1;
                    PortPainter endPort   = newSelectedObject as PortPainter;

                    /* Check that we can assign another port to this */
                    if (CouldPortsBeAssigned(startPort, endPort))
                    {
                        connectionPainter.Port2 = endPort;
                        connectionPainter.UpdateLines();
                        connectionPainter.UpdateName();
                        CompositionInstance currentComposition = AutosarApplication.GetInstance().ActiveComposition;
                        currentComposition.Connections.AddConnection(connectionPainter);
                        connectionPainter = null;
                        treeView.UpdateAutosarTreeView(null);
                    }
                }
                AddConnectionLineActive = false;
            }
            leftMouseDown = false;
        }
Esempio n. 6
0
 public void AddField()
 {
     datatype.Fields.Add(new EnumField());
     tree.UpdateAutosarTreeView(tree.SelectedItem);
 }
Esempio n. 7
0
        void AddCDataButton_Click(object sender, RoutedEventArgs e)
        {
            if (_componentDefenition != null)
            {
                CDataDefenition cdataDef = new CDataDefenition();
                _componentDefenition.CDataDefenitions.Add(cdataDef);

                tree.UpdateAutosarTreeView(tree.SelectedItem);
                AutosarApplication.GetInstance().SyncronizeCData(_componentDefenition);
                UpdateCDataGrid();
            }
        }