Пример #1
0
        private void BindLifeTimeActions(IViewModel model)
        {
            //bind model lifetime to local
            var modelLifeTime = model.LifeTime;

            if (model.IsDisposeWithModel)
            {
                modelLifeTime.ComposeCleanUp(_viewModelLifeTime, () =>
                {
                    if (Equals(ViewModel, model))
                    {
                        Close();
                    }
                });
            }

            _viewModelLifeTime.AddCleanUpAction(() =>
            {
                if (_isViewOwner)
                {
                    ViewModel.Cancel();
                }
            });

            _viewModelLifeTime.AddCleanUpAction(_progressLifeTime.Terminate);
        }
Пример #2
0
        public bool Connect()
        {
            Disconnect();

            _lifeTime.AddCleanUpAction(() => _connections.Clear());

            _sheetService = LoadSheetService(_appName, _scope);

            _lifeTime.AddCleanUpAction(() => IsConnectionRefused = true);

            return(IsConnected);
        }
Пример #3
0
        protected override void OnEnable()
        {
            _lifeTime?.Release();

            GameLog.Log("GameFlowWindow : OnEnable");
            graph = null;

            base.OnEnable();

            _lifeTime.AddCleanUpAction(() => windows.Remove(this));

            if (!windows.Contains(this))
            {
                windows.Add(this);
            }

            MessageBroker.Default
            .Receive <UniGraphSaveMessage>()
            .Where(x => x.graph == _targetGraph)
            .Do(x => Save())
            .Subscribe()
            .AddTo(_lifeTime);

            MessageBroker.Default
            .Receive <UniGraphReloadMessage>()
            .Where(x => x.graph == _targetGraph)
            .Do(x => Save())
            .Do(x => Reload())
            .Subscribe()
            .AddTo(_lifeTime);

            Reload();
        }
Пример #4
0
        private void BindLifeTimeActions(IViewModel model)
        {
            //bind model lifetime to local
            var modelLifeTime = model.LifeTime;

            modelLifeTime.ComposeCleanUp(_viewModelLifeTime, Close);

            _viewModelLifeTime.AddCleanUpAction(() =>
            {
                if (_isViewOwner)
                {
                    model.Dispose();
                }
            });

            _viewModelLifeTime.AddCleanUpAction(_progressLifeTime.Terminate);
        }
        protected override void InitializeView()
        {
            _lifeTimeDefinition.Release();

            SourceGraph = graph as UniGraphAsset;

            BindEvents();

            _lifeTimeDefinition.AddCleanUpAction(_registeredNodes.Clear);
        }
        protected override void InitializeView()
        {
            lifeTimeDefinition.Release();

            SourceGraph = graph as UniAssetGraph;

            BindEvents();
            CreateGroupViews(SourceGraph.UniGraph);

            lifeTimeDefinition.AddCleanUpAction(() => registeredNodes.Clear());
        }
        public void Activate(IViewLayoutContainer controllerContainer)
        {
            _lifeTimeDefinition.Release();
            _lifeTimeDefinition.AddCleanUpAction(() => _controllerContainer = null);

            _controllerContainer = controllerContainer;

            BindSceneActions();

            OnActivate(controllerContainer);
        }
Пример #8
0
        /// <summary>
        /// initialize property with target Addressable Asset
        /// </summary>
        /// <param name="addressable"></param>
        public void Initialize(TAddressable addressable)
        {
            lifeTimeDefinition = lifeTimeDefinition ?? new LifeTimeDefinition();
            progress           = progress ?? new FloatRecycleReactiveProperty();
            status             = status ?? new RecycleReactiveProperty <AsyncOperationStatus>();
            value = value ?? new RecycleReactiveProperty <TApi>();

            lifeTimeDefinition.Release();

            reference = addressable;

            lifeTimeDefinition.AddCleanUpAction(CleanUp);
        }
        protected override void OnEnable()
        {
            _lifeTime?.Release();

            GameLog.Log("GameFlowWindow : OnEnable");
            graph = null;

            base.OnEnable();

            _lifeTime.AddCleanUpAction(() => windows.Remove(this));
            if (!windows.Contains(this))
            {
                windows.Add(this);
            }

            Reload();
        }