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();
                }
            }
        }
 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 componentNameTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (allowUpdater.IsUpdateAllowed)
     {
         if (NameUtils.CheckComponentName(componentNameTextBox.Text))
         {
             component.Name = componentNameTextBox.Text;
             AutosarApplication.GetInstance().UpdateNamesOfConnectionLines();
             treeView.UpdateAutosarTreeView();
         }
     }
 }
 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);
         }
     }
 }
        public void RenameFieldTextEdit(TextBox textbox)
        {
            int index = grid.SelectedIndex;

            if ((index < grid.Items.Count) && (index >= 0))
            {
                if (NameUtils.CheckComponentName(textbox.Text))
                {
                    gridElements[index].Name = textbox.Text;
                    tree.UpdateAutosarTreeView();
                }
            }
        }
Esempio n. 6
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            bool nameChecked = NameUtils.CheckComponentName(portNameTextBox.Text);

            if (nameChecked == false)
            {
                MessageBox.Show("Wrong port name", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
            }
            else
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Esempio n. 7
0
 public void RenamePortTextEdit(string newName)
 {
     if (allowUpdater.IsUpdateAllowed)
     {
         int index = portsGrid.SelectedIndex;
         if ((index < portsGrid.Items.Count) && (index >= 0))
         {
             if (NameUtils.CheckComponentName(newName))
             {
                 _componentDefenition.Ports[index].Name = newName;
                 tree.UpdateAutosarTreeView(tree.SelectedItem);
             }
         }
     }
 }
 public void editName_TextBox_TextChanged(object sender)
 {
     if (allowUpdater.IsUpdateAllowed)
     {
         int index = osTaskGrid.SelectedIndex;
         if ((index < osTaskGrid.Items.Count) && (index >= 0))
         {
             String newName = (sender as TextBox).Text;
             if (NameUtils.CheckComponentName(newName) == true)
             {
                 AutosarApplication.GetInstance().OsTasks[index].Name = newName;
             }
         }
     }
 }
Esempio n. 9
0
 public void RenameRunnable_TextEdit(string newName)
 {
     if (allowUpdater.IsUpdateAllowed)
     {
         int index = runnablesGrid.SelectedIndex;
         if ((index < runnablesGrid.Items.Count) && (index >= 0))
         {
             if (NameUtils.CheckComponentName(newName))
             {
                 _componentDefenition.Runnables[index].Name = newName;
                 AutosarApplication.GetInstance().SyncronizeRunnables(_componentDefenition);
                 tree.UpdateAutosarTreeView(tree.SelectedItem);
             }
         }
     }
 }
Esempio n. 10
0
        void nameTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (allowUpdater.IsUpdateAllowed)
            {
                String newName = (sender as TextBox).Text;
                if (NameUtils.CheckComponentName(newName))
                {
                    datatype.Name = newName;

                    TreeViewItem item = tree.GetItem(datatype);
                    if (item != null)
                    {
                        item.Header = datatype.Name;
                    }
                }
            }
        }
Esempio n. 11
0
        void ComponentDefenitionName_TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (allowUpdater.IsUpdateAllowed)
            {
                String newName = componentDefenitionName_TextBox.Text;
                if (NameUtils.CheckComponentName(newName))
                {
                    _componentDefenition.Name = newName;

                    TreeViewItem item = tree.GetItem(ComponentDefenition);
                    if (item != null)
                    {
                        item.Header = _componentDefenition.Name;
                    }
                }
            }
        }
Esempio n. 12
0
 public void CDataNameTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (allowUpdater.IsUpdateAllowed)
     {
         int index = CDataGrid.SelectedIndex;
         if ((index < CDataGrid.Items.Count) && (index >= 0))
         {
             String newName = (sender as TextBox).Text;
             if (NameUtils.CheckComponentName(newName))
             {
                 _componentDefenition.CDataDefenitions[index].Name = newName;
                 AutosarApplication.GetInstance().SysncronizeCDataNames(_componentDefenition);
                 tree.UpdateAutosarTreeView(tree.SelectedItem);
             }
         }
     }
 }
 public void PortNameTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (allowUpdater.IsUpdateAllowed)
     {
         int index = portsGrid.SelectedIndex;
         if ((index < portsGrid.Items.Count) && (index >= 0))
         {
             String newName = (sender as TextBox).Text;
             if (NameUtils.CheckComponentName(newName))
             {
                 composition.PortsDefenitions[index].Name       = newName;
                 composition.InternalPortsInstances[index].Name = newName;
                 composition.Ports[index].Name = newName;
                 tree.UpdateAutosarTreeView(tree.SelectedItem);
             }
         }
     }
 }