using System ;
using Unity.UIWidgets.editor ;
//using Unity.UIWidgets.editor;
using Unity.UIWidgets.foundation ;
using Unity.UIWidgets.ui ;
using Unity.UIWidgets.widgets ;
public readonly bool pure ;
public readonly UIWidgetsEditorWindow host ;
//TODO (zxw): we should find out a better solution to support both EditorWindow and GameObject host here
//public readonly UIWidgetsEditorWindow host;
UIWidgetsEditorWindow host = null ,
//UIWidgetsEditorWindow host = null,
ViewModelBuilder < ViewModel > builder = null ,
StoreConverter < State , ViewModel > converter = null ,
bool pure = false ,
D . assert ( converter ! = null ) ;
this . host = host ;
//this.host = host;
this . pure = pure ;
this . builder = builder ;
this . converter = converter ;
builder : this . builder ,
converter : this . converter ,
pure : this . pure ,
shouldRebuild : this . shouldRebuild ,
host : this . host
shouldRebuild : this . shouldRebuild
//host : this.host
) ;
}
}
public readonly bool pure ;
public readonly UIWidgetsEditorWindow host ;
//public readonly UIWidgetsEditorWindow host;
public _StoreListener (
ViewModelBuilder < ViewModel > builder = null ,
ShouldRebuildCallback < ViewModel > shouldRebuild = null ,
UIWidgetsEditorWindow host = null ,
//UIWidgetsEditorWindow host = null,
Key key = null ) : base ( key ) {
D . assert ( builder ! = null ) ;
D . assert ( converter ! = null ) ;
this . converter = converter ;
this . pure = pure ;
this . shouldRebuild = shouldRebuild ;
this . host = host ;
//this.host = host;
}
public override widgets . State createState ( ) {
}
void _handleStateChanged ( State state ) {
if ( this . widget . host ! = null ) {
var preInstance = Window . instance ;
using ( WindowProvider . of ( this . widget . host ) . getScope ( ) ) {
this . _innerStateChanged ( state ) ;
}
Window . instance = preInstance ;
}
else if ( Window . hasInstance ) {
//if (this.widget.host != null) {
// var preInstance = Window.instance;
// using (WindowProvider.of(this.widget.host).getScope()) {
// this._innerStateChanged(state);
// }
// Window.instance = preInstance;
//}
if ( Window . hasInstance ) {
this . _innerStateChanged ( state ) ;
}
else {