Ejemplo n.º 1
0
 static ResourceRef TryCreate(TextReference @ref)
 {
     if (@ref == null)
     {
         return(null);
     }
     return(ResourceRef.TryCreate(@ref.Reference));
 }
Ejemplo n.º 2
0
            static ResourceRef TryCreate(TreeNodeData[] nodes)
            {
                if (nodes == null || nodes.Length != 1)
                {
                    return(null);
                }
                var tokNode = nodes[0] as IMDTokenNode;

                if (tokNode != null)
                {
                    return(ResourceRef.TryCreate(tokNode.Reference));
                }
                return(null);
            }
Ejemplo n.º 3
0
        static void Execute(IDocumentTabService documentTabService, ResourceRef resRef)
        {
            if (resRef == null)
            {
                return;
            }
            var modNode = documentTabService.DocumentTreeView.FindNode(resRef.Module);

            Debug.Assert(modNode != null);
            if (modNode == null)
            {
                return;
            }
            modNode.TreeNode.EnsureChildrenLoaded();
            var resDirNode = modNode.TreeNode.DataChildren.FirstOrDefault(a => a is ResourcesFolderNode);

            Debug.Assert(resDirNode != null);
            if (resDirNode == null)
            {
                return;
            }
            resDirNode.TreeNode.EnsureChildrenLoaded();
            var resSetNode = resDirNode.TreeNode.DataChildren.FirstOrDefault(a => a is ResourceElementSetNode && ((ResourceElementSetNode)a).Name == resRef.Filename);

            Debug.Assert(resSetNode != null);
            if (resSetNode == null)
            {
                return;
            }
            resSetNode.TreeNode.EnsureChildrenLoaded();
            var resNode = resSetNode.TreeNode.DataChildren.FirstOrDefault(a => a is ResourceElementNode && ((ResourceElementNode)a).Name == resRef.ResourceName);

            Debug.Assert(resNode != null);
            if (resNode == null)
            {
                return;
            }
            documentTabService.FollowReference(resNode);
        }
Ejemplo n.º 4
0
 static bool IsVisible(ResourceRef resRef) => resRef != null;
Ejemplo n.º 5
0
		static void Execute(IDocumentTabService documentTabService, ResourceRef resRef) {
			if (resRef == null)
				return;
			var modNode = documentTabService.DocumentTreeView.FindNode(resRef.Module);
			Debug.Assert(modNode != null);
			if (modNode == null)
				return;
			modNode.TreeNode.EnsureChildrenLoaded();
			var resDirNode = modNode.TreeNode.DataChildren.FirstOrDefault(a => a is ResourcesFolderNode);
			Debug.Assert(resDirNode != null);
			if (resDirNode == null)
				return;
			resDirNode.TreeNode.EnsureChildrenLoaded();
			var resSetNode = resDirNode.TreeNode.DataChildren.FirstOrDefault(a => a is ResourceElementSetNode && ((ResourceElementSetNode)a).Name == resRef.Filename);
			Debug.Assert(resSetNode != null);
			if (resSetNode == null)
				return;
			resSetNode.TreeNode.EnsureChildrenLoaded();
			var resNode = resSetNode.TreeNode.DataChildren.FirstOrDefault(a => a is ResourceElementNode && ((ResourceElementNode)a).Name == resRef.ResourceName);
			Debug.Assert(resNode != null);
			if (resNode == null)
				return;
			documentTabService.FollowReference(resNode);
		}
Ejemplo n.º 6
0
		static bool IsVisible(ResourceRef resRef) => resRef != null;