2010-04-11 62 views
5

剛剛開始在AS3中使用FlashDevelop進行編碼並且來自C#背景,我想知道在AS3中是否有與#region指令等價的東西?在AS3中是否有等價於C#的#region指令?

C#中的#region指令本質上允許IDE(例如Visual Studio)摺疊或展開一段代碼以提高可讀性。使用#region指令,您可以在代碼段中分割代碼,例如構造函數,屬性,公共/私有方法,以幫助其他人閱讀代碼。

低於所以C#代碼...

interface IPurchaseOrder 
{ 
    #region Properties 

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

    #endregion Properties 

    #region Methods 

    bool ProcessOrder(); 

    #endregion Methods 
} 

成爲

interface IPurchaseOrder 
{ 
    Properties 

    Methods 
} 
+0

也許你能解釋的了的#region指令非C#人員。 – 2010-04-11 09:22:39

+0

@Michael Aaron Safyan,謝謝你的高層,已經做了相應的編輯。 – anonymous 2010-04-11 09:47:30

+2

這不是C#的指令,它是Visual Studio的特殊標記。對於c#本身它是一個正則的評論 – zerkms 2010-04-11 10:40:01

回答

9

隨着Flashdevelop中它的工作原理是這樣的:

//{ region region name 

    ...your code here 

//} endregion 
+0

我認爲展開/摺疊區域功能是一個FlashDevelop特定功能? – anonymous 2010-04-11 14:24:38

+0

當然可以。代碼隱藏總是IDE/texteditor特定的。 – Smalcat 2010-09-22 13:33:01

相關問題