Browse Source

Improved AddInManager (updating AddIns now works correctly).

Form Designer now no longer rewrites fields without modifier, patch by Christian Hornung.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@812 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
9158302376
  1. 2
      src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.addin
  2. 14
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/AbstractDesignerGenerator.cs
  3. 21
      src/AddIns/Misc/AddInManager/Project/Src/AddInControl.cs
  4. 20
      src/AddIns/Misc/AddInManager/Project/Src/InstallableAddIn.cs
  5. 175
      src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs
  6. 8
      src/Libraries/NRefactory/Project/Src/Output/CodeDOM/CodeDOMOutputVisitor.cs
  7. 16
      src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs
  8. BIN
      src/Main/StartUp/Project/Resources/BitmapResources.resources

2
src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.addin

@ -10,7 +10,7 @@
</Manifest> </Manifest>
<Runtime> <Runtime>
<Import assembly = "../../DisplayBindings/FormDesigner/FormDesigner.dll"/> <Import assembly = "$ICSharpCode.FormDesigner/FormDesigner.dll"/>
<Import assembly = "BooBinding.dll"/> <Import assembly = "BooBinding.dll"/>
<Import assembly = ":ICSharpCode.SharpDevelop"/> <Import assembly = ":ICSharpCode.SharpDevelop"/>
</Runtime> </Runtime>

14
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/AbstractDesignerGenerator.cs

@ -202,11 +202,19 @@ namespace ICSharpCode.FormDesigner
} }
// compare modifiers // compare modifiers
ModifierEnum[] sdModifiers = new ModifierEnum[] {ModifierEnum.Private, ModifierEnum.Protected, ModifierEnum.ProtectedAndInternal, ModifierEnum.Internal, ModifierEnum.Public};
MemberAttributes[] cdModifiers = new MemberAttributes[] {MemberAttributes.Private, MemberAttributes.Family, MemberAttributes.FamilyOrAssembly, MemberAttributes.Assembly, MemberAttributes.Public};
ModifierEnum oldModifiers = oldField.Modifiers & ModifierEnum.VisibilityMask; ModifierEnum oldModifiers = oldField.Modifiers & ModifierEnum.VisibilityMask;
MemberAttributes newModifiers = newField.Attributes & MemberAttributes.AccessMask; MemberAttributes newModifiers = newField.Attributes & MemberAttributes.AccessMask;
// SharpDevelop.Dom always adds Private modifier, even if not specified
// CodeDom omits Private modifier if not present (although it is the default)
if (oldModifiers == ModifierEnum.Private) {
if (newModifiers != 0 && newModifiers != MemberAttributes.Private) {
return true;
}
}
ModifierEnum[] sdModifiers = new ModifierEnum[] {ModifierEnum.Protected, ModifierEnum.ProtectedAndInternal, ModifierEnum.Internal, ModifierEnum.Public};
MemberAttributes[] cdModifiers = new MemberAttributes[] {MemberAttributes.Family, MemberAttributes.FamilyOrAssembly, MemberAttributes.Assembly, MemberAttributes.Public};
for (int i = 0; i < sdModifiers.Length; i++) { for (int i = 0; i < sdModifiers.Length; i++) {
if ((oldModifiers == sdModifiers[i]) ^ (newModifiers == cdModifiers[i])) { if ((oldModifiers == sdModifiers[i]) ^ (newModifiers == cdModifiers[i])) {
return true; return true;

21
src/AddIns/Misc/AddInManager/Project/Src/AddInControl.cs

@ -61,15 +61,30 @@ namespace ICSharpCode.AddInManager
Focus(); Focus();
} }
Color Mix(Color c1, Color c2, double perc)
{
double p1 = 1 - perc;
double p2 = perc;
return Color.FromArgb((int)(c1.R * p1 + c2.R * p2),
(int)(c1.G * p1 + c2.G * p2),
(int)(c1.B * p1 + c2.B * p2));
}
protected override void OnPaint(PaintEventArgs e) protected override void OnPaint(PaintEventArgs e)
{ {
Graphics g = e.Graphics; Graphics g = e.Graphics;
Rectangle bounds = this.ClientRectangle; Rectangle bounds = this.ClientRectangle;
bounds.Offset(1, 1); bounds.Offset(1, 1);
bounds.Inflate(-2, -2); bounds.Inflate(-2, -2);
Color startColor = SystemColors.ControlLightLight;
Color endColor = SystemColors.Control;
if (selected) {
startColor = Mix(SystemColors.ControlLightLight, SystemColors.Highlight, 0.1);
endColor = Mix(SystemColors.ControlLightLight, SystemColors.Highlight, 0.65);
}
Brush gradient = new LinearGradientBrush(bounds, Brush gradient = new LinearGradientBrush(bounds,
selected ? SystemColors.Control : SystemColors.ControlLightLight, startColor,
selected ? SystemColors.Highlight : SystemColors.ControlDark, endColor,
LinearGradientMode.ForwardDiagonal); LinearGradientMode.ForwardDiagonal);
GraphicsPath path = new GraphicsPath(); GraphicsPath path = new GraphicsPath();
@ -100,8 +115,6 @@ namespace ICSharpCode.AddInManager
gradient.Dispose(); gradient.Dispose();
Brush textBrush; Brush textBrush;
string description = GetText(out textBrush); string description = GetText(out textBrush);
if (selected && textBrush == SystemBrushes.GrayText)
textBrush = SystemBrushes.HighlightText;
int titleWidth; int titleWidth;
using (Font boldFont = new Font("Arial", 8, FontStyle.Bold)) { using (Font boldFont = new Font("Arial", 8, FontStyle.Bold)) {
g.DrawString(addIn.Name, boldFont, textBrush, innerMargin, innerMargin); g.DrawString(addIn.Name, boldFont, textBrush, innerMargin, innerMargin);

20
src/AddIns/Misc/AddInManager/Project/Src/InstallableAddIn.cs

@ -62,7 +62,7 @@ namespace ICSharpCode.AddInManager
} }
} }
public void Install() public void Install(bool isUpdate)
{ {
foreach (string identity in addIn.Manifest.Identities.Keys) { foreach (string identity in addIn.Manifest.Identities.Keys) {
ICSharpCode.Core.AddInManager.AbortRemoveUserAddInOnNextStart(identity); ICSharpCode.Core.AddInManager.AbortRemoveUserAddInOnNextStart(identity);
@ -78,13 +78,15 @@ namespace ICSharpCode.AddInManager
fastZip.ExtractZip(fileName, targetDir, null); fastZip.ExtractZip(fileName, targetDir, null);
addIn.Action = AddInAction.Install; addIn.Action = AddInAction.Install;
AddInTree.InsertAddIn(addIn); if (!isUpdate) {
AddInTree.InsertAddIn(addIn);
}
} else { } else {
ICSharpCode.Core.AddInManager.AddExternalAddIns(new AddIn[] { addIn }); ICSharpCode.Core.AddInManager.AddExternalAddIns(new AddIn[] { addIn });
} }
} }
public static void Uninstall(IList<AddIn> addIns) public static void CancelUpdate(IList<AddIn> addIns)
{ {
foreach (AddIn addIn in addIns) { foreach (AddIn addIn in addIns) {
foreach (string identity in addIn.Manifest.Identities.Keys) { foreach (string identity in addIn.Manifest.Identities.Keys) {
@ -93,9 +95,17 @@ namespace ICSharpCode.AddInManager
identity); identity);
if (Directory.Exists(targetDir)) if (Directory.Exists(targetDir))
Directory.Delete(targetDir, true); Directory.Delete(targetDir, true);
}
}
}
public static void Uninstall(IList<AddIn> addIns)
{
CancelUpdate(addIns);
foreach (AddIn addIn in addIns) {
foreach (string identity in addIn.Manifest.Identities.Keys) {
// remove the user AddIn // remove the user AddIn
targetDir = Path.Combine(ICSharpCode.Core.AddInManager.UserAddInPath, identity); string targetDir = Path.Combine(ICSharpCode.Core.AddInManager.UserAddInPath, identity);
if (Directory.Exists(targetDir)) { if (Directory.Exists(targetDir)) {
if (!addIn.Enabled) { if (!addIn.Enabled) {
try { try {

175
src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs

@ -30,7 +30,9 @@ namespace ICSharpCode.AddInManager
{ {
if (instance == null) { if (instance == null) {
instance = new ManagerForm(); instance = new ManagerForm();
#if !STANDALONE
instance.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm; instance.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm;
#endif
instance.Show(); instance.Show();
} else { } else {
instance.Activate(); instance.Activate();
@ -44,7 +46,9 @@ namespace ICSharpCode.AddInManager
// //
InitializeComponent(); InitializeComponent();
#if !STANDALONE
ICSharpCode.SharpDevelop.Gui.FormLocationHelper.Apply(this, "AddInManager.WindowBounds", true); ICSharpCode.SharpDevelop.Gui.FormLocationHelper.Apply(this, "AddInManager.WindowBounds", true);
#endif
CreateAddInList(); CreateAddInList();
} }
@ -198,6 +202,7 @@ namespace ICSharpCode.AddInManager
bool allDisabled = true; bool allDisabled = true;
bool allInstalling = true; bool allInstalling = true;
bool allUninstalling = true; bool allUninstalling = true;
bool allUpdating = true;
bool allUninstallable = true; bool allUninstallable = true;
bool hasErrors = false; bool hasErrors = false;
foreach (AddIn addIn in selected) { foreach (AddIn addIn in selected) {
@ -206,6 +211,7 @@ namespace ICSharpCode.AddInManager
hasErrors = true; hasErrors = true;
else else
allDisabled &= addIn.Action == AddInAction.Disable; allDisabled &= addIn.Action == AddInAction.Disable;
allUpdating &= addIn.Action == AddInAction.Update;
allInstalling &= addIn.Action == AddInAction.Install; allInstalling &= addIn.Action == AddInAction.Install;
allUninstalling &= addIn.Action == AddInAction.Uninstall; allUninstalling &= addIn.Action == AddInAction.Uninstall;
if (allUninstallable) { if (allUninstallable) {
@ -218,27 +224,33 @@ namespace ICSharpCode.AddInManager
selectedAction = AddInAction.Disable; selectedAction = AddInAction.Disable;
actionGroupBox.Text = runActionButton.Text = "Disable"; actionGroupBox.Text = runActionButton.Text = "Disable";
actionDescription.Text = "Disables the selected AddIns."; actionDescription.Text = "Disables the selected AddIns.";
runActionButton.Enabled = ShowDependencies(selected, false); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Disable);
uninstallButton.Enabled = allUninstallable && runActionButton.Enabled; uninstallButton.Enabled = allUninstallable && runActionButton.Enabled;
} else if (allDisabled) { } else if (allDisabled) {
selectedAction = AddInAction.Enable; selectedAction = AddInAction.Enable;
actionGroupBox.Text = runActionButton.Text = "Enable"; actionGroupBox.Text = runActionButton.Text = "Enable";
actionDescription.Text = "Enables the selected AddIns."; actionDescription.Text = "Enables the selected AddIns.";
runActionButton.Enabled = ShowDependencies(selected, true); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Enable);
if (hasErrors) if (hasErrors)
runActionButton.Enabled = false; runActionButton.Enabled = false;
uninstallButton.Enabled = allUninstallable; uninstallButton.Enabled = allUninstallable;
} else if (allInstalling) { } else if (allInstalling) {
selectedAction = AddInAction.Uninstall; selectedAction = AddInAction.Uninstall;
actionGroupBox.Text = runActionButton.Text = "Cancel installation"; actionGroupBox.Text = runActionButton.Text = "Cancel installation";
actionDescription.Text = "Cancels the installation of the selected AddIns."; actionDescription.Text = "Aborts the installation of the selected AddIns.";
runActionButton.Enabled = ShowDependencies(selected, false); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Disable);
uninstallButton.Visible = false; uninstallButton.Visible = false;
} else if (allUninstalling) { } else if (allUninstalling) {
selectedAction = AddInAction.Enable; selectedAction = AddInAction.Enable;
actionGroupBox.Text = runActionButton.Text = "Cancel deinstallation"; actionGroupBox.Text = runActionButton.Text = "Cancel deinstallation";
actionDescription.Text = "Cancels the deinstallation of the selected AddIns."; actionDescription.Text = "Aborts the deinstallation of the selected AddIns.";
runActionButton.Enabled = ShowDependencies(selected, true); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Enable);
uninstallButton.Visible = false;
} else if (allUpdating) {
selectedAction = AddInAction.InstalledTwice;
actionGroupBox.Text = runActionButton.Text = "Cancel update";
actionDescription.Text = "Aborts the update of the selected AddIns.";
runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.CancelUpdate);
uninstallButton.Visible = false; uninstallButton.Visible = false;
} else { } else {
actionGroupBox.Text = ""; actionGroupBox.Text = "";
@ -250,7 +262,13 @@ namespace ICSharpCode.AddInManager
ignoreFocusChange = false; ignoreFocusChange = false;
} }
bool ShowDependencies(IList<AddIn> addIns, bool enable) enum ShowDependencyMode {
Disable,
Enable,
CancelUpdate
}
bool ShowDependencies(IList<AddIn> addIns, ShowDependencyMode mode)
{ {
List<AddInReference> dependencies = new List<AddInReference>(); // only used with enable=true List<AddInReference> dependencies = new List<AddInReference>(); // only used with enable=true
List<KeyValuePair<AddIn, AddInReference>> dependenciesToSel = new List<KeyValuePair<AddIn, AddInReference>>(); List<KeyValuePair<AddIn, AddInReference>> dependenciesToSel = new List<KeyValuePair<AddIn, AddInReference>>();
@ -276,8 +294,11 @@ namespace ICSharpCode.AddInManager
} }
// add new addins // add new addins
if (enable) { if (mode != ShowDependencyMode.Disable) {
foreach (AddIn addIn in addIns) { foreach (AddIn addIn in addIns) {
if (mode == ShowDependencyMode.CancelUpdate && !addIn.Enabled) {
continue;
}
foreach (KeyValuePair<string, Version> pair in addIn.Manifest.Identities) { foreach (KeyValuePair<string, Version> pair in addIn.Manifest.Identities) {
addInDict[pair.Key] = pair.Value; addInDict[pair.Key] = pair.Value;
} }
@ -398,8 +419,14 @@ namespace ICSharpCode.AddInManager
List<InstallableAddIn> list = new List<InstallableAddIn>(); List<InstallableAddIn> list = new List<InstallableAddIn>();
foreach (string file in fileNames) { foreach (string file in fileNames) {
try { try {
// Same file-extension check is in Panel1DragEnter
switch (Path.GetExtension(file).ToLowerInvariant()) { switch (Path.GetExtension(file).ToLowerInvariant()) {
case ".addin": case ".addin":
if (FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, file)) {
MessageService.ShowMessage("You cannot install AddIns inside the SharpDevelop directory, " +
"they will be picked up as pre-installed AddIns automatically.");
return false;
}
list.Add(new InstallableAddIn(file, false)); list.Add(new InstallableAddIn(file, false));
break; break;
case ".sdaddin": case ".sdaddin":
@ -431,17 +458,75 @@ namespace ICSharpCode.AddInManager
uninstallButton.Visible = false; uninstallButton.Visible = false;
selectedAction = AddInAction.Install; selectedAction = AddInAction.Install;
actionGroupBox.Text = runActionButton.Text = "Install"; List<string> installAddIns = new List<string>();
List<string> updateAddIns = new List<string>();
foreach (InstallableAddIn addInPackage in addInPackages) {
string identity = addInPackage.AddIn.Manifest.PrimaryIdentity;
AddIn foundAddIn = null;
foreach (AddIn addIn in AddInTree.AddIns) {
if (addIn.Action != AddInAction.Install
&& addIn.Manifest.Identities.ContainsKey(identity))
{
foundAddIn = addIn;
break;
}
}
if (foundAddIn != null) {
updateAddIns.Add(addInPackage.AddIn.Name);
} else {
installAddIns.Add(addInPackage.AddIn.Name);
}
}
if (updateAddIns.Count == 0)
actionGroupBox.Text = runActionButton.Text = "Install";
else if (installAddIns.Count == 0)
actionGroupBox.Text = runActionButton.Text = "Update";
else
actionGroupBox.Text = runActionButton.Text = "Install + Update";
List<AddIn> addInList = new List<AddIn>(); List<AddIn> addInList = new List<AddIn>();
StringBuilder b = new StringBuilder("Install the AddIns "); StringBuilder b = new StringBuilder();
for (int i = 0; i < addInPackages.Count; i++) { if (installAddIns.Count == 1) {
if (i > 0) b.Append(", "); b.Append("Installs the AddIn " + installAddIns[0]);
addInList.Add(addInPackages[i].AddIn); } else if (installAddIns.Count > 1) {
b.Append(addInPackages[i].AddIn.Name); b.Append("Installs the AddIns " + string.Join(",", installAddIns.ToArray()));
}
if (updateAddIns.Count > 0 && installAddIns.Count > 0)
b.Append("; ");
if (updateAddIns.Count == 1) {
b.Append("Updates the AddIn " + updateAddIns[0]);
} else if (updateAddIns.Count > 1) {
b.Append("Updates the AddIns " + string.Join(",", updateAddIns.ToArray()));
} }
b.Append(".");
actionDescription.Text = b.ToString(); actionDescription.Text = b.ToString();
runActionButton.Enabled = ShowDependencies(addInList, true); runActionButton.Enabled = ShowDependencies(addInList, ShowDependencyMode.Enable);
}
void RunInstallation()
{
// install new AddIns
foreach (InstallableAddIn addInPackage in shownAddInPackages) {
string identity = addInPackage.AddIn.Manifest.PrimaryIdentity;
AddIn foundAddIn = null;
foreach (AddIn addIn in AddInTree.AddIns) {
if (addIn.Manifest.Identities.ContainsKey(identity)) {
foundAddIn = addIn;
break;
}
}
if (foundAddIn != null) {
addInPackage.Install(true);
if (foundAddIn.Action != AddInAction.Enable) {
ICSharpCode.Core.AddInManager.Enable(new AddIn[] { foundAddIn });
}
if (foundAddIn.Action != AddInAction.Install) {
foundAddIn.Action = AddInAction.Update;
}
} else {
addInPackage.Install(false);
}
}
RefreshAddInList();
} }
#endregion #endregion
@ -454,6 +539,47 @@ namespace ICSharpCode.AddInManager
} }
#endregion #endregion
#region Drag'N'Drop
void Panel1DragEnter(object sender, DragEventArgs e)
{
if (!e.Data.GetDataPresent(DataFormats.FileDrop)) {
e.Effect = DragDropEffects.None;
return;
}
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
int addInCount = 0;
int packageCount = 0;
foreach (string file in files) {
switch (Path.GetExtension(file).ToLowerInvariant()) {
case ".addin":
addInCount += 1;
break;
case ".sdaddin":
case ".zip":
packageCount += 1;
break;
default:
e.Effect = DragDropEffects.None;
return;
}
}
if (addInCount == 0 && packageCount == 0) {
e.Effect = DragDropEffects.None;
} else if (addInCount == 0) {
e.Effect = DragDropEffects.Copy;
} else {
e.Effect = DragDropEffects.Link;
}
}
void Panel1DragDrop(object sender, DragEventArgs e)
{
if (!e.Data.GetDataPresent(DataFormats.FileDrop))
return;
ShowInstallableAddIns((string[])e.Data.GetData(DataFormats.FileDrop));
}
#endregion
void CloseButtonClick(object sender, EventArgs e) void CloseButtonClick(object sender, EventArgs e)
{ {
Close(); Close();
@ -475,15 +601,17 @@ namespace ICSharpCode.AddInManager
ICSharpCode.Core.AddInManager.Enable(selected); ICSharpCode.Core.AddInManager.Enable(selected);
break; break;
case AddInAction.Install: case AddInAction.Install:
// install new AddIns RunInstallation();
foreach (InstallableAddIn addInPackage in shownAddInPackages) {
addInPackage.Install();
}
RefreshAddInList();
return; return;
case AddInAction.Uninstall: case AddInAction.Uninstall:
UninstallButtonClick(sender, e); UninstallButtonClick(sender, e);
return; return;
case AddInAction.InstalledTwice: // used to cancel installation of update
InstallableAddIn.CancelUpdate(selected);
foreach (AddIn addIn in selected) {
addIn.Action = addIn.Enabled ? AddInAction.Enable : AddInAction.Disable;
}
break;
default: default:
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -587,8 +715,11 @@ namespace ICSharpCode.AddInManager
// //
// splitContainer.Panel1 // splitContainer.Panel1
// //
this.splitContainer.Panel1.AllowDrop = true;
this.splitContainer.Panel1.AutoScroll = true; this.splitContainer.Panel1.AutoScroll = true;
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Window; this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Window;
this.splitContainer.Panel1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Panel1DragDrop);
this.splitContainer.Panel1.DragEnter += new System.Windows.Forms.DragEventHandler(this.Panel1DragEnter);
this.splitContainer.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.OnSplitContainerPanel1Paint); this.splitContainer.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.OnSplitContainerPanel1Paint);
this.splitContainer.Panel1MinSize = 100; this.splitContainer.Panel1MinSize = 100;
// //
@ -739,5 +870,7 @@ namespace ICSharpCode.AddInManager
private System.Windows.Forms.Panel bottomPanel; private System.Windows.Forms.Panel bottomPanel;
private System.Windows.Forms.Panel topPanel; private System.Windows.Forms.Panel topPanel;
#endregion #endregion
} }
} }

8
src/Libraries/NRefactory/Project/Src/Output/CodeDOM/CodeDOMOutputVisitor.cs

@ -191,6 +191,7 @@ namespace ICSharpCode.NRefactory.Parser
public override object Visit(TypeDeclaration typeDeclaration, object data) public override object Visit(TypeDeclaration typeDeclaration, object data)
{ {
TypeDeclaration oldTypeDeclaration = currentTypeDeclaration;
this.currentTypeDeclaration = typeDeclaration; this.currentTypeDeclaration = typeDeclaration;
CodeTypeDeclaration codeTypeDeclaration = new CodeTypeDeclaration(typeDeclaration.Name); CodeTypeDeclaration codeTypeDeclaration = new CodeTypeDeclaration(typeDeclaration.Name);
codeTypeDeclaration.IsClass = typeDeclaration.Type == ClassType.Class; codeTypeDeclaration.IsClass = typeDeclaration.Type == ClassType.Class;
@ -210,7 +211,12 @@ namespace ICSharpCode.NRefactory.Parser
typeDeclarations.Pop(); typeDeclarations.Pop();
((CodeNamespace)namespaceDeclarations.Peek()).Types.Add(codeTypeDeclaration); if (typeDeclarations.Count > 0) {
((CodeTypeDeclaration)typeDeclarations.Peek()).Members.Add(codeTypeDeclaration);
} else {
((CodeNamespace)namespaceDeclarations.Peek()).Types.Add(codeTypeDeclaration);
}
currentTypeDeclaration = oldTypeDeclaration;
return null; return null;
} }

16
src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs

@ -45,6 +45,22 @@ namespace ICSharpCode.Core
try { try {
if (assembly[0] == ':') { if (assembly[0] == ':') {
loadedAssembly = System.Reflection.Assembly.Load(assembly.Substring(1)); loadedAssembly = System.Reflection.Assembly.Load(assembly.Substring(1));
} else if (assembly[0] == '$') {
int pos = assembly.IndexOf('/');
if (pos < 0)
throw new ApplicationException("Expected '/' in path beginning with '$'!");
string referencedAddIn = assembly.Substring(1, pos - 1);
foreach (AddIn addIn in AddInTree.AddIns) {
if (addIn.Enabled && addIn.Manifest.Identities.ContainsKey(referencedAddIn)) {
string assemblyFile = Path.Combine(Path.GetDirectoryName(addIn.FileName),
assembly.Substring(pos + 1));
loadedAssembly = System.Reflection.Assembly.LoadFrom(assemblyFile);
break;
}
}
if (loadedAssembly == null) {
throw new FileNotFoundException("Could not find referenced AddIn " + referencedAddIn);
}
} else { } else {
loadedAssembly = System.Reflection.Assembly.LoadFrom(Path.Combine(hintPath, assembly)); loadedAssembly = System.Reflection.Assembly.LoadFrom(Path.Combine(hintPath, assembly));
} }

BIN
src/Main/StartUp/Project/Resources/BitmapResources.resources

Binary file not shown.
Loading…
Cancel
Save