Пример #1
0
        public override bool HasReferencedProject(Project project)
        {
            if (this.IsLoaded)
            {
                return(GameProjectContent.CheckReferenceProjectInObject(this.RootVisualObject as NodeObject, project));
            }
            if (this.Content == null || this.Content.ObjectData == null)
            {
                return(false);
            }
            ResourceData resourceData = project.GetResourceData();

            return(GameProjectContent.CheckReferenceProjectInObjectData(this.Content.ObjectData, project, resourceData));
        }
Пример #2
0
        private static bool CheckReferenceProjectInObjectData(NodeObjectData parentNode, Project project, ResourceData projectPath)
        {
            bool result;

            if (parentNode == null)
            {
                result = false;
            }
            else
            {
                ProjectNodeObjectData projectNodeObjectData = parentNode as ProjectNodeObjectData;
                if (projectNodeObjectData != null)
                {
                    ResourceItemData fileData = projectNodeObjectData.FileData;
                    if (projectPath.Equals(fileData))
                    {
                        result = true;
                        return(result);
                    }
                    if (fileData != null)
                    {
                        Project project2 = Services.ProjectsService.CurrentResourceGroup.FindResourceItem(fileData) as Project;
                        if (project2 != null)
                        {
                            bool flag = project2.HasReferencedProject(project);
                            if (flag)
                            {
                                result = true;
                                return(result);
                            }
                        }
                    }
                }
                if (parentNode.Children != null)
                {
                    foreach (NodeObjectData current in parentNode.Children)
                    {
                        bool flag2 = GameProjectContent.CheckReferenceProjectInObjectData(current, project, projectPath);
                        if (flag2)
                        {
                            result = true;
                            return(result);
                        }
                    }
                }
                result = false;
            }
            return(result);
        }
Пример #3
0
        public override bool HasReferencedProject(Project project)
        {
            bool result;

            if (this.IsLoaded)
            {
                result = GameProjectContent.CheckReferenceProjectInObject(this.RootVisualObject as NodeObject, project);
            }
            else if (this.Content == null || this.Content.ObjectData == null)
            {
                result = false;
            }
            else
            {
                ResourceData resourceData = project.GetResourceData();
                result = GameProjectContent.CheckReferenceProjectInObjectData(this.Content.ObjectData, project, resourceData);
            }
            return(result);
        }
Пример #4
0
        private static bool CheckReferenceProjectInObjectData(NodeObjectData parentNode, Project project, ResourceData projectPath)
        {
            if (parentNode == null)
            {
                return(false);
            }
            ProjectNodeObjectData projectNodeObjectData = parentNode as ProjectNodeObjectData;

            if (projectNodeObjectData != null)
            {
                ResourceItemData fileData = projectNodeObjectData.FileData;
                if (projectPath.Equals((ResourceData)fileData))
                {
                    return(true);
                }
                if ((ResourceData)fileData != (ResourceData)null)
                {
                    Project resourceItem = Services.ProjectsService.CurrentResourceGroup.FindResourceItem((ResourceData)fileData) as Project;
                    if (resourceItem != null && resourceItem.HasReferencedProject(project))
                    {
                        return(true);
                    }
                }
            }
            if (parentNode.Children != null)
            {
                foreach (NodeObjectData child in parentNode.Children)
                {
                    if (GameProjectContent.CheckReferenceProjectInObjectData(child, project, projectPath))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }