Browse Source

Support embedding the .manifest in the .exe.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2697 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
e52deb9249
  1. 27
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/Help2RegistryWalker.cs
  2. 1
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  3. 21
      src/Main/Base/Project/Resources/DefaultManifest.manifest
  4. 143
      src/Main/Base/Project/Resources/ProjectOptions/ApplicationSettings.xfrm
  5. 137
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs
  6. 2
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePaths.cs
  7. 1
      src/Main/Base/Project/Src/Project/BuildEngine.cs
  8. 2
      src/Main/Base/Project/Src/TextEditor/Bookmarks/ClassMemberBookmark.cs

27
src/AddIns/Misc/HtmlHelp2/Project/src/Service/Help2RegistryWalker.cs

@ -143,25 +143,24 @@ namespace HtmlHelp2.Environment @@ -143,25 +143,24 @@ namespace HtmlHelp2.Environment
{
registryWalker = new HxRegistryWalkerClass();
help2Namespaces = registryWalker.get_RegisteredNamespaceList("");
if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0 || string.IsNullOrEmpty(matchingName))
{
return string.Empty;
}
foreach (IHxRegNamespace currentNamespace in help2Namespaces)
{
if (NativeMethods.PathMatchSpec(currentNamespace.Name, matchingName))
{
return currentNamespace.Name;
}
}
return help2Namespaces.ItemAt(1).Name;
}
catch (System.Runtime.InteropServices.COMException)
{
help2Namespaces = null;
registryWalker = null;
}
if (registryWalker == null || help2Namespaces == null || help2Namespaces.Count == 0 || string.IsNullOrEmpty(matchingName))
{
return string.Empty;
}
foreach (IHxRegNamespace currentNamespace in help2Namespaces)
{
if (NativeMethods.PathMatchSpec(currentNamespace.Name, matchingName))
{
return currentNamespace.Name;
}
}
return help2Namespaces.ItemAt(1).Name;
}
}

1
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -690,6 +690,7 @@ @@ -690,6 +690,7 @@
<Compile Include="Src\Util\GenericConverter.cs" />
<Compile Include="Src\Internal\Templates\TemplateLoadException.cs" />
<Compile Include="Src\Util\UnclosableStream.cs" />
<EmbeddedResource Include="Resources\DefaultManifest.manifest" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj">

21
src/Main/Base/Project/Resources/DefaultManifest.manifest

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!--
The presence of the "requestedExecutionLevel" node will disable
file and registry virtualization on Vista.
Use the "level" attribute to specify the User Account Control level:
asInvoker = Never prompt for elevation
requireAdministrator = Always prompt for elevation
highestAvailable = Prompt for elevation when started by administrator,
but do not prompt for administrator password when started by
standard user.
-->
<requestedExecutionLevel level="asInvoker"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

143
src/Main/Base/Project/Resources/ProjectOptions/ApplicationSettings.xfrm

@ -1,186 +1,197 @@ @@ -1,186 +1,197 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="XmlUserControl1" />
<ClientSize value="{Width=456, Height=364}" />
<ClientSize value="{Width=456, Height=381}" />
<Controls>
<System.Windows.Forms.ComboBox>
<Name value="applicationManifestComboBox" />
<TabIndex value="12" />
<Location value="173, 166" />
<Size value="275, 21" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="label10" />
<Location value="41, 166" />
<Text value="Application &amp;manifest:" />
<Size value="126, 20" />
<TextAlign value="MiddleRight" />
<TabIndex value="11" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="win32ResourceFileBrowseButton" />
<Location value="{X=408,Y=208}" />
<Location value="408, 221" />
<Text value="..." />
<Size value="{Width=40, Height=21}" />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="14" />
<TabIndex value="16" />
</System.Windows.Forms.Button>
<System.Windows.Forms.ComboBox>
<Name value="win32ResourceFileComboBox" />
<TabIndex value="13" />
<System.Windows.Forms.TextBox>
<Name value="win32ResourceFileTextBox" />
<TabIndex value="15" />
<Location value="8, 221" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=392, Height=21}" />
<FormattingEnabled value="True" />
<Location value="{X=8,Y=208}" />
</System.Windows.Forms.ComboBox>
<Size value="392, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label9" />
<Location value="{X=8,Y=192}" />
<Location value="8, 205" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.Win32Resource}" />
<Size value="436, 16" />
<TextAlign value="BottomLeft" />
<Size value="{Width=436, Height=16}" />
<TabIndex value="12" />
<Anchor value="Top, Left, Right" />
<TabIndex value="14" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="applicationIconBrowseButton" />
<Location value="{X=408,Y=160}" />
<Location value="408, 139" />
<Text value="..." />
<Size value="{Width=40, Height=21}" />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="11" />
<TabIndex value="10" />
</System.Windows.Forms.Button>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Location value="{X=8,Y=236}" />
<Location value="8, 248" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.ProjectInformation}" />
<Size value="{Width=440, Height=112}" />
<TabIndex value="15" />
<Size value="440, 112" />
<Anchor value="Top, Left, Right" />
<TabIndex value="17" />
<Controls>
<System.Windows.Forms.TextBox>
<Name value="outputNameTextBox" />
<TabIndex value="5" />
<Location value="112, 80" />
<Anchor value="Top, Left, Right" />
<ReadOnly value="True" />
<Size value="{Width=320, Height=21}" />
<Location value="{X=112,Y=80}" />
<Size value="320, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label8" />
<Location value="{X=8,Y=80}" />
<Location value="8, 80" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.OutputName}" />
<Size value="100, 23" />
<TextAlign value="MiddleRight" />
<Size value="{Width=100, Height=23}" />
<TabIndex value="4" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="projectFileTextBox" />
<TabIndex value="3" />
<Location value="112, 56" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=320, Height=21}" />
<Location value="{X=112,Y=56}" />
<Size value="320, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label7" />
<Location value="{X=8,Y=52}" />
<Location value="8, 52" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.ProjectFile}" />
<Size value="100, 23" />
<TextAlign value="MiddleRight" />
<Size value="{Width=100, Height=23}" />
<TabIndex value="2" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="projectFolderTextBox" />
<TabIndex value="1" />
<Location value="112, 28" />
<Anchor value="Top, Left, Right" />
<ReadOnly value="True" />
<Size value="{Width=320, Height=21}" />
<Location value="{X=112,Y=28}" />
<Size value="320, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label6" />
<Location value="{X=8,Y=24}" />
<Location value="8, 24" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.ProjectFolder}" />
<Size value="100, 23" />
<TextAlign value="MiddleRight" />
<Size value="{Width=100, Height=23}" />
<TabIndex value="0" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.PictureBox>
<Name value="applicationIconPictureBox" />
<Location value="{X=8,Y=140}" />
<Size value="{Width=48, Height=48}" />
<Location value="3, 141" />
<Size value="32, 32" />
<SizeMode value="StretchImage" />
</System.Windows.Forms.PictureBox>
<System.Windows.Forms.ComboBox>
<Name value="applicationIconComboBox" />
<TabIndex value="10" />
<System.Windows.Forms.TextBox>
<Name value="applicationIconTextBox" />
<TabIndex value="9" />
<Location value="173, 140" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=336, Height=21}" />
<FormattingEnabled value="True" />
<Location value="{X=64,Y=160}" />
</System.Windows.Forms.ComboBox>
<Size value="227, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label5" />
<Location value="{X=64,Y=144}" />
<Location value="41, 141" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.ApplicationIcon}" />
<TextAlign value="BottomLeft" />
<Size value="{Width=384, Height=16}" />
<TabIndex value="9" />
<Anchor value="Top, Left, Right" />
<Size value="126, 16" />
<TextAlign value="BottomRight" />
<TabIndex value="8" />
</System.Windows.Forms.Label>
<System.Windows.Forms.ComboBox>
<Name value="startupObjectComboBox" />
<TabIndex value="7" />
<Location value="173, 112" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=275, Height=21}" />
<Size value="275, 21" />
<FormattingEnabled value="True" />
<Location value="{X=173,Y=112}" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="label4" />
<Location value="{X=173,Y=96}" />
<Location value="173, 96" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.StartupObject}" />
<Size value="275, 16" />
<TextAlign value="BottomLeft" />
<Size value="{Width=275, Height=16}" />
<TabIndex value="6" />
<Anchor value="Top, Left, Right" />
<TabIndex value="6" />
</System.Windows.Forms.Label>
<System.Windows.Forms.ComboBox>
<Name value="outputTypeComboBox" />
<TabIndex value="5" />
<Size value="{Width=159, Height=21}" />
<Location value="8, 112" />
<Size value="159, 21" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
<Location value="{X=8,Y=112}" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="label3" />
<Location value="{X=8,Y=96}" />
<Location value="8, 96" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.OutputType}" />
<Size value="159, 16" />
<TextAlign value="BottomLeft" />
<Size value="{Width=159, Height=16}" />
<TabIndex value="4" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="rootNamespaceTextBox" />
<TabIndex value="3" />
<Location value="8, 68" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=440, Height=21}" />
<Location value="{X=8,Y=68}" />
<Size value="440, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label2" />
<Location value="{X=8,Y=52}" />
<Location value="8, 52" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.RootNamespace}" />
<Size value="440, 16" />
<TextAlign value="BottomLeft" />
<Size value="{Width=440, Height=16}" />
<TabIndex value="2" />
<Anchor value="Top, Left, Right" />
<TabIndex value="2" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="assemblyNameTextBox" />
<TabIndex value="1" />
<Location value="8, 24" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=440, Height=21}" />
<Location value="{X=8,Y=24}" />
<Size value="440, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label1" />
<Location value="{X=8,Y=8}" />
<Location value="8, 8" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.AssemblyName}" />
<Size value="440, 16" />
<TextAlign value="BottomLeft" />
<Size value="{Width=440, Height=16}" />
<TabIndex value="0" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.UserControl>
</Components>
</Components>

137
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs

@ -19,19 +19,20 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -19,19 +19,20 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
public class ApplicationSettings : AbstractProjectOptionPanel
{
ComboBox applicationManifestComboBox;
public override void LoadPanelContents()
{
SetupFromXmlResource("ProjectOptions.ApplicationSettings.xfrm");
InitializeHelper();
ConnectBrowseButton("applicationIconBrowseButton", "applicationIconComboBox",
ConnectBrowseButton("applicationIconBrowseButton", "applicationIconTextBox",
"${res:SharpDevelop.FileFilter.Icons}|*.ico|${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditEvaluatedProperty);
// TODO: Suitable file filter.
ConnectBrowseButton("win32ResourceFileBrowseButton", "win32ResourceFileComboBox",
"${res:SharpDevelop.FileFilter.AllFiles}|*.*",
ConnectBrowseButton("win32ResourceFileBrowseButton", "win32ResourceFileTextBox",
"Win32 Resource files|*.res|${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditEvaluatedProperty);
ConfigurationGuiBinding b;
@ -45,7 +46,8 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -45,7 +46,8 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
b = helper.BindEnum<OutputType>("outputTypeComboBox", "OutputType");
locationButton = b.CreateLocationButton("outputTypeComboBox");
Get<ComboBox>("outputType").SelectedIndexChanged += new EventHandler(RefreshOutputNameTextBox);
Get<ComboBox>("outputType").SelectedIndexChanged += RefreshOutputNameTextBox;
Get<ComboBox>("outputType").SelectedIndexChanged += RefreshStartupObjectEnabled;
b = helper.BindString("startupObjectComboBox", "StartupObject", TextBoxEditMode.EditEvaluatedProperty);
b.RegisterLocationButton(locationButton);
@ -53,12 +55,27 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -53,12 +55,27 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
Get<ComboBox>("startupObject").Items.Add(c.FullyQualifiedName);
}
b = helper.BindString("applicationIconComboBox", "ApplicationIcon", TextBoxEditMode.EditEvaluatedProperty);
Get<ComboBox>("applicationIcon").TextChanged += new EventHandler(ApplicationIconComboBoxTextChanged);
b.CreateLocationButton("applicationIconComboBox");
b = helper.BindString("applicationIconTextBox", "ApplicationIcon", TextBoxEditMode.EditEvaluatedProperty);
Get<TextBox>("applicationIcon").TextChanged += new EventHandler(ApplicationIconTextBoxTextChanged);
b.CreateLocationButton("applicationIconTextBox");
b = helper.BindString("win32ResourceFileTextBox", "Win32Resource", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("win32ResourceFileTextBox");
applicationManifestComboBox = Get<ComboBox>("applicationManifest");
applicationManifestComboBox.Items.Add("Embed default manifest");
applicationManifestComboBox.Items.Add("Do not embed manifest");
foreach (string fileName in Directory.GetFiles(project.Directory, "*.manifest")) {
applicationManifestComboBox.Items.Add(Path.GetFileName(fileName));
}
applicationManifestComboBox.Items.Add(StringParser.Parse("<${res:Global.CreateButtonText}...>"));
applicationManifestComboBox.Items.Add(StringParser.Parse("<${res:Global.BrowseText}...>"));
applicationManifestComboBox.SelectedIndexChanged += ApplicationManifestComboBox_SelectedIndexChanged;
b = helper.BindString("win32ResourceFileComboBox", "Win32Resource", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("win32ResourceFileComboBox");
b = new ManifestBinding(applicationManifestComboBox);
helper.AddBinding("ApplicationManifest", b);
b.CreateLocationButton(applicationManifestComboBox);
applicationManifestComboBox.TextChanged += delegate { helper.IsDirty = true; };
Get<TextBox>("projectFolder").Text = project.Directory;
Get<TextBox>("projectFile").Text = Path.GetFileName(project.FileName);
@ -66,11 +83,99 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -66,11 +83,99 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
// maybe make this writable again? Needs special care when saving!
Get<TextBox>("projectFile").ReadOnly = true;
RefreshStartupObjectEnabled(null, EventArgs.Empty);
RefreshOutputNameTextBox(null, EventArgs.Empty);
helper.AddConfigurationSelector(this);
}
void ApplicationManifestComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (applicationManifestComboBox.SelectedIndex == applicationManifestComboBox.Items.Count - 2) {
BeginInvoke(new MethodInvoker(CreateManifest));
} else if (applicationManifestComboBox.SelectedIndex == applicationManifestComboBox.Items.Count - 1) {
BeginInvoke(new MethodInvoker(BrowseForManifest));
}
}
void BrowseForManifest()
{
applicationManifestComboBox.SelectedIndex = -1;
BrowseForFile(applicationManifestComboBox, "Manifest files|*.manifest|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty);
}
void CreateManifest()
{
string manifestFile = Path.Combine(project.Directory, "app.manifest");
if (!File.Exists(manifestFile)) {
string defaultManifest;
using (Stream stream = typeof(ApplicationSettings).Assembly.GetManifestResourceStream("Resources.DefaultManifest.manifest")) {
if (stream == null)
throw new ResourceNotFoundException("DefaultManifest.manifest");
using (StreamReader r = new StreamReader(stream)) {
defaultManifest = r.ReadToEnd();
}
}
defaultManifest = defaultManifest.Replace("\t", DefaultEditor.Gui.Editor.SharpDevelopTextEditorProperties.Instance.IndentationString);
File.WriteAllText(manifestFile, defaultManifest, System.Text.Encoding.UTF8);
FileService.FireFileCreated(manifestFile);
}
if (!project.IsFileInProject(manifestFile)) {
FileProjectItem newItem = new FileProjectItem(project, ItemType.None);
newItem.Include = "app.manifest";
ProjectService.AddProjectItem(project, newItem);
ProjectBrowserPad.Instance.ProjectBrowserControl.RefreshView();
}
FileService.OpenFile(manifestFile);
applicationManifestComboBox.Text = "app.manifest";
}
sealed class ManifestBinding : ConfigurationGuiBinding
{
ComboBox applicationManifestComboBox;
public ManifestBinding(ComboBox applicationManifestComboBox)
{
this.applicationManifestComboBox = applicationManifestComboBox;
}
public override void Load()
{
string manifestFileName = Get("");
if (string.IsNullOrEmpty(manifestFileName)) {
if (Helper.GetProperty("NoWin32Manifest", false, true)) {
// no manifest
applicationManifestComboBox.SelectedIndex = 1;
} else {
// default manifest
applicationManifestComboBox.SelectedIndex = 0;
}
} else {
applicationManifestComboBox.Text = manifestFileName;
}
}
public override bool Save()
{
if (applicationManifestComboBox.SelectedIndex == 0) {
// Embed default manifest
Set("");
Helper.SetProperty("NoWin32Manifest", "", true, this.Location);
} else if (applicationManifestComboBox.SelectedIndex == 1) {
// No manifest
Set("");
Helper.SetProperty("NoWin32Manifest", true, true, this.Location);
} else {
Set(applicationManifestComboBox.Text);
Helper.SetProperty("NoWin32Manifest", "", true, this.Location);
}
return true;
}
}
public static IList<IClass> GetPossibleStartupObjects(IProject project)
{
List<IClass> results = new List<IClass>();
@ -87,16 +192,22 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -87,16 +192,22 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
return results;
}
void RefreshStartupObjectEnabled(object sender, EventArgs e)
{
bool isLibrary = OutputType.Library == (OutputType)Get<ComboBox>("outputType").SelectedIndex;
ControlDictionary["startupObjectComboBox"].Enabled = !isLibrary;
}
void RefreshOutputNameTextBox(object sender, EventArgs e)
{
Get<TextBox>("outputName").Text = Get<TextBox>("assemblyName").Text + CompilableProject.GetExtension((OutputType)Get<ComboBox>("outputType").SelectedIndex);
}
void ApplicationIconComboBoxTextChanged(object sender, EventArgs e)
void ApplicationIconTextBoxTextChanged(object sender, EventArgs e)
{
if(FileUtility.IsValidPath(Get<ComboBox>("applicationIcon").Text))
if(FileUtility.IsValidPath(Get<TextBox>("applicationIcon").Text))
{
string applicationIcon = Path.Combine(baseDirectory, Get<ComboBox>("applicationIcon").Text);
string applicationIcon = Path.Combine(baseDirectory, Get<TextBox>("applicationIcon").Text);
if (File.Exists(applicationIcon)) {
try {
Get<PictureBox>("applicationIcon").Image = Image.FromFile(applicationIcon);

2
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePaths.cs

@ -31,7 +31,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -31,7 +31,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
helper.AddConfigurationSelector(this);
}
public class SemicolonSeparatedStringListBinding : ConfigurationGuiBinding
sealed class SemicolonSeparatedStringListBinding : ConfigurationGuiBinding
{
StringListEditor editor;

1
src/Main/Base/Project/Src/Project/BuildEngine.cs

@ -30,6 +30,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -30,6 +30,7 @@ namespace ICSharpCode.SharpDevelop.Project
results.Result = BuildResultCode.MSBuildAlreadyRunning;
options.Callback(results);
} else {
guiBuildRunning = true;
Gui.WorkbenchSingleton.Workbench.GetPad(typeof(Gui.CompilerMessageView)).BringPadToFront();
StartBuild(project, options, new MessageViewSink(TaskService.BuildMessageViewCategory));
}

2
src/Main/Base/Project/Src/TextEditor/Bookmarks/ClassMemberBookmark.cs

@ -32,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -32,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
}
public ClassMemberBookmark(IDocument document, IMember member)
: base(document, member.Region.BeginLine - 1)
: base(document, Math.Min(document.TotalNumberOfLines - 1, member.Region.BeginLine - 1))
{
this.member = member;
}

Loading…
Cancel
Save