Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 202b5f1

Browse files
Merge branch 'master' of github.com:icsharpcode/SharpDevelop
2 parents a0acf05 + d52a333 commit 202b5f1

4 files changed

Lines changed: 40 additions & 3 deletions

File tree

src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/EditCommentCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public override void ExecuteWithResourceItems(System.Collections.Generic.IEnumer
3434
selectedItem.Comment);
3535
if (newValue != null && newValue != selectedItem.Comment) {
3636
selectedItem.Comment = newValue;
37+
selectedItem.RichComment = newValue;
3738
}
3839
}
3940
}

src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ViewModels/ResourceItem.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public ResourceItem(ResourceEditorViewModel resourceEditor, string name, object
6565
this.ResourceValue = resourceValue;
6666
this.resourceType = GetResourceTypeFromValue(resourceValue);
6767
this.Comment = comment;
68+
this.RichComment = comment;
6869
}
6970

7071
#region INotifyPropertyChanged implementation

src/Main/Base/Project/Designer/TypeResolutionService.cs

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,11 @@ public Type GetType(string name, bool throwOnError, bool ignoreCase)
411411
ITypeDefinition definition = ReflectionHelper.ParseReflectionName(name)
412412
.Resolve(compilation).GetDefinition();
413413
if (definition != null) {
414-
Assembly assembly = LoadAssembly(definition.ParentAssembly);
415-
if (assembly != null) {
416-
type = assembly.GetType(name, false, ignoreCase);
414+
using (var resolver = new ProjectAssemblyResolver(compilation, this)) {
415+
Assembly assembly = LoadAssembly(definition.ParentAssembly);
416+
if (assembly != null) {
417+
type = assembly.GetType(name, false, ignoreCase);
418+
}
417419
}
418420
}
419421
}
@@ -582,5 +584,37 @@ static Assembly AssemblyResolveEventHandler(object sender, ResolveEventArgs args
582584
}
583585
return lastAssembly;
584586
}
587+
588+
class ProjectAssemblyResolver : IDisposable
589+
{
590+
readonly ICompilation compilation;
591+
readonly TypeResolutionService typeResolutionService;
592+
593+
public ProjectAssemblyResolver(ICompilation compilation, TypeResolutionService typeResolutionService)
594+
{
595+
this.compilation = compilation;
596+
this.typeResolutionService = typeResolutionService;
597+
AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolve;
598+
}
599+
600+
public void Dispose()
601+
{
602+
AppDomain.CurrentDomain.AssemblyResolve -= AssemblyResolve;
603+
}
604+
605+
Assembly AssemblyResolve(object sender, ResolveEventArgs args)
606+
{
607+
try {
608+
IAssembly assembly = compilation.Assemblies
609+
.FirstOrDefault(asm => asm.FullAssemblyName == args.Name);
610+
if (assembly != null) {
611+
return typeResolutionService.LoadAssembly(assembly);
612+
}
613+
} catch (Exception ex) {
614+
LoggingService.Error(ex);
615+
}
616+
return null;
617+
}
618+
}
585619
}
586620
}

src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ protected IEnumerable<FileProjectItem> AddNewItems()
365365
FileTemplateResult result = SD.UIService.ShowNewFileDialog(node.Project, node.Directory);
366366
if (result != null) {
367367
node.RecreateSubNodes();
368+
ProjectBrowserPad.Instance.ProjectBrowserControl.SelectFile(result.Options.FileName);
368369
return result.NewFiles.Select(node.Project.FindFile).Where(f => f != null).ToArray();
369370
} else {
370371
return null;

0 commit comments

Comments
 (0)