예제 #1
0
        private void NodeClicked(object sender, NodeClickedEventArgs e)
        {
            var nodeControl = sender as NodeControl;

            if (_superGraphController != null && nodeControl != null)
            {
                var node = nodeControl.DataContext as Node;
                if (node != null)
                {
                    if (node.MapObjectType == _mapManager.NodeTypes["CompendiumMapNode"].Id)
                    {
                        var facadeNode = node.Proxy as FacadeNode;
                        if (facadeNode != null)
                        {
                            if (!facadeNode.IsConcrete)
                            {
                                return; //if the node isn't concrete we won't be able to navigate down into the submap (ie it was just added and the transactions are outstanding)
                            }
                        }
                        IoC.GetInstance <ISuperGraphRelationshipFactory>().IsSameDomain = true;
                        SuperGraph.ClearMapObjects();
                        ShowLoading();

                        var breadcrumb = new BreadcrumbItem(node);
                        Breadcrumbs.BreadcrumbTrail.Add(breadcrumb);

                        _superGraphController.ChangeContextAsync(node);

                        //The line below forces the related content panels to reset and hide with each map navigation
                        //it's commented out to experiment what it's like to leave the content in place
                        //RelatedContentPanelUtil.Instance.ResetAndHidePanels();
                    }
                }
            }
        }
예제 #2
0
        private void OnBreadcrumbChanged(object sender, BreadcrumbChangedEventArgs e)
        {
            var breadcrumb = sender as BreadcrumbControl;

            if (breadcrumb != null)
            {
                SuperGraph.ClearMapObjects();
                ShowLoading();
                _superGraphController.ChangeContextAsync(e.NewItem.Node);
                PreLoader.LoadParentBreadcrumb(e.NewItem.Node.Proxy, e.ParentIndex);
            }
        }
예제 #3
0
 public void Refresh(BreadcrumbControl control = null)
 {
     if (control == null)
     {
         control = Breadcrumbs.CurrentBreadcrumbControl;
     }
     if (control != null)
     {
         SuperGraph.ClearMapObjects(false);
         ShowLoading();
         _superGraphController.ChangeContextAsync(control.BreadcrumbData.Node);
     }
 }
예제 #4
0
        private void SearchBox_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            var searchTerm = SearchBox.Text.Trim();

            if (searchTerm.Length > 0)
            {
                var nodes = SuperGraph.SearchNodeControlsByName(searchTerm);
                if (nodes.Any())
                {
                    SuperGraph.Selector.Clear();
                    ((ISelectorControl)SuperGraph).SelectNodeByGuid(nodes[0].ViewModelNode.Proxy.Id);
                    SearchBox.Focus();
                }
            }
        }
예제 #5
0
        private void OnBreadcrumbClicked(object sender, BreadcrumbClickedEventArgs e)
        {
            var breadcrumbControl = sender as BreadcrumbControl;

            if (breadcrumbControl != null)
            {
                SuperGraph.ClearMapObjects();
                ShowLoading();
                _superGraphController.ChangeContextAsync(breadcrumbControl.BreadcrumbData.Node);
                IsLoadMapByGuid = false;
                if (e.IsParentRemoved)
                {
                    PreLoader.LoadParentBreadcrumb(breadcrumbControl.BreadcrumbData.Node.Proxy, e.ParentIndex);
                }
            }
        }
예제 #6
0
 private void LoadMap(Proxy.INode node, bool dialoagResult, bool isAuthorMode)
 {
     if (dialoagResult)
     {
         DebugLogger.Instance.LogMsg(string.Format("Loading Map[{0}] of Domain[{1}]", node.Id, node.DomainId));
         IsLoadMapByGuid = false;
         SuperGraph.ClearMapObjects();
         Breadcrumbs.BreadcrumbTrail.Clear();
         ShowLoading();
         _mapManager.QueryMapByIdCompleted.RegisterEvent(node.Id, QueryMapByDomain);
         _mapManager.QueryMapByIdAsync(node.DomainId, node.Id, 1);
         IoC.GetInstance <ISuperGraphRelationshipFactory>().IsSameDomain = false;
         if (isAuthorMode)
         {
             SuperGraph.AuthorMode();
         }
     }
 }
예제 #7
0
        private void MapLoadCompleted(object sender, EventArgs eventArgs)
        {
            var selector = SuperGraph as ISelectorControl;

            if (IsLoadMapByGuid)
            {
                selector.SelectNodeByGuid(NodeId);
                SuperGraph.RecheckIncorrectVisibility();
                SuperGraph.ReScanForCollapseStates();
            }
            else
            {
                SuperGraph.RecheckIncorrectVisibility();
                SuperGraph.ReScanForCollapseStates();

                Deployment.Current.Dispatcher.BeginInvoke(() => SuperGraph.LoadCookie());

                if (App.UserStyle == UserStyle.Reader && SuperGraph.AllowAutoRealign)
                {
                    //Force UI thread to realign
                    Deployment.Current.Dispatcher.BeginInvoke(() => SuperGraph.AutoRealign());
                }

                Deployment.Current.Dispatcher.BeginInvoke(() => SuperGraph.RecheckLocations());
            }

            if (!SuperGraph.MapInformation.IsMapMoved && selector.NodesSelector.NodeControls.Count == 0)
            {
                selector.CentraliseMostImportantParent();
            }

            SuperGraph.SetMouse();
            SuperGraph.Focus();
            Loader.Visibility = Visibility.Collapsed;
            IsLoadMapByGuid   = false; //after successfully loading by id reset the state

            MapLoaded();
        }
예제 #8
0
 public BreadcrumbLoader(IMapManager mapManager,
     SuperGraph.View.BreadcrumbSupportClasses.BreadcrumbBarControl breadcrumbs)
 {
     MapManager = mapManager;
     Breadcrumbs = breadcrumbs;
 }