the Purpose of parentheses programmer, application features and usage example

Modify the design and the code by mistake

The programmer brackets represent a structure like this

// *** Start programmer edit section *** ({0}) 

// *** End programmer edit section *** ({0}) 

where {0} indicates the position of the brackets in the code.

If the code is added between the brackets of the programmer, it will be saved with regeneration of the application.

The structure of the code relative to the brackets of the programmer as follows:

Генерируемый код
Открывающая скобка программиста
Добавленный в проект код // Not lost during regeneration. 
Закрывающая скобка программиста
Генерируемый код
Добавленный в проект код // !! Lost during regeneration as it is outside the brackets of the programmer. 
Открывающая скобка программиста
Добавленный в проект код // Not lost during regeneration. 
Закрывающая скобка программиста
Генерируемый код
// ... 

Setting parentheses programmer

When generating code add the following brackets to the programmer:

  • The default generated for a particular entity.
  • The preset settings defined on the interface (for example, properties PBCustomAttributes and PBMembers data classes).

Add custom brackets, the programmer is not supported.

Errors

If generation using Flexberry Designer is added to the log information of the following type:

  • Ошибка: Not found the end brackets in the file "D:\Проекты\КредитыTestBuild\Кредиты\Objects\Клиент.cs", it means that somewhere in the file has been deleted or added an extra brace.

  • an exception of type DuplicateBraceFoundedException means that somewhere extra opening bracket.
  • an exception of type NotFoundEndOfBraceException means that somewhere deleted a closing parenthesis.

Example

In the class below, found the brackets 12 of the programmer that allows you to make changes to any part of the code. Each of the brackets has its purpose and its place. For example, brackets

// *** Start programmer edit section *** (Client CustomMembers) 

// *** End programmer edit section *** (Client CustomMembers) 

responsible for adding private class members. For example, if you want to add a method that returns a string of the form “name (Registration)” then add this method must be in parentheses.

For example, that method looks like this:

public string GetFullClientString()
{
    return string.Format("{0} ({1})", ФИО, Прописка);
}

Then, after adding it to the right place class code (excerpt) will look like this:

private string fФИО;

private string fПрописка;

// *** Start programmer edit section *** (Client CustomMembers) 

public string GetFullClientString()
{
    return string.Format("{0} ({1})", ФИО, Прописка);
}

// *** End programmer edit section *** (Client CustomMembers) 

The code of the generated class:

namespace IIS.Product_20008
{
    using System;
    using System.Xml;
    using ICSSoft.STORMNET;

    /// <summary> 
    /// Client 
    /// </summary> 
    // *** Start programmer edit section *** (Client CustomAttributes) 

    // *** End programmer edit section *** (Client CustomAttributes) 
    public class Клиент : ICSSoft.STORMNET.DataObject
    {
        private string fФИО;
        private string fПрописка;

        // *** Start programmer edit section *** (Client CustomMembers) 

        // *** End programmer edit section *** (Client CustomMembers) 

        /// <summary> 
        /// Client 
        /// </summary> 
        // *** Start programmer edit section *** (Client.Name CustomAttributes) 

        // *** End programmer edit section *** (Client.Name CustomAttributes) 
        [StrLen(255))
        public virtual string ФИО
        {
            get
            {
                // *** Start programmer edit section *** (Client.Name Get start) 

                // *** End programmer edit section *** (Client.Name Get start) 
                string result = this.fФИО;
                // *** Start programmer edit section *** (Client.Get name end) 

                // *** End programmer edit section *** (Client.Get name end) 
                return result;
            }
            set
            {
                // *** Start programmer edit section *** (Client.Name Set start) 

                // *** End programmer edit section *** (Client.Name Set start) 
                this.fФИО = value;
                // *** Start programmer edit section *** (Client.Name Set end) 

                // *** End programmer edit section *** (Client.Name Set end) 
            }
        }

        /// <summary> 
        /// Client 
        /// </summary> 
        // *** Start programmer edit section *** (Client.Registration CustomAttributes) 

        // *** End programmer edit section *** (Client.Registration CustomAttributes) 
        [StrLen(255))
        public virtual string Прописка
        {
            get
            {
                // *** Start programmer edit section *** (Client.Registration Get start) 

                // *** End programmer edit section *** (Client.Registration Get start) 
                string result = this.fПрописка;
                // *** Start programmer edit section *** (Client.Registration Get end) 

                // *** End programmer edit section *** (Client.Registration Get end) 
                return result;
            }
            set
            {
                // *** Start programmer edit section *** (Client.Registration Set start) 

                // *** End programmer edit section *** (Client.Registration Set start) 
                this.fПрописка = value;
                // *** Start programmer edit section *** (Client.Registration Set end) 

                // *** End programmer edit section *** (Client.Registration Set end) 
            }
        }
    }
}