<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      ASP.NET AJAX Futures January CTP中的一個Bug

      還是比較喜歡ASP.NET AJAX早期版本中出現的xml綁定技術,這部分功能在正式版中雖然被移除了,但是在微軟放出的CTP版本中依然存在,而且內部結構發生了很大的變化,唯一慶幸的是xml綁定的語法基本上沒有變化,所以一直在研究這個版本。

      首先說一下這個版本的優點,給我感覺最好的就是兼容主流瀏覽器,我用IE7、FireFox1.5.10和Opera9.10測試過,xml綁定都能夠正常工作,看來微軟還是下了一番功夫的。

      但是,在這個版本中,實現xml綁定的核心Sys.Preview.Binding類中有個致命的Bug,會導致在某些情況下綁定出錯。先看一下Sys.Preview.Binding.initialize的源代碼:

      function Sys$Preview$Binding$initialize() {
         Sys.Preview.Binding.callBaseMethod(this, 'initialize');
      
         if (this.get_automatic()) {
            if (this._direction !== Sys.Preview.BindingDirection.In) {
               var target = this.get_target();
               if (Sys.INotifyPropertyChange.isImplementedBy(target)) {
                  this._targetNotificationHandler = Function.createDelegate(this, this._onTargetPropertyChanged);
                  target.add_propertyChanged(this._targetNotificationHandler);
               }
               // 問題出現在這里,當direction不等于In,也就是Out或者InOut時,
               // 當target死掉時通知綁定target已經死掉,
               // 但是,如果Source死掉呢?怎么辦?不知道。
               if (Sys.INotifyDisposing.isImplementedBy(target)) {
                  this._targetDisposingHandler = Function.createDelegate(this, this._onDisposing);
                  target.add_disposing(this._targetDisposingHandler);
               }
            }
      
            if (this._direction !== Sys.Preview.BindingDirection.Out) {
               var source = this._getSource();
               if (Sys.INotifyPropertyChange.isImplementedBy(source)) {
                  this._sourceNotificationHandler = Function.createDelegate(this, this._onSourcePropertyChanged);
                  source.add_propertyChanged(this._sourceNotificationHandler);
               }
               // 這里犯有同樣的錯誤,當direction不等于Out,也就是In或者InOut時,
               // source死掉時會通知綁定source已死,
               // 但是卻沒有考慮讓target死掉時也通知binding
               if (Sys.INotifyDisposing.isImplementedBy(source)) {
                  this._sourceDisposingHandler = Function.createDelegate(this, this._onDisposing);
                  source.add_disposing(this._sourceDisposingHandler);
               }
      
               this.evaluate(Sys.Preview.BindingDirection.In);
            }
         }
      }

      既然是綁定,那個就應該不管是source還是target任意一方死掉時,都應該通知綁定,自己將死,讓綁定做好善后工作,以上代碼只要稍微修改一下,就可以正常工作了。

      要改寫這個方法,我們需要重寫這個方法,修改好的代碼如下:

      Sys.Preview.Binding.prototype.initialize = function() {
         Sys.Preview.Binding.callBaseMethod(this, 'initialize');
         if (this.get_automatic()) {
            var target = this.get_target();
            var source = this._getSource();
            if (this._direction !== Sys.Preview.BindingDirection.In) {
               if (Sys.INotifyPropertyChange.isImplementedBy(target)) {
                  this._targetNotificationHandler = Function.createDelegate(this, this._onTargetPropertyChanged);
                  target.add_propertyChanged(this._targetNotificationHandler);
               }
            }
      
            if (this._direction !== Sys.Preview.BindingDirection.Out) {
               if (Sys.INotifyPropertyChange.isImplementedBy(source)) {
                  this._sourceNotificationHandler = Function.createDelegate(this, this._onSourcePropertyChanged);
                  source.add_propertyChanged(this._sourceNotificationHandler);
               }
      
               this.evaluate(Sys.Preview.BindingDirection.In);
            }
            // 不管綁定的方向,不管target和source那個死掉,都要通知綁定,做好善后工作。
            if (Sys.INotifyDisposing.isImplementedBy(target)) {
               this._targetDisposingHandler = Function.createDelegate(this, this._onDisposing);
               target.add_disposing(this._targetDisposingHandler);
            }
            if (Sys.INotifyDisposing.isImplementedBy(source)) {
               this._sourceDisposingHandler = Function.createDelegate(this, this._onDisposing);
               source.add_disposing(this._sourceDisposingHandler);
            }
         }
      }
      不知道我的理解是否正確,隨后,我會附上一個Demo的項目,來演示這個Bug。
      posted @ 2007-03-17 15:55  張志敏  閱讀(3513)  評論(4)    收藏  舉報
      主站蜘蛛池模板: 高清在线一区二区三区视频| 国产成人亚洲日韩欧美| 人妻中文字幕不卡精品| 久久婷婷五月综合色国产免费观看| 久久久久久性高| 会理县| 亚洲成人午夜排名成人午夜| 美乳丰满人妻无码视频| 盐边县| 成人午夜在线观看日韩| 国产一区二区三区黄网| 成人午夜福利精品一区二区| 一二三四中文字幕日韩乱码| 最新的国产成人精品2022| 国产高清在线a视频大全| 久久99国产一区二区三区| 亚洲成人高清av在线| 亚洲天堂成人一区二区三区| 国精偷拍一区二区三区| 亚洲国产精品成人无码区| 在线观看无码av五月花| 四虎国产精品永久免费网址| 日韩熟女熟妇久久精品综合| 亚洲青青草视频在线播放| 亚洲aⅴ无码专区在线观看q| 白嫩少妇激情无码| 亚洲精品视频一二三四区| 精品日韩人妻中文字幕| 久久亚洲精品中文字幕馆| 亚洲精品久久久久久无码色欲四季| 无码av免费毛片一区二区| 四虎在线中文字幕一区| 亚洲高清免费在线观看| 欧美嫩交一区二区三区 | 伊在人间香蕉最新视频| 玩两个丰满老熟女久久网| 欧美级特黄aaaaaa片| 18禁亚洲一区二区三区| 国产xxxx做受视频| 国内少妇偷人精品免费| 人人爽人人爽人人片a免费|