コード例 #1
0
        /// <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);
        }
コード例 #2
0
    /// <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);
    }