예제 #1
0
        private void cboAccess_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (diagram.SelectedItemCount == 1 && diagram.FirstSelectedItem is TypeShape)
            {
                TypeShape shape = (TypeShape)diagram.FirstSelectedItem;
                TypeBase  type  = (TypeBase)shape.Entity;

                int index = cboAccess.SelectedIndex;
                if (type.Language == Language.CSharp)
                {
                    type.AccessModifier = csharpAccessOrder[index];
                }
                else
                {
                    type.AccessModifier = javaAccessOrder[index];
                }

                shape.Refresh();
            }
        }
예제 #2
0
        private void txtName_TextChanged(object sender, EventArgs e)
        {
            if (diagram.SelectedItemCount == 1 && diagram.FirstSelectedItem is TypeShape)
            {
                TypeShape shape = (TypeShape)diagram.FirstSelectedItem;
                TypeBase  type  = (TypeBase)shape.Entity;

                if (type.Name != txtName.Text)
                {
                    try
                    {
                        type.Name       = txtName.Text;
                        project.IsDirty = true;
                        UpdateStatusBar();
                        shape.Refresh();
                    }
                    catch (BadSyntaxException)
                    {
                        // Ignores the incorrect name
                    }
                }
            }
        }