private bool SaveCodeBlock(LanguageElement element)
        {
            bool saved = false;

            CodeGroup group = GetCodeGroup(element);

            if (group != null)
            {
                saved = group.Save(element);
            }

            return(saved);
        }
Ejemplo n.º 2
0
        /// <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);
            }
        }
Ejemplo n.º 3
0
        /// <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);
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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);
            }
        }