Exemple #1
0
		} // end private void GenerateFields(System.CodeDom.CodeTypeDeclaration typeDeclaration)
		
		/// <summary>
		/// Build the code-behind Page_Load method.
		/// </summary>
		private void BuildPageLoadMethod(System.CodeDom.CodeTypeDeclaration typeDeclaration)
		{
			System.CodeDom.CodeMemberMethod codeMethodPageLoad;
			System.CodeDom.CodeParameterDeclarationExpression codeParameterExpression;
			// Add Page_Load method
			codeMethodPageLoad = new System.CodeDom.CodeMemberMethod();
			codeMethodPageLoad.Name = "Page_Load";
			// Add sender parameter
			codeParameterExpression = new System.CodeDom.CodeParameterDeclarationExpression(typeof(object), "sender");
			codeMethodPageLoad.Parameters.Add(codeParameterExpression);
			// Add eventargs parameter
			codeParameterExpression = new System.CodeDom.CodeParameterDeclarationExpression(typeof(System.EventArgs), "e");
			codeMethodPageLoad.Parameters.Add(codeParameterExpression);
			typeDeclaration.Members.Add(codeMethodPageLoad);
		} // end private void BuildPageLoadMethod(System.CodeDom.CodeTypeDeclaration typeDeclaration)
Exemple #2
0
		} // end private void BuildPageLoadMethod(System.CodeDom.CodeTypeDeclaration typeDeclaration)
		
		/// <summary>
		/// Build the code-behind OnInit method.
		/// </summary>
		/// <param name="typeDeclaration"></param>
		private void BuildOnInitMethod(System.CodeDom.CodeTypeDeclaration typeDeclaration)
		{
			System.CodeDom.CodeMemberMethod codeMethodOnInit;
			System.CodeDom.CodeMethodInvokeExpression codeMethodInvoke;
			System.CodeDom.CodeParameterDeclarationExpression codeParameterExpression;
			codeMethodOnInit = new System.CodeDom.CodeMemberMethod();
			codeMethodOnInit.Name = "OnInit";
			codeMethodOnInit.Attributes = System.CodeDom.MemberAttributes.Family | System.CodeDom.MemberAttributes.Override;
			codeParameterExpression = new System.CodeDom.CodeParameterDeclarationExpression(typeof(System.EventArgs), "e");
			codeMethodOnInit.Parameters.Add(codeParameterExpression);
			codeMethodInvoke = new System.CodeDom.CodeMethodInvokeExpression(new System.CodeDom.CodeThisReferenceExpression(), "InitializeComponent");
			codeMethodOnInit.Statements.Add(codeMethodInvoke);
			codeMethodInvoke = new System.CodeDom.CodeMethodInvokeExpression(new System.CodeDom.CodeBaseReferenceExpression(), "OnInit", new System.CodeDom.CodeExpression[]{new System.CodeDom.CodeFieldReferenceExpression(null, "e")});
			codeMethodOnInit.Statements.Add(codeMethodInvoke);
			typeDeclaration.Members.Add(codeMethodOnInit);
		} // end private void BuildOnInitMethod(System.CodeDom.CodeTypeDeclaration typeDeclaration)
Exemple #3
0
 protected virtual new void GenerateParameterDeclarationExpression(System.CodeDom.CodeParameterDeclarationExpression e)
 {
     Contract.Requires(e != null);
 }