示例#1
0
        private void OnInitialiseMapManagerCompleted(object sender, InitialiseMapManagerEventArgs e)
        {
            if (GetDomainId().HasValue)
            {
                //if the starting NodeUid is provided use that
                if (GetNodeId().HasValue)
                {
                    InitializeNavigator(GetDomainId().Value, GetNodeId().Value);
                }
                //if no starting NodeUid is provided find the domain node and use that
                else
                {
                    _mapManager.AcquireNodesByDomainCompleted.RegisterEvent(GetDomainId().Value, new EventHandler <Proxy.NodesEventArgs>(OnAcquireNodesByDomainCompleted));
                    _mapManager.AcquireNodesByDomainAsync(GetDomainId().Value);
                }
            }
            else
            {
                // If there is no domain ID supplied then provide a dialog box to select one.
                DomainSelectionDialog selectionDialog = new DomainSelectionDialog();
                // TODO: The following lines need to be modded so that the MapManager is passed through rather than the NodeService.
                selectionDialog.DataContext    = _nodeService;
                selectionDialog.MapManager     = _mapManager;
                selectionDialog.HasCloseButton = false;

                selectionDialog.Closed += delegate(object dialog, EventArgs dialogArgs)
                {
                    this.Dispatcher.BeginInvoke(delegate() { InitializeNavigator(selectionDialog.DomainId, selectionDialog.NodeId); });
                };

                selectionDialog.Show();
            }
        }
示例#2
0
        public void HomeScreen(bool isInitialised = false)
        {
            // If there is no domain ID supplied then provide a dialog box to select one.
            var selectionDialog = new DomainSelectionDialog(SecurityManager)
            {
                HasCloseButton = isInitialised,
                MapManager     = _mapManager,
            };

            if (isInitialised)
            {
                selectionDialog.Closed += delegate
                {
                    Dispatcher.BeginInvoke(() =>
                                           OnDomainAndMapSelected(selectionDialog.Map,
                                                                  selectionDialog.DialogResult != null && selectionDialog.DialogResult.Value, selectionDialog.IsAuthorMode)
                                           );
                };
            }
            else
            {
                selectionDialog.Closed += delegate
                {
                    Dispatcher.BeginInvoke(() => OnDomainAndMapSelected(selectionDialog.Map, true, selectionDialog.IsAuthorMode));
                };
            }

            RelatedContentPanelUtil.Instance.ResetAndHidePanels();

            selectionDialog.Show();
        }
        private void OnInitialiseMapManagerCompleted(object sender, InitialiseMapManagerEventArgs e)
        {
            if (GetDomainId().HasValue)
            {
                //if the starting NodeUid is provided use that
                if (GetNodeId().HasValue)
                {
                    InitializeNavigator(GetDomainId().Value, GetNodeId().Value);
                }
                //if no starting NodeUid is provided find the domain node and use that
                else
                {
                    _mapManager.QueryMapByDomainCompleted.RegisterEvent(GetDomainId().Value, new EventHandler<Proxy.NodesEventArgs>(OnAcquireNodesByDomainCompleted));
                    _mapManager.QueryMapByDomainAsync(GetDomainId().Value);
                }
            }
            else
            {
                // If there is no domain ID supplied then provide a dialog box to select one.
                DomainSelectionDialog selectionDialog = new DomainSelectionDialog(new SecurityManager());
                // TODO: The following lines need to be modded so that the MapManager is passed through rather than the NodeService.
                selectionDialog.DataContext = _nodeService;
                selectionDialog.MapManager = _mapManager;
                selectionDialog.HasCloseButton = false;

                selectionDialog.Show();
            }
        }
示例#4
0
        public void HomeScreen(bool isInitialised = false)
        {
            // If there is no domain ID supplied then provide a dialog box to select one.
            var selectionDialog = new DomainSelectionDialog(SecurityManager)
            {
                HasCloseButton = isInitialised,
                MapManager = _mapManager,
            };

            if (isInitialised)
            {
                selectionDialog.Closed += delegate
                {
                    Dispatcher.BeginInvoke(() =>
                        OnDomainAndMapSelected(selectionDialog.Map,
                            selectionDialog.DialogResult != null && selectionDialog.DialogResult.Value, selectionDialog.IsAuthorMode)
                        );
                };
            }
            else
            {
                selectionDialog.Closed += delegate
                {
                    Dispatcher.BeginInvoke(() => OnDomainAndMapSelected(selectionDialog.Map, true, selectionDialog.IsAuthorMode));
                };
            }

            RelatedContentPanelUtil.Instance.ResetAndHidePanels();

            selectionDialog.Show();
        }