Esempio n. 1
0
        private void dataGridViewEnum_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            try
            {

            }
            catch (Exception throwedException)
            {
                FormShowError errorForm = new FormShowError(throwedException);
                errorForm.ShowDialog(this);
            }
        }
Esempio n. 2
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     try
     {
         ShowItem(_enumNode);
     }
     catch (Exception throwedException)
     {
         FormShowError errorForm = new FormShowError(throwedException);
         errorForm.ShowDialog(this);
     }
 }
Esempio n. 3
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     try
     {
         SetupGridColumns();
         ShowItems(_reader);
     }
     catch (Exception throwedException)
     {
         FormShowError errorForm = new FormShowError(throwedException);
         errorForm.ShowDialog(this);
     }
 }
Esempio n. 4
0
 private void buttonApply_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (DataGridViewRow itemRow in dataGridViewComponents.Rows)
         {
             string       key       = ((COMComponent)itemRow.Tag).Key;
             COMComponent component = GetComponentByKey(key);
             component.Description      = (string)itemRow.Cells[1].Value;
             component.VersionAttribute = (string)itemRow.Cells[2].Value;
         }
     }
     catch (Exception throwedException)
     {
         FormShowError errorForm = new FormShowError(throwedException);
         errorForm.ShowDialog(this);
     }
 }
Esempio n. 5
0
        private void textBoxSolutionName_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (true == _initializeFlag)
                {
                    return;
                }

                XmlNode solutionNode = _reader.COMTree.SelectSingleNode(Constants.Solution);
                solutionNode.Attributes["Name"].Value   = textBoxSolutionName.Text.Trim();
                solutionNode.Attributes["Prefix"].Value = textBoxClassPrefix.Text.Trim();
            }
            catch (Exception throwedException)
            {
                FormShowError errorForm = new FormShowError(throwedException);
                errorForm.ShowDialog(this);
            }
        }
Esempio n. 6
0
        private void dataGridViewMethods_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if ((e.RowIndex < 0) || (true == _initializeFlag))
                {
                    return;
                }
                DataGridViewRow selectRow = dataGridViewMethods.Rows[e.RowIndex];
                if (e.ColumnIndex == 3)
                {
                    string       question = string.Format("Delete {0} ?", selectRow.Cells[1].Value);
                    DialogResult dr       = MessageBox.Show(question, "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dr == DialogResult.Yes)
                    {
                        XmlNode methodNode  = (XmlNode)selectRow.Tag;
                        XmlNode methodsNode = methodNode.ParentNode;
                        methodsNode.RemoveChild(methodNode);
                        dataGridViewMethods.Rows.Remove(selectRow);
                    }
                }
                else if (e.ColumnIndex == 4)
                {
                    XmlNode itemNode = (XmlNode)selectRow.Tag;

                    FormEditXmlItem editForm = new FormEditXmlItem(itemNode);
                    DialogResult    dr       = editForm.ShowDialog(this);
                    if (dr == DialogResult.OK)
                    {
                        editForm.ApplyChanges(itemNode);
                        selectRow.Cells[0].Value = itemNode.Attributes["ReturnType"].Value;
                        selectRow.Cells[1].Value = itemNode.Attributes["Name"].Value;
                    }
                }
            }
            catch (Exception throwedException)
            {
                FormShowError errorForm = new FormShowError(throwedException, "Failed to load Project Information.");
                errorForm.ShowDialog(this);
            }
        }
Esempio n. 7
0
        private void dataGridViewComponents_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if ((e.RowIndex < 0) || (true == _initializeFlag))
                {
                    return;
                }

                DataGridViewRow selectRow       = dataGridViewComponents.Rows[e.RowIndex];
                COMComponent    selectComponent = (COMComponent)selectRow.Tag;

                selectComponent.Description      = (string)selectRow.Cells[1].Value;
                selectComponent.VersionAttribute = (string)selectRow.Cells[2].Value;
            }
            catch (Exception throwedException)
            {
                FormShowError errorForm = new FormShowError(throwedException);
                errorForm.ShowDialog(this);
            }
        }
Esempio n. 8
0
        private void buttonApply_Click(object sender, EventArgs e)
        {
            try
            {
                CheckDuplicateNameInEnumGrid();
                CheckIntegerValuesInEnumGrid();

                foreach (DataGridViewRow row in dataGridViewEnum.Rows)
                {
                    string name = (string)row.Cells[0].Value;

                    XmlNode enumMembersNode = GetChildNode(_enumNode,"Members");
                    XmlNode enumMemberNode = GetChildNode(enumMembersNode, name);

                    enumMemberNode.ChildNodes[0].InnerText   = (string)row.Cells[1].Value;
                }

            }
            catch (Exception throwedException)
            {
                FormShowError errorForm = new FormShowError(throwedException);
                errorForm.ShowDialog(this);
            }
        }