是否有一个等价于AS3 C#的#地区的指令? [英] Is there an equivalent to C#'s #region directive in AS3?

查看:134
本文介绍了是否有一个等价于AS3 C#的#地区的指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚开始编码的AS3与FlashDevelop中,并从一个C#背景的,我想知道是否有什么东西相当于#地区的指令在AS3?

在C#中的#region指令基本上可以让一个IDE如Visual Studio中折叠或展开的code段,以提高可读性。随着#地区的指令,可以拆分codeS的部分,例如构造,性能,公共/私有方法,以帮助他人细读你的code。

那么下面...

在C#code

 接口IPurchaseOrder
{
    #区域属性

    布尔IsProcessed {获得;组; }
    布尔ISValidOrder {获得;组; }

    #endregion属性

    #地区方法

    布尔ProcessOrder的();

    #endregion方法
}
 

变为

 接口IPurchaseOrder
{
    性能

    方法
}
 

解决方案

使用的FlashDevelop它的工作原理是这样的:

  // {区域名

  ...您的code在这里

//} endregion
 

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 e.g Visual Studio to collapse or expand a section of code to improve readability. With #region directives, you can split codes in sections e.g 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 

这篇关于是否有一个等价于AS3 C#的#地区的指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆