示例#1
0
 public ResourceModel(DocumentCompositeNode resourceNode)
 {
     this.resourceNode = resourceNode;
     this.marker       = resourceNode.Marker;
 }
示例#2
0
        public void Update(SceneViewModel targetViewModel, SceneViewModel.ViewStateBits viewStateBits)
        {
            bool flag1 = (viewStateBits & SceneViewModel.ViewStateBits.ElementSelection) != SceneViewModel.ViewStateBits.None;

            if (targetViewModel != null && !targetViewModel.Document.IsEditable)
            {
                targetViewModel = (SceneViewModel)null;
            }
            if (targetViewModel != this.lastViewModel)
            {
                if (this.subscription == null || targetViewModel == null || this.subscription.ProjectContext != targetViewModel.ProjectContext)
                {
                    if (this.subscription != null)
                    {
                        this.subscription.PathNodeInserted   -= new XamlProjectSubscription.DocumentNodeInsertedHandler(this.Subscription_PathNodeInserted);
                        this.subscription.PathNodeRemoved    -= new XamlProjectSubscription.DocumentNodeRemovedHandler(this.Subscription_PathNodeRemoved);
                        this.subscription.CatastrophicUpdate -= new EventHandler(this.Subscription_Refresh);
                        this.subscription.Dispose();
                        this.subscription = (XamlProjectSubscription)null;
                    }
                    if (targetViewModel != null)
                    {
                        this.subscription = new XamlProjectSubscription(this.ResourceManager.DesignerContext, targetViewModel.ProjectContext, new SearchPath(new SearchStep[2]
                        {
                            new SearchStep((SearchAxis) new DelegateAxis(new DelegateAxis.EnumerationHandler(this.FilterScopeEnumerator), SearchScope.NodeTreeSelf)),
                            new SearchStep((SearchAxis) new DelegateAxis(new DelegateAxis.EnumerationHandler(this.FilteredResourceEnumerator), SearchScope.NodeTreeDescendant))
                        }), new XamlProjectSubscription.DocumentNodeFilter(this.FilteredDocumentNodeEnumerator));
                        this.subscription.PathNodeInserted   += new XamlProjectSubscription.DocumentNodeInsertedHandler(this.Subscription_PathNodeInserted);
                        this.subscription.PathNodeRemoved    += new XamlProjectSubscription.DocumentNodeRemovedHandler(this.Subscription_PathNodeRemoved);
                        this.subscription.CatastrophicUpdate += new EventHandler(this.Subscription_Refresh);
                    }
                }
                else
                {
                    this.subscription.Clear();
                }
                this.ClearItems();
                this.lastViewModel = targetViewModel;
                this.lastSelection.Clear();
                flag1 = true;
            }
            if (this.lastViewModel == null || !flag1)
            {
                return;
            }
            DocumentNodeMarkerSortedListOf <DocumentNodePath> newBasisNodes = new DocumentNodeMarkerSortedListOf <DocumentNodePath>(this.Selection.Count);

            foreach (SceneNode sceneNode in this.Selection.Selection)
            {
                DocumentNodeMarker marker           = sceneNode.DocumentNode.Marker;
                DocumentNodePath   documentNodePath = this.lastSelection.Find(marker) ?? sceneNode.DocumentNodePath;
                newBasisNodes.Add(marker, documentNodePath);
            }
            bool flag2 = true;

            foreach (DocumentNodeMarker marker in this.lastSelection.Markers)
            {
                if (newBasisNodes.Find(marker) == null)
                {
                    flag2 = false;
                    break;
                }
            }
            if (!flag2)
            {
                this.subscription.Clear();
                this.ClearItems();
            }
            this.subscription.SetBasisNodes(newBasisNodes);
            this.lastSelection = newBasisNodes;
            this.subscription.Update();
            this.ResourceManager.SelectedItems.RemoveSelection((ResourceEntryBase)this);
            this.OnPropertyChanged("Name");
            this.OnPropertyChanged("Type");
            this.OnPropertyChanged("UniqueId");
            this.OnPropertyChanged("ToolTip");
        }
示例#3
0
 private void ActionSubscription_ContentChanged(object sender, Microsoft.Expression.DesignSurface.ViewModel.SceneNode pathNode, TriggerActionModel content, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     content.Update();
 }