简体   繁体   中英

Is there an equivalent to C#'s #region directive in AS3?

Just started coding in AS3 with FlashDevelop and coming from a C# background, I would like to know if there's something equivalent to the #region directive in AS3?

The #region directive in C# essentially allows an IDE eg Visual Studio to collapse or expand a section of code to improve readability. With #region directives, you can split codes in sections eg constructors, properties, public/private methods to aid others perusing your code.

So the C# code below ...

interface IPurchaseOrder
{
    #region Properties

    bool IsProcessed { get; set; }
    bool ISValidOrder { get; set; }

    #endregion Properties

    #region Methods

    bool ProcessOrder();

    #endregion Methods
}

becomes

interface IPurchaseOrder
{
    Properties

    Methods
}

With flashdevelop it works like this:

//{ region region name

  ...your code here

//} endregion 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM