/// <summary> /// Check if it is traversing a constructor. If so, place necessary code after InitializeComponent() call /// </summary> public override void TraverseChildren(IMethodDefinition method) { if (!method.IsConstructor) { return; } PhoneInitializationCodeTraverser codeTraverser = new PhoneInitializationCodeTraverser(host, method); var methodBody = method.Body as SourceMethodBody; if (methodBody == null) { return; } var block = methodBody.Block as BlockStatement; codeTraverser.injectPhoneControlsCode(block); }
/// <summary> /// Check if it is traversing a constructor. If so, place necessary code after InitializeComponent() call /// </summary> public override void TraverseChildren(IMethodDefinition method) { if (!method.IsConstructor) return; PhoneInitializationCodeTraverser codeTraverser = new PhoneInitializationCodeTraverser(host, method); var methodBody = method.Body as SourceMethodBody; if (methodBody == null) return; var block = methodBody.Block as BlockStatement; codeTraverser.injectPhoneControlsCode(block); }