浏览代码

code style

/main
xingwei.zhu 6 年前
当前提交
df321a92
共有 3 个文件被更改,包括 15 次插入14 次删除
  1. 20
      Runtime/editor/editor_window.cs
  2. 2
      Runtime/widgets/binding.cs
  3. 7
      Runtime/widgets/framework.cs

20
Runtime/editor/editor_window.cs


}
public void OnDisable() {
_windowAdapters.Remove(this);
this._alive = false;

}
public override IDisposable getScope() {
WindowAdapter oldInstance = (WindowAdapter) Window._instance;
Window._instance = this;
WindowAdapter oldInstance = (WindowAdapter) _instance;
_instance = this;
}
}
return new WindowDisposable(this, oldInstance);
}

}
public void Dispose() {
D.assert(Window._instance == this._window);
Window._instance = this._oldWindow;
D.assert(_instance == this._window);
_instance = this._oldWindow;
D.assert(SchedulerBinding._instance == this._window._binding);
SchedulerBinding._instance = this._oldWindow?._binding;

this._binding.attachRootWidget(root);
}
}
public void attachRootWidget(Func<Widget> root) {
using (this.getScope()) {
this._binding.attachRootWidget(root());

2
Runtime/widgets/binding.cs


element.deactivate();
element.unmount();
}
this._renderViewElement.visitChildren(unMountAll);
this._renderViewElement.deactivate();
this._renderViewElement.unmount();

7
Runtime/widgets/framework.cs


this.componentKey1 = componentKey1;
this.componentKey2 = componentKey2;
}
public bool Equals(CompositeKey other) {
if (ReferenceEquals(null, other)) {
return false;

}
public override int GetHashCode() {
return (this.componentKey1 != null ? this.componentKey1.GetHashCode() : 0) ^
return (this.componentKey1 != null ? this.componentKey1.GetHashCode() : 0) ^
(this.componentKey2 != null ? this.componentKey2.GetHashCode() : 0);
}

D.assert(element.widget.key != null);
GlobalKey key = (GlobalKey) element.widget.key;
CompositeKey compKey = new CompositeKey(Window.instance, key);
D.assert(_registry.ContainsKey(compKey));
duplicates = duplicates ?? new Dictionary<GlobalKey, HashSet<Element>>();
var elements = duplicates.putIfAbsent(key, () => new HashSet<Element>());

if (fn != null) {
fn();
}
this._element.markNeedsBuild();
}

正在加载...
取消
保存