protected override void Work()
        {
            IViewCollection views = this.model.ResourceEntryNode.ViewModel.DesignerContext.ViewService.Views;

            if (this.currentViewIndex < 0 || this.currentViewIndex >= views.Count)
            {
                return;
            }
            SceneView sceneView = views[this.currentViewIndex] as SceneView;

            if (sceneView == null)
            {
                return;
            }
            SceneViewModel viewModel = sceneView.ViewModel;

            if (viewModel == this.model.ResourceEntryNode.ViewModel || !viewModel.Document.IsEditable)
            {
                return;
            }
            List <SceneNode> list = new List <SceneNode>();

            viewModel.FindInternalResourceReferences((DocumentCompositeNode)this.model.ResourceEntryNode.DocumentNode, (ICollection <SceneNode>)list);
            foreach (SceneNode node in list)
            {
                this.model.ReferenceNames.Add(ReferencesFoundModel.SceneNodeElementName(node));
                this.model.AddReferencesFile(sceneView.ViewModel.Document);
            }
        }
 public ReferencesFoundModel(SceneNode resourceEntryNode, ICollection <SceneNode> references, ReferencesFoundModel.UseScenario useScenario)
 {
     this.resourceEntryNode = resourceEntryNode;
     foreach (SceneNode node in (IEnumerable <SceneNode>)references)
     {
         this.referenceNames.Add(ReferencesFoundModel.SceneNodeElementName(node));
     }
     if (references.Count > 0)
     {
         this.AddReferencesFile(resourceEntryNode.ViewModel.Document);
     }
     this.useScenario = useScenario;
     if (this.IsDeleting)
     {
         this.updateMethod = ReferencesFoundModel.UpdateMethod.ConvertToLocal;
     }
     else
     {
         this.updateMethod = ReferencesFoundModel.UpdateMethod.UpdateReferences;
     }
 }