C

C# syntax compiling source code dynamically, 60 Canvas container, dynamic WPF, 158-159 cascading prompts, 115 CDATA section, XAML

wiring events, WPF, 179 CHARINDEX, SQL Server, 122 CheckBox control, WinForms building filter screen, 95, 98 CheckChanged event referencing form controls at runtime, 69

Checked property, RadioButton using HTML tables, 136 CheckedListBox control, WinForms building filter screen, 96, 98 creating report criteria form, 110, 111,

113, 115 extracting user selections, 118 CheckItem method, Items collection, 98 child controls, dynamic WPF

accessing, 171-172 ChildNodes building filter screen, WinForms, 98 Children collection, dynamic WPF

iterating through, 171 classes see also Reflection classes Activator class, 31

Assembly class, 31 building object hierarchy, 42-45 CodeDOM code generation, 13-17 decompiling source code, 52-56 drilling down into assembly objects, 41-51

examining class components, 32-41 retrieving class constructors, 39 retrieving class events, 40 retrieving class fields, 35 retrieving class interfaces, 38 retrieving class methods, 33 retrieving class properties, 37 extracting control definitions, 45-51 generating class wrappers, 10-13 instantiating, 29-31 retrieving class events, 53 Click attribute data-driven menus, WinForms, 106 Click event

Button_Click event, 82, 91 Menu_Click event, 106, 107 code framework, CodeDOM, 13 code generation, 9-28 CodeDOM, 13-28 classes, 13-17 constants, 21 constructors, 27 Enums, 22 fields, 13-17 methods, 24-26 namespaces, 13-17 properties, 23-24 source code, 27-28 support methods, 17-21 custom code generators, 10-13 generating class wrappers, 10-13 language-independent code generator, 13

code graph, CodeDOM, 15 CodeArgumentReferenceExpression object, 26 CodeCompileUnit object, 15, 16 runtime code compilation, 63 CodeConstructor class, 27 CodeCreate class, 14, 16 CodeDOM, 13-28

accessors, 24 AddConstant method, 21 AddConstructor method, 27 AddFields method, 16 AddMethod method, 25 BracingStyle property, 16 classes, 13-17 code framework, 13 code graph, 15

CodeArgumentReferenceExpression object, 26 CodeCompileUnit object, 15, 16, 63 CodeConstructor class, 27 CodeCreate class, 14, 16 CodeDomCompiler class, 17 CodeDomProvider object, 16 CodeFieldReferenceExpression object, 24

CodeMemberField object, 21, 22 CodeMemberMethod object, 26 CodeMemberProperty object, 24 CodeMethodlnvokeExpression object, 26

CodeMethodReturnStatement object, 24

CodeNamespace object, 15, 22 CodeParameterDeclarationExpression object, 26

CodePropertySetValueReferenceExpres sion object, 24 CodeSnippetExpression object, 20, 26 CodeThisReferenceExpression object, 24

CodeTypeDeclaration object, 15, 21, 22 CodeVariableDeclarationStatement object, 26 CodeVariableReferenceExpression object, 26 constants, 21 constructors, 27 Do While loop, 28 Enums, 22 fields, 13-17 fornext loop, 28 GenerateCode method, 16 GenerateCodeFromCompileUnit method, 16

GeneratorSupport enumerator, 19 get accessor, 24

GetAllCompilerInfo method, 18 GetLanguageFromExtension method, 18

GetLanguages method, 18 GetStatements collection, 24 IsClass property, 15 IsDefinedExtension method, 18 IsDefinedLanguage method, 18 methods, 24-26 namespaces, 13-17 properties, 23-24 set accessor, 24 SetStatements collection, 24 source code, 27-28 support methods, 17-21 CodeDom.Compiler namespace, 59-68 CodeDomCompiler class, 17 CodeDomProvider object, 16

CompileAssemblyFromDom method, 63

CompileAssemblyFromFile method, 62 CompileAssemblyFromSource method, 62

IsValidIdentifier method error handling, runtime code compilation, 65 runtime code compilation, 61 Supports property, 19, 20 CodeFieldReferenceExpression object, 24 CodeMemberField object, 21, 22 CodeMemberMethod object, 26 CodeMemberProperty object, 24 CodeMethodInvokeExpression object, 26 CodeMethodReturnStatement object, 24 CodeNamespace object, 15, 22 CodeParameterDeclarationExpression object, 26

CodePropertySetValueReferenceExpressio n object, 24 CodeSmith tool generating class wrappers, 12 CodeSnippetExpression object, 20, 26 CodeThisReferenceExpression object, 24 CodeTypeDeclaration object, 15, 21, 22

CodeVariableDeclarationStatement object, 26

CodeVariableReferenceExpression object, 26

column metadata, Oracle, 5 Column property, Grid, WPF, 161 COLUMNS view,

INFORMATION_SCHEMA, 10 ComboBox control cascading prompts, 116 CompileAssemblyFromDom method, 63 CompileAssemblyFromFile method, 62 CompileAssemblyFromSource method, 62 Compiler namespace, CodeDOM, 59-68 compiling code, 61-63 compiling source code dynamically, 59 error handling, 63-65 executing code, 66-68 CompilerError object, 63 CompilerOptions property, 67 CompilerParameters object, 62, 67 CompilerResults object, 63, 64 compiling Invoice class at runtime, 31 constants

CodeDOM code generation, 21 constraints data migration stored procedure, 6, 8 Oracle metadata, 5 SQL Server metadata, 5 constructors

CodeDOM code generation, 27 examining class components, 39 GetConstructors method, 39 retrieving class constructors, 39 container controls, dynamic WPF accessing child controls, 171-172 Canvas, 158-159 DockPanel, 166-167 Grid, 160-162

iterating through Children collection, 171

nested controls, 172-175 positioning/sizing elements in, 160 StackPanel, 162-164 WrapPanel, 164-166 XAML for nested containers, 172

content page

Page_PreInit event, 128 Content property, Window, WPF accessing child controls, 171 casting to Grid object, 171 referencing Child control collections, 173

runtime instantiation of controls, 169 Control collection, Form object extracting control definitions, 45-51 extracting Controls collection, 50 extracting Form properties, 48 Repeaterltem objects, 145 Control collection, Panel object, 150 control definitions, dynamic WinForms, 83-91

connecting event code, 90-91 loading from tables, 86-90 loading from XML, 84-86 control events, Page life cycle, 129 ControlEvent enumeration, 90 ControlManager class web forms, 148 WinForms, 111 controls criteria screens, WinForms, 110 DrillControls method, 44 dynamic criteria controls web applications, 147-151 WinForms, 110-115 dynamically instantiating controls on form from table, 87 on form from XML, 85 extracting control definitions, 45-51 Infragistics controls, 81 positioning controls on pages, 133 referencing on forms at runtime, 68-69 saving properties for multivalue controls, 96 for single-value controls, 95 suspending execution of layout methods, 82 Controls collection, WinForms building filter screen, 93, 95 hierarchy of controls, 79 instantiating WinForms, 79

loading control definitions from tables, 89

loading control definitions from XML, 86

Controls collection, WPF, 171 controls, dynamic WPF

accessing child controls, 171-172 Canvas, 158-159

casting Content property of Window to

Grid, 171 container controls, 158-167

positioning elements in, 160 determining control type, 171 DockPanel, 166-167 Grid, 160-162

hierarchical relationship between, 177 IsAncestorOf method, 177 IsDescendantOf method, 177 iterating through Children collection, 171

nested controls, 172-175 ownership hierarchy, 172 StackPanel, 162-164 WrapPanel, 164-166 ControlType enumeration, 83 ConvertType method, 230 CreateInstance method, 31 Criteria enumeration creating report criteria form, 112 dynamic criteria controls, 149 criteria screens creating report criteria form, 110 dynamic criteria controls

WinForms, 110-115 extracting user selections web applications, 152 WinForms, 117-122 Crystal Reports, 202-210

dynamic Crystal Reports, 202-210

preset columns, 202-205 embedded vs. nonembedded reports, 202

using Crystal SDK, 205-210 Crystal SDK

Report Application Server (RAS), 202 reporting using, 205-210

CSharpDataType method, 10 custom code generators, 10-13

0 0

Post a comment