Пример #1
0
        private void EnsureFrameInterfaceClosed()
        {
            // Optionally post the data changes
            if (_postBeforeClosingEmbedded)
            {
                _frameInterfaceNode.PostChanges();
            }

            // Invoke the before close embedded handler
            if (_beforeCloseEmbedded != null)
            {
                _beforeCloseEmbedded.Execute(this, new EventParams("AInterface", _frameInterfaceNode));
            }

            try
            {
                _frameInterfaceNode.HostNode.BroadcastEvent(new DisableSourceEvent());
                if (_sourceLink != null)
                {
                    _sourceLink.TargetSource = null;
                }
            }
            finally
            {
                try
                {
                    _frameInterfaceNode.HostNode.Dispose();
                }
                finally
                {
                    _frameInterfaceNode = null;
                }
            }
        }
Пример #2
0
        private void LoadFrameInterface()
        {
            IHost host = HostNode.Session.CreateHost();

            try
            {
                _frameInterfaceNode = new FrameInterface(this);
                try
                {
                    host.Load(_document, _frameInterfaceNode);
                    if (_sourceLink != null)
                    {
                        _sourceLink.TargetSource = _frameInterfaceNode.MainSource;
                    }
                    host.Open(!Active);
                    if (Active)
                    {
                        BroadcastEvent(new FormShownEvent());
                    }
                }
                catch
                {
                    _frameInterfaceNode.Dispose();
                    _frameInterfaceNode = null;
                    throw;
                }
            }
            catch
            {
                host.Dispose();
                throw;
            }
        }