|
|
@ -32,7 +32,6 @@ namespace ICSharpCode.SharpDevelop.Project |
|
|
|
{ |
|
|
|
{ |
|
|
|
IProject project; |
|
|
|
IProject project; |
|
|
|
IProgressMonitor progressMonitor; |
|
|
|
IProgressMonitor progressMonitor; |
|
|
|
string outputNamespace; |
|
|
|
|
|
|
|
internal bool RunningSeparateThread; |
|
|
|
internal bool RunningSeparateThread; |
|
|
|
|
|
|
|
|
|
|
|
public CustomToolContext(IProject project) |
|
|
|
public CustomToolContext(IProject project) |
|
|
@ -56,10 +55,7 @@ namespace ICSharpCode.SharpDevelop.Project |
|
|
|
get { return project; } |
|
|
|
get { return project; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public string OutputNamespace { |
|
|
|
public string OutputNamespace { get; set; } |
|
|
|
get { return outputNamespace; } |
|
|
|
|
|
|
|
set { outputNamespace = value; } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Runs a method asynchronously. Prevents another CustomTool invocation
|
|
|
|
/// Runs a method asynchronously. Prevents another CustomTool invocation
|
|
|
@ -419,20 +415,25 @@ namespace ICSharpCode.SharpDevelop.Project |
|
|
|
if (fileName == null) |
|
|
|
if (fileName == null) |
|
|
|
throw new ArgumentNullException("fileName"); |
|
|
|
throw new ArgumentNullException("fileName"); |
|
|
|
|
|
|
|
|
|
|
|
string relPath = FileUtility.GetRelativePath(project.Directory, Path.GetDirectoryName(fileName)); |
|
|
|
if (project.LanguageProperties == Dom.LanguageProperties.VBNet) { |
|
|
|
string[] subdirs = relPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); |
|
|
|
return project.RootNamespace; |
|
|
|
StringBuilder standardNameSpace = new StringBuilder(project.RootNamespace); |
|
|
|
} else { |
|
|
|
foreach(string subdir in subdirs) { |
|
|
|
string relPath = FileUtility.GetRelativePath(project.Directory, Path.GetDirectoryName(fileName)); |
|
|
|
if (subdir == "." || subdir == ".." || subdir.Length == 0) |
|
|
|
string[] subdirs = relPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); |
|
|
|
continue; |
|
|
|
StringBuilder standardNameSpace = new StringBuilder(project.RootNamespace); |
|
|
|
if (subdir.Equals("src", StringComparison.OrdinalIgnoreCase)) |
|
|
|
foreach(string subdir in subdirs) { |
|
|
|
continue; |
|
|
|
if (subdir == "." || subdir == ".." || subdir.Length == 0) |
|
|
|
if (subdir.Equals("source", StringComparison.OrdinalIgnoreCase)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
if (subdir.Equals("src", StringComparison.OrdinalIgnoreCase)) |
|
|
|
standardNameSpace.Append('.'); |
|
|
|
continue; |
|
|
|
standardNameSpace.Append(NewFileDialog.GenerateValidClassOrNamespaceName(subdir, true)); |
|
|
|
if (subdir.Equals("source", StringComparison.OrdinalIgnoreCase)) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
if (standardNameSpace.Length > 0) |
|
|
|
|
|
|
|
standardNameSpace.Append('.'); |
|
|
|
|
|
|
|
standardNameSpace.Append(NewFileDialog.GenerateValidClassOrNamespaceName(subdir, true)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return standardNameSpace.ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
return standardNameSpace.ToString(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void RunCustomTool(CustomToolRun run) |
|
|
|
static void RunCustomTool(CustomToolRun run) |
|
|
|