private bool SaveCodeBlock(LanguageElement element) { bool saved = false; CodeGroup group = GetCodeGroup(element); if (group != null) { saved = group.Save(element); } return(saved); }
/// <summary> /// Initializes a new instance of the EditForm class. /// </summary> public EditForm(CodeGroup group) : this() { try { this.group = group; UpdateDataSources(); } catch (Exception ex) { Utilities.HandleException(ex); } }
private void CodeGroupAdded(object sender, CodeGroupTypeEventArgs e) { try { CodeGroup group = (CodeGroup)Activator.CreateInstance(e.CodeGroupType, false); groupBindingSource.Add(group); } catch (Exception ex) { Utilities.HandleException(ex); } }
private void CellClicked(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex >= 0 && codeGroupGrid.Columns[e.ColumnIndex] == editButtonColumn) { CodeGroup group = groupBindingSource.Current as CodeGroup; EditForm form = new EditForm(group); form.ShowInTaskbar = false; form.StartPosition = FormStartPosition.CenterParent; form.ShowDialog(ParentForm); } } catch (Exception ex) { Utilities.HandleException(ex); } }