1.元件
控制項(Control) | 前置詞(Prefix) | 例如 | 備註說明 |
Button | btn | btn_save | |
BindingSource | bs | bs_master, bs_detail | 通常和DataGridView的名字需搭配 |
Calender | cal | cal_for_dt | |
Checkbox, whdCheckBox | chk | chk_sd_y, chk_cancel_yn | |
CheckBoxList | cbl | cbl_pitype | |
ComboBox, WhdComboBox | cbo | cbo_comp_nm, cbo_emp_nm | |
DataGridView | dgv | dgv_master, dgv_detail | 通常和BindingSource的名字需搭配 |
DataList | dlst | dlst_address | |
GroupBox | gb | gb_report | |
Hyperlink | lnk | lnk_home_page | |
Image | img | img_logo | |
ImageButton | ibtn | ibtn_save | |
Label | lbl | lbl_comp_id | |
LinkButton | lbtn | lbtn_save | |
ListBox | ltb | ltb_company | |
Panel | pan | pan_section | |
RadioButton | Rdo | rdo_sex | |
RadioButtonList | rbl | rbl_age_group | |
Table | tbl | tbl_master, tbl_detail | |
TabControl | tab | tab_master, tab_detail | |
TabPage | pag | tpg_detail, tpg_detail2 | |
TextBox, WhdTextBox | txt | txt_comp_id | |
2.變數
規範 | 範例 | |
模組專案 | Fu.eNet.大模組名稱 | 例如:MO00_參數設定 |
程式原始檔案 Source File | 待補充 | 名詞(單/複數) 或名詞片語 與class, enum, Delegates名稱一致 例如: 檔案 UserEntity.cs 類別 public class UserEntity |
命名空間 NameSpace | Fu.eNet.大模組代號 | 例如:MO00_參數設定: |
元件 Assembly | 待補充 | |
類別與結構 Class or Struct | 名詞(單/複數) 或名詞片語 儘量不使用縮寫 | 例如:class FileStream |
集合類別 Collection | 名詞(複數) 或名詞片語 | 例如:Sampites, UserList, Users |
例外類別 Exception | 待補充 | Suffix: Exception |
介面 Interface | 以I開頭命名 | 例如:IEntity |
私有變數 Private Field | 以_開頭 | 例如:_CurrentItem, _SelectedItem |
非私有變數 Non Private Field | 建議改以property表示 | 例如: string _CompId; Public string CompId { get{return this._CompId;}; set{this._CompId = value;}; } |
變數宣告 | 1.盡可能明確的指出型態 | string boolean double integer var |
固定值 Constant | 1.全部大寫 | 例如:CONNECTION_STRING |
屬性 Property | 1.若為Public時,則以大寫開頭 | Public範例: (NG)GetXxx, SetXxx的property |
方法傳入參數 Argument | 1.以小寫開頭 |
例如:connStr, isSuccess |
方法內變數 Variable | 1.以t_開頭 | 例如:t_ConnStr ERP欄位:t_CompId, t_DeptNo, t_EmpNo |
方法 Method | 1.動詞或動詞片語 | 例如:GetEmailAddress() |
事件 Event | 1.動詞、動詞片語
| 例如:OnTextChanged() |
例舉值 Enum Value | 儘量不使用縮寫 | 例如:BillType |