Make ContentCompilerGui compatible to recent changes in pipeline and did some usability changes. Make the Visual Studio Extension work even if the ANX Framework is not installed additionally.. Improve that the path for assembly refernces in a content project doesn't get automatically updated, only if the reference is actually saved, this is so you can specify a relative path yourself. Fix missing icon for ContentProject when it was opened with Visual Studio. Made create_shaders.bat directly executable under windows by fixing the directory separators.
96 lines
2.7 KiB
C#
96 lines
2.7 KiB
C#
using Microsoft.VisualStudio.Project;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ANX.Framework.VisualStudio.Nodes
|
|
{
|
|
public class AnxAssemblyReferenceNode : AssemblyReferenceNode
|
|
{
|
|
public AnxAssemblyReferenceNode(ContentProjectNode node, string name, string assemblyPath)
|
|
: base(node, name, assemblyPath)
|
|
{
|
|
this.OriginalAssemblyPath = assemblyPath;
|
|
}
|
|
|
|
public string OriginalAssemblyPath
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public new ContentProjectNode ProjectMgr
|
|
{
|
|
get
|
|
{
|
|
return (ContentProjectNode)base.ProjectMgr;
|
|
}
|
|
}
|
|
|
|
protected override string ResolveAssemblyPath(string assemblyPath)
|
|
{
|
|
if (!File.Exists(assemblyPath))
|
|
{
|
|
using (var buildDomain = this.ProjectMgr.BuildAppDomain.Aquire())
|
|
{
|
|
assemblyPath = buildDomain.MakeAbsoluteFromSearchPaths(assemblyPath);
|
|
}
|
|
}
|
|
return assemblyPath;
|
|
}
|
|
|
|
protected override NodeProperties CreatePropertiesObject()
|
|
{
|
|
return new AnxAssemblyReferenceProperties(this);
|
|
}
|
|
|
|
public string RuntimeVersion
|
|
{
|
|
get
|
|
{
|
|
if (this.IsValid)
|
|
{
|
|
using (var domain = ProjectMgr.BuildAppDomain.Aquire())
|
|
{
|
|
return domain.Proxy.GetAssemblyRuntimeVersion(this.Url);
|
|
}
|
|
}
|
|
else
|
|
return string.Empty;
|
|
}
|
|
}
|
|
|
|
public override void RefreshReference(bool fileChanged = false)
|
|
{
|
|
if (ProjectMgr.BuildAppDomain.IsDisposed)
|
|
return;
|
|
|
|
Uri url;
|
|
if (Uri.TryCreate(this.Url, UriKind.Absolute, out url))
|
|
{
|
|
using (var buildDomain = ProjectMgr.BuildAppDomain.Aquire())
|
|
{
|
|
if (!File.Exists(this.Url))
|
|
{
|
|
buildDomain.RemoveShadowCopyDirectory(url);
|
|
}
|
|
|
|
base.RefreshReference(fileChanged);
|
|
|
|
if (File.Exists(this.Url))
|
|
{
|
|
buildDomain.AddShadowCopyDirectory(new Uri(Path.GetDirectoryName(this.Url)));
|
|
}
|
|
}
|
|
}
|
|
|
|
var container = (ContentProjectReferenceContainer)this.ProjectMgr.GetReferenceContainer();
|
|
if (fileChanged)
|
|
container.RefreshAssemblies();
|
|
}
|
|
}
|
|
}
|