Browse Source

Add WPF startpage.

Fixed XmlEditor unit tests (Form.Show(owner) throws an exception when called in a non-interactive windows service, but Form.Show() works)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3490 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
2110f0ca43
  1. 2
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 0
      data/resources/image/BitmapResources/StartPageLayout/blue/balken_links.gif
  3. 0
      data/resources/image/BitmapResources/StartPageLayout/blue/balken_mitte.gif
  4. 0
      data/resources/image/BitmapResources/StartPageLayout/blue/balken_rechts.gif
  5. 0
      data/resources/image/BitmapResources/StartPageLayout/brown/balken_links.gif
  6. 0
      data/resources/image/BitmapResources/StartPageLayout/brown/balken_mitte.gif
  7. 0
      data/resources/image/BitmapResources/StartPageLayout/brown/balken_rechts.gif
  8. 0
      data/resources/image/BitmapResources/StartPageLayout/common/blind.gif
  9. 0
      data/resources/image/BitmapResources/StartPageLayout/common/dot_listing.gif
  10. 0
      data/resources/image/BitmapResources/StartPageLayout/common/klinker_milestone.gif
  11. 0
      data/resources/image/BitmapResources/StartPageLayout/common/line_hor_black.gif
  12. 0
      data/resources/image/BitmapResources/StartPageLayout/common/milestone_col_head.gif
  13. 0
      data/resources/image/BitmapResources/StartPageLayout/common/pixel_weiss.gif
  14. 0
      data/resources/image/BitmapResources/StartPageLayout/default.css
  15. 0
      data/resources/image/BitmapResources/StartPageLayout/green/balken_links.gif
  16. 0
      data/resources/image/BitmapResources/StartPageLayout/green/balken_mitte.gif
  17. 0
      data/resources/image/BitmapResources/StartPageLayout/green/balken_rechts.gif
  18. 0
      data/resources/image/BitmapResources/StartPageLayout/orange/balken_links.gif
  19. 0
      data/resources/image/BitmapResources/StartPageLayout/orange/balken_mitte.gif
  20. 0
      data/resources/image/BitmapResources/StartPageLayout/orange/balken_rechts.gif
  21. 0
      data/resources/image/BitmapResources/StartPageLayout/red/balken_links.gif
  22. 0
      data/resources/image/BitmapResources/StartPageLayout/red/balken_mitte.gif
  23. 0
      data/resources/image/BitmapResources/StartPageLayout/red/balken_rechts.gif
  24. 5
      src/AddIns/DisplayBindings/XmlEditor/Test/Completion/FirstCompletionListItemSelectedTestFixture.cs
  25. BIN
      src/AddIns/Misc/StartPage/Project/Resources/balken_links.gif
  26. BIN
      src/AddIns/Misc/StartPage/Project/Resources/balken_mitte.gif
  27. BIN
      src/AddIns/Misc/StartPage/Project/Resources/balken_rechts.gif
  28. 671
      src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs
  29. 52
      src/AddIns/Misc/StartPage/Project/Src/Main.cs
  30. 41
      src/AddIns/Misc/StartPage/Project/Src/ShowStartPageCommand.cs
  31. 88
      src/AddIns/Misc/StartPage/Project/Src/StartPage.cs
  32. 69
      src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml
  33. 73
      src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml.cs
  34. 29
      src/AddIns/Misc/StartPage/Project/Src/StartPageViewContent.cs
  35. 28
      src/AddIns/Misc/StartPage/Project/StartPage.csproj
  36. 7
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs
  37. 7
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs
  38. 18
      src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs
  39. 11
      src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml
  40. 52
      src/Setup/Files.wxs
  41. 7
      src/Setup/Setup.wxs

2
AddIns/ICSharpCode.SharpDevelop.addin

@ -1664,7 +1664,7 @@ @@ -1664,7 +1664,7 @@
<MenuItem id = "GotDotNet" label = "GotDotNet" icon = "Icons.16x16.WebSearchIcon" link = "http://www.gotdotnet.com/" />
</MenuItem>
<MenuItem id = "IntegratedProjects" label = "Integrated Projects" type="Menu">
<MenuItem id = "DockManager Control" label = "DockPanel Suite" icon = "Icons.16x16.WebSearchIcon" link = "http://sourceforge.net/projects/dockpanelsuite/" />
<MenuItem id = "AvalonDock" label = "AvalonDock" icon = "Icons.16x16.WebSearchIcon" link = "http://www.codeplex.com/AvalonDock/" />
<MenuItem id = "NUnit" label = "NUnit" icon = "PadIcons.NUnitTest" link = "http://www.nunit.org/" />
<MenuItem id = "WiX" label = "WiX" icon = "Icons.16x16.WebSearchIcon" link = "http://sourceforge.net/projects/wix/" />
<MenuItem id = "SHFB" label = "Sandcastle Help File Builder" icon = "Icons.16x16.WebSearchIcon" link = "http://www.codeplex.com/SHFB" />

0
data/resources/startpage/Layout/blue/balken_links.gif → data/resources/image/BitmapResources/StartPageLayout/blue/balken_links.gif

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

0
data/resources/startpage/Layout/blue/balken_mitte.gif → data/resources/image/BitmapResources/StartPageLayout/blue/balken_mitte.gif

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

0
data/resources/startpage/Layout/blue/balken_rechts.gif → data/resources/image/BitmapResources/StartPageLayout/blue/balken_rechts.gif

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

0
data/resources/startpage/Layout/brown/balken_links.gif → data/resources/image/BitmapResources/StartPageLayout/brown/balken_links.gif

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

0
data/resources/startpage/Layout/brown/balken_mitte.gif → data/resources/image/BitmapResources/StartPageLayout/brown/balken_mitte.gif

Before

Width:  |  Height:  |  Size: 193 B

After

Width:  |  Height:  |  Size: 193 B

0
data/resources/startpage/Layout/brown/balken_rechts.gif → data/resources/image/BitmapResources/StartPageLayout/brown/balken_rechts.gif

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

0
data/resources/startpage/Layout/common/blind.gif → data/resources/image/BitmapResources/StartPageLayout/common/blind.gif

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

0
data/resources/startpage/Layout/common/dot_listing.gif → data/resources/image/BitmapResources/StartPageLayout/common/dot_listing.gif

Before

Width:  |  Height:  |  Size: 67 B

After

Width:  |  Height:  |  Size: 67 B

0
data/resources/startpage/Layout/common/klinker_milestone.gif → data/resources/image/BitmapResources/StartPageLayout/common/klinker_milestone.gif

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

0
data/resources/startpage/Layout/common/line_hor_black.gif → data/resources/image/BitmapResources/StartPageLayout/common/line_hor_black.gif

Before

Width:  |  Height:  |  Size: 44 B

After

Width:  |  Height:  |  Size: 44 B

0
data/resources/startpage/Layout/common/milestone_col_head.gif → data/resources/image/BitmapResources/StartPageLayout/common/milestone_col_head.gif

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

0
data/resources/startpage/Layout/common/pixel_weiss.gif → data/resources/image/BitmapResources/StartPageLayout/common/pixel_weiss.gif

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

0
data/resources/startpage/Layout/default.css → data/resources/image/BitmapResources/StartPageLayout/default.css

0
data/resources/startpage/Layout/green/balken_links.gif → data/resources/image/BitmapResources/StartPageLayout/green/balken_links.gif

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

0
data/resources/startpage/Layout/green/balken_mitte.gif → data/resources/image/BitmapResources/StartPageLayout/green/balken_mitte.gif

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

0
data/resources/startpage/Layout/green/balken_rechts.gif → data/resources/image/BitmapResources/StartPageLayout/green/balken_rechts.gif

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

0
data/resources/startpage/Layout/orange/balken_links.gif → data/resources/image/BitmapResources/StartPageLayout/orange/balken_links.gif

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

0
data/resources/startpage/Layout/orange/balken_mitte.gif → data/resources/image/BitmapResources/StartPageLayout/orange/balken_mitte.gif

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 352 B

0
data/resources/startpage/Layout/orange/balken_rechts.gif → data/resources/image/BitmapResources/StartPageLayout/orange/balken_rechts.gif

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
data/resources/startpage/Layout/red/balken_links.gif → data/resources/image/BitmapResources/StartPageLayout/red/balken_links.gif

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

0
data/resources/startpage/Layout/red/balken_mitte.gif → data/resources/image/BitmapResources/StartPageLayout/red/balken_mitte.gif

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

0
data/resources/startpage/Layout/red/balken_rechts.gif → data/resources/image/BitmapResources/StartPageLayout/red/balken_rechts.gif

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

5
src/AddIns/DisplayBindings/XmlEditor/Test/Completion/FirstCompletionListItemSelectedTestFixture.cs

@ -33,16 +33,13 @@ namespace XmlEditor.Tests.Completion @@ -33,16 +33,13 @@ namespace XmlEditor.Tests.Completion
[TestFixtureSetUp]
public void SetUpFixture()
{
Form parentForm = new Form();
parentForm.CreateControl();
XmlSchemaCompletionData schema = new XmlSchemaCompletionData(ResourceManager.GetXhtmlStrictSchema());
XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();
schemas.Add(schema);
provider = new XmlCompletionDataProvider(schemas, schema, String.Empty);
TextEditorControl textEditor = new TextEditorControl();
completionDataItems = provider.GenerateCompletionData(@"C:\Test.xml", textEditor.ActiveTextAreaControl.TextArea, '<');
using (CodeCompletionWindow completionWindow = CodeCompletionWindow.ShowCompletionWindow(parentForm, textEditor, @"C:\Test.xml", provider, '<')) {
using (CodeCompletionWindow completionWindow = CodeCompletionWindow.ShowCompletionWindow(null, textEditor, @"C:\Test.xml", provider, '<')) {
CodeCompletionListView listView = (CodeCompletionListView)completionWindow.Controls[0];
selectedCompletionData = listView.SelectedCompletionData;
completionWindow.Close();

BIN
src/AddIns/Misc/StartPage/Project/Resources/balken_links.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/AddIns/Misc/StartPage/Project/Resources/balken_mitte.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

BIN
src/AddIns/Misc/StartPage/Project/Resources/balken_rechts.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

671
src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs

@ -1,671 +0,0 @@ @@ -1,671 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Xsl;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
namespace ICSharpCode.StartPage
{
public enum ColorScheme
{
blue,
red,
green,
brown,
orange
}
public class MenuItem
{
public string Caption, URL;
public MenuItem(string strCaption, string strUrl)
{
Caption = strCaption;
URL = strUrl;
}
}
public class ICSharpCodePage
{
ColorScheme _ColorScheme;
string startPageLocation;
string m_strMainColColor, m_strSubColColor;
int m_nLeftTopImageWidth, m_nRightTopImageWidth;
bool m_bShowMilestoneContentImage;
private int nTotalColumns = 0;
string m_strTitle, m_strMetaDescription, m_strMetaKeywords, m_strMetaAuthor, m_strMetaCopyright;
string m_strStaticStyleSheet, m_strRightBoxHtml;
bool m_bShowLeftMenu, m_bShowRightBox, m_bShowContentBar;
string m_strContentBarText, m_strTopMenuSelectedItem, m_strLeftMenuSelectedItem;
string m_strVersionText, m_strVersionStatus;
public string PrimaryColor
{
get { return m_strMainColColor; }
}
public string SecondaryColor
{
get { return m_strSubColColor; }
}
public string Title
{
get { return m_strTitle; }
set { m_strTitle = value; }
}
public bool ShowMilestoneContentImage
{
get { return m_bShowMilestoneContentImage; }
set { m_bShowMilestoneContentImage = value; }
}
public string MetaDescription
{
get { return m_strMetaDescription; }
set { m_strMetaDescription = value; }
}
public string MetaKeywords
{
get { return m_strMetaKeywords; }
set { m_strMetaKeywords = value; }
}
public string MetaAuthor
{
get { return m_strMetaAuthor; }
set { m_strMetaAuthor = value; }
}
public string MetaCopyright
{
get { return m_strMetaCopyright; }
set { m_strMetaCopyright = value; }
}
public string StaticStyleSheet
{
get { return m_strStaticStyleSheet; }
set { m_strStaticStyleSheet = value; }
}
public string ContentBarText
{
get { return m_strContentBarText; }
set { m_strContentBarText = value; }
}
public bool ShowLeftMenu
{
get { return m_bShowLeftMenu; }
set { m_bShowLeftMenu = value; }
}
public bool ShowRightBox
{
get { return m_bShowRightBox; }
set { m_bShowRightBox = value; }
}
public bool ShowContentBar
{
get { return m_bShowContentBar; }
set { m_bShowContentBar = value; }
}
private List<MenuItem> TopMenu;
private List<MenuItem> LeftMenu;
public virtual void PopulateTopMenu()
{
TopMenu.Add(new MenuItem(StringParser.Parse("${res:StartPage.StartMenu.Name}"), "startpage://Start"));
TopMenu.Add(new MenuItem(StringParser.Parse("${res:StartPage.ChangeLogMenu.Name}"), "startpage://ChangeLog"));
TopMenu.Add(new MenuItem(StringParser.Parse("${res:StartPage.AuthorsMenu.Name}"), "startpage://Authors"));
TopMenu.Add(new MenuItem(StringParser.Parse("${res:StartPage.HelpWantedMenu.Name}"), "startpage://HelpWanted"));
}
public virtual void PopulateLeftMenu()
{
}
public string TopMenuSelectedItem
{
get { return m_strTopMenuSelectedItem; }
set { m_strTopMenuSelectedItem = value; }
}
public string LeftMenuSelectedItem
{
get { return m_strLeftMenuSelectedItem; }
set { m_strLeftMenuSelectedItem = value; }
}
public string VersionText
{
get { return m_strVersionText; }
set { m_strVersionText = value; }
}
public string VersionStatus
{
get { return m_strVersionStatus; }
set { m_strVersionStatus = value; }
}
public string RightBoxHtml
{
get { return m_strRightBoxHtml; }
set { m_strRightBoxHtml = value; }
}
public virtual void RenderRightBoxHtml(StringBuilder builder)
{
builder.Append(m_strRightBoxHtml);
}
public ICSharpCodePage()
{
ColorScheme = ICSharpCode.StartPage.ColorScheme.blue;
TopMenu = new List<MenuItem>();
PopulateTopMenu();
TopMenuSelectedItem = "Home";
LeftMenu = new List<MenuItem>();
PopulateLeftMenu();
LeftMenuSelectedItem = "";
VersionText = "version " + RevisionClass.FullVersion;
VersionStatus = "";
RightBoxHtml = "";
StaticStyleSheet = startPageLocation + "/Layout/default.css";
MetaAuthor = "Christoph Wille - christophw@alphasierrapapa.com";
MetaCopyright = "(c) 2001-2008 AlphaSierraPapa";
ShowLeftMenu = false;
ShowRightBox = false;
ShowContentBar = true;
}
public ColorScheme ColorScheme
{
get { return _ColorScheme; }
set
{
_ColorScheme = value;
m_bShowMilestoneContentImage = false;
switch (_ColorScheme)
{
case ColorScheme.blue:
m_nLeftTopImageWidth = 292;//412;
m_nRightTopImageWidth = 363;
m_strSubColColor = "#C2E0FB";
m_strMainColColor = "#A8C6E3";
m_bShowMilestoneContentImage = true;
break;
case ColorScheme.red:
m_nLeftTopImageWidth = 214;//334;
m_nRightTopImageWidth = 438;
m_strSubColColor = "#a7a9ac";
m_strMainColColor = "#d7797d";
break;
case ColorScheme.brown:
m_nLeftTopImageWidth = 294;//415;
m_nRightTopImageWidth = 359;
m_strSubColColor = "#EEE9E2";
m_strMainColColor = "#D5D0C9";
break;
case ColorScheme.green:
m_nLeftTopImageWidth = 259;//450;
m_nRightTopImageWidth = 325;
m_strSubColColor = "#E7EDBB";
m_strMainColColor = "#CED4A2";
break;
case ColorScheme.orange:
m_nLeftTopImageWidth = 191;//311;
m_nRightTopImageWidth = 460;
m_strSubColColor = "#F4D97B";
m_strMainColColor = "#E7CD6F";
break;
}
}
}
public virtual void RenderHeaderSection(StringBuilder builder)
{
//if (RightToLeftConverter.IsRightToLeft) {
// builder.Append("<html dir=\"rtl\"><head><title>");
//} else {
builder.Append("<html><head><title>");
//}
builder.Append(Title);
builder.Append("</title>\r\n");
builder.Append("<link rel='stylesheet' type='text/css' href='");
builder.Append(PropertyService.DataDirectory + Path.DirectorySeparatorChar +
"resources" + Path.DirectorySeparatorChar +
"startpage" + Path.DirectorySeparatorChar +
"Layout" + Path.DirectorySeparatorChar +
"default.css");
builder.Append("'>\r\n");
builder.Append("<META HTTP-EQUIV=\"content-type: text/html; charset= ISO-8859-1\">\r\n");
builder.Append("<META NAME=\"robots\" CONTENT=\"FOLLOW,INDEX\">\r\n");
builder.Append("<meta name=\"Author\" content=\"");
builder.Append(MetaAuthor);
builder.Append("\">\r\n<META NAME=\"copyright\" CONTENT=\"");
builder.Append(MetaCopyright);
builder.Append("\">\r\n<meta http-equiv=\"Description\" name=\"Description\" content=\"");
builder.Append(MetaDescription);
builder.Append("\">\r\n<meta http-equiv=\"Keywords\" name=\"Keywords\" content=\"");
builder.Append(MetaKeywords);
builder.Append("\">\r\n<link rel=\"stylesheet\" href=\"");
builder.Append(StaticStyleSheet);
builder.Append("\">\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n");
}
public virtual void RenderPageEndSection(StringBuilder builder)
{
builder.Append("</body>\r\n</html>\r\n");
}
public virtual void RenderPageTopSection(StringBuilder builder)
{
builder.Append("<div class=\"balken\" style=\"position:absolute;left:0px;top:0px\">");
builder.Append("<table border=0 cellspacing=0 cellpadding=0><TR>\r\n");
builder.Append("<td height=72 background=\""+ startPageLocation +"/Layout/");
builder.Append(Enum.GetName(typeof(ColorScheme), _ColorScheme));
builder.Append("/balken_links.gif\"><img src=\"" + startPageLocation + "/Layout/Common/blind.gif\" width=");
builder.Append(m_nLeftTopImageWidth.ToString());
builder.Append(" height=1></td>\r\n");
builder.Append("<td width=\"100%\" background=\""+ startPageLocation + "/Layout/");
builder.Append(Enum.GetName(typeof(ColorScheme), _ColorScheme));
builder.Append("/balken_mitte.gif\">&nbsp;</td>\r\n");
builder.Append("<td background=\""+ startPageLocation + "/Layout/");
builder.Append(Enum.GetName(typeof(ColorScheme), _ColorScheme));
builder.Append("/balken_rechts.gif\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=");
builder.Append(m_nRightTopImageWidth.ToString());
builder.Append(" height=1></td>\r\n</TR></table>\r\n");
builder.Append("<table border=0 cellspacing=0 cellpadding=0><tr>");
builder.Append("<td width=\"100%\" height=24 align=left bgcolor=\"#DCDDDE\">");
builder.Append("<table border=0 cellspacing=0 cellpadding=0 width=\"100%\"><tr>\r\n");
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=1></td>\r\n");
int nTopMenuElements = TopMenu.Count;
foreach (MenuItem de in TopMenu)
{
--nTopMenuElements;
builder.Append("<td class=\"navi");
if (0 == String.Compare(de.Caption, m_strTopMenuSelectedItem, true))
{
builder.Append("Activ\">");
builder.Append(de.Caption);
builder.Append("</td>\r\n");
}
else
{
builder.Append("\"><a href=\"");
builder.Append(de.URL);
builder.Append("\">");
builder.Append(de.Caption);
builder.Append("</a></td>\r\n");
}
if (0 != nTopMenuElements)
{
builder.Append("<td width=13><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=5 height=1><img src=\""+ startPageLocation + "/Layout/Common/line_hor_black.gif\" width=1 height=15><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=5 height=1></td>\r\n");
}
}
builder.Append("</tr></table></td></tr></table></DIV>\r\n");
}
public virtual void RenderLeftMenu(StringBuilder builder)
{
builder.Append("<td bgcolor=\"White\" valign=\"top\"><table border=0 cellspacing=0 cellpadding=0>");
builder.Append("<tr><td width=20 heigth=10><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=20 height=10></td>");
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td>");
builder.Append("</tr><tr><td colspan=2><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=4></td></tr>");
int nLeftMenuElements = LeftMenu.Count;
foreach (MenuItem de in LeftMenu)
{
--nLeftMenuElements;
builder.Append("<tr>");
if (0 == String.Compare(de.Caption, m_strLeftMenuSelectedItem, true))
{
builder.Append("<td width=20><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=10 height=1><img src=\""+ startPageLocation + "/Layout/Common/dot_listing.gif\" width=8 height=8><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=2 height=1></td>\r\n");
builder.Append("<td class=\"naviListDevelopActiv\">");
builder.Append(de.Caption);
builder.Append("</td></tr>\r\n");
}
else
{
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/allgemein/blind.gif\" width=20 height=1></td>\r\n");
builder.Append("<td class=\"naviListDevelop\"><a href=\"");
builder.Append(de.URL);
builder.Append("\">");
builder.Append(de.Caption);
builder.Append("</a></td></tr>\r\n");
}
if (0 != nLeftMenuElements)
{
builder.Append("<tr><td colspan=2><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=4></td></tr>\r\n");
}
}
builder.Append("</table></td>");
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>");
}
public virtual void RenderFirstPageBodySection(StringBuilder builder)
{
builder.Append("<div class=\"text\" style=\"position:absolute;left:0px;top:120px\"><table width=\"100%\" border=0 cellspacing=0 cellpadding=0>\r\n");
if (ShowContentBar)
{
nTotalColumns = 1;
builder.Append("<tr>");
if (ShowLeftMenu)
{
builder.Append("<td height=43 bgcolor=\"");
builder.Append(m_strSubColColor);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=135 height=1></td>");
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>");
nTotalColumns += 2;
}
builder.Append("<td width=\"100%\" bgcolor=\"");
builder.Append(m_strMainColColor);
builder.Append("\" class=\"head\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=1>");
builder.Append(ContentBarText); // TODO for virtual
builder.Append("</td>\r\n");
if (ShowRightBox)
{
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>");
if (ShowMilestoneContentImage)
{
builder.Append("<td height=43 bgcolor=\"");
builder.Append(m_strSubColColor);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/milestone_col_head.gif\" width=138 height=43></td>");
}
else
{
builder.Append("<td height=43 bgcolor=\"");
builder.Append(m_strSubColColor);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=138 height=43></td>");
}
nTotalColumns += 2;
}
builder.Append("</tr><tr><td colspan=");
builder.Append(nTotalColumns.ToString());
builder.Append("><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td></tr>");
}
builder.Append("<tr>");
if (ShowLeftMenu)
{
RenderLeftMenu(builder);
}
builder.Append("<td bgcolor=\"#d6d7d8\" valign=\"top\" height=270><table width=\"100%\" border=0 cellspacing=0 cellpadding=0>\r\n");
builder.Append("<tr><td width=15><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=15></td>");
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td>");
builder.Append("<td width=15><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=1></td>");
builder.Append("</tr><tr><td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td>");
builder.Append("<td class=\"copy\">\r\n");
}
public virtual void RenderFinalPageBodySection(StringBuilder builder)
{
builder.Append("</td><td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td></tr></table></td>\r\n");
if (ShowRightBox)
{
RenderRightBox(builder);
}
builder.Append("</tr><tr><td colspan=");
builder.Append(nTotalColumns.ToString());
builder.Append("><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td></tr><tr>\r\n");
string strSubColor2Use = "#ffffff";
if (ShowLeftMenu)
{
builder.Append("<td height=20 bgcolor=\"");
builder.Append(strSubColor2Use);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=135 height=1></td>");
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>\r\n");
}
builder.Append( "<td width=\"100%\" bgcolor=\"");
builder.Append(m_strMainColColor);
builder.Append("\" class=\"copy\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=1>");
builder.Append("<font size=\"-2\">");
builder.Append("Copyright &copy;2000-2008 <A HREF=\"mailto:webmaster@icsharpcode.net\" title=\"");
builder.Append(StringParser.Parse("${res:StartPage.ContactUs}"));
builder.Append("\">IC#SharpCode</a>. ");
builder.Append(ICSharpCode.SharpDevelop.Gui.AboutSharpDevelopTabPage.LicenseSentence);
builder.Append("</font></td>\r\n");
if (ShowRightBox)
{
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>");
builder.Append("<td height=20 bgcolor=\"");
builder.Append(strSubColor2Use);
builder.Append("\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=138 height=20></td>\r\n");
}
builder.Append("</tr><tr><td colspan=");
builder.Append(nTotalColumns.ToString());
builder.Append("><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td></tr>\r\n");
builder.Append("</table></div>\r\n");
}
public virtual void RenderRightBox(StringBuilder builder)
{
builder.Append("<td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td>\r\n");
builder.Append("<td valign=\"top\"><table border=0 cellspacing=0 cellpadding=0><tr>");
builder.Append("<td valign=\"top\" background=\""+ startPageLocation + "/Layout/Common/klinker_milestone.gif\" width=138 height=113>");
builder.Append("<table border=0 cellspacing=0 cellpadding=0><tr><td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=3></td></tr>");
builder.Append("<tr><td class=\"milestoneText\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=10 height=1>");
builder.Append(VersionText);
builder.Append("</td></tr>");
builder.Append("<tr><td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=52></td></tr>");
builder.Append("<tr><td class=\"milestoneText\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=75 height=1><font size=\"+2\">");
builder.Append(VersionStatus);
builder.Append("</font></td></tr>");
builder.Append("</table></td></tr>");
builder.Append("<tr><td width=1><img src=\""+ startPageLocation + "/Layout/Common/pixel_weiss.gif\" width=1 height=1></td></tr>");
builder.Append("<tr><td bgcolor=\"#d6d7d8\" valign=\"top\" height=49><table border=0 cellspacing=0 cellpadding=0>");
builder.Append("<tr><td width=10><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=5></td>");
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=1 height=1></td></tr><tr>");
builder.Append("<td><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=10 height=1></td><td class=\"copyUnderlineBig\">");
RenderRightBoxHtml(builder);
builder.Append("</td>");
builder.Append("</tr></table></td></tr></table></td>");
}
internal string[] projectFiles;
public void RenderSectionStartBody(StringBuilder builder)
{
StringBuilder projectSection = builder;
projectSection.Append("<DIV class='tablediv'><TABLE CLASS='dtTABLE' CELLSPACING='0'>\n");
projectSection.Append(String.Format("<TR><TH>{0}</TH><TH>{1}</TH><TH>{2}</TH></TR>\n",
StringParser.Parse("${res:Global.Name}"),
StringParser.Parse("${res:StartPage.StartMenu.ModifiedTable}"),
StringParser.Parse("${res:StartPage.StartMenu.LocationTable}")
));
try {
// Get the recent projects
projectFiles = new string[FileService.RecentOpen.RecentProject.Count];
for (int i = 0; i < FileService.RecentOpen.RecentProject.Count; ++i) {
string fileName = FileService.RecentOpen.RecentProject[i].ToString();
// if the file does not exist, goto next one
if (!System.IO.File.Exists(fileName)) {
continue;
}
projectFiles[i] = fileName;
projectSection.Append("<TR><TD>");
projectSection.Append("<a href=\"startpage://project/" + i + "\">");
projectSection.Append(Path.GetFileNameWithoutExtension(fileName));
projectSection.Append("</A>");
projectSection.Append("</TD><TD>");
System.IO.FileInfo fInfo = new System.IO.FileInfo(fileName);
projectSection.Append(fInfo.LastWriteTime.ToShortDateString());
projectSection.Append("</TD><TD>");
projectSection.Append(fileName);
projectSection.Append("</TD></TR>\n");
}
} catch {}
projectSection.Append("</TABLE></DIV><BR/><BR/>");
projectSection.Append(String.Format("<button id=\"opencombine\">{0}</button>\n",
StringParser.Parse("${res:StartPage.StartMenu.OpenCombineButton}")
));
projectSection.Append(String.Format("<button id=\"newcombine\">{0}</button>\n",
StringParser.Parse("${res:StartPage.StartMenu.NewCombineButton}")
));
projectSection.Append("<BR/><BR/><BR/>");
}
public void RenderSectionAuthorBody(StringBuilder builder)
{
try {
builder.Append("<iframe name=\"iframe\" src=\"http://wiki.sharpdevelop.net/Contributors.ashx\" width=\"100%\" height=\"1400\" />");
//
//
//
// string html = ConvertXml.ConvertToString(Application.StartupPath +
// Path.DirectorySeparatorChar + ".." +
// Path.DirectorySeparatorChar + "doc" +
// Path.DirectorySeparatorChar + "AUTHORS.xml",
//
// PropertyService.DataDirectory +
// Path.DirectorySeparatorChar + "ConversionStyleSheets" +
// Path.DirectorySeparatorChar + "ShowAuthors.xsl");
// builder.Append(html);
} catch (Exception e) {
MessageBox.Show(e.ToString());
}
}
static string changeLogHtml;
public void RenderSectionChangeLogBody(StringBuilder builder)
{
try {
if (changeLogHtml == null) {
XslCompiledTransform transform = new XslCompiledTransform();
transform.Load(Path.Combine(PropertyService.DataDirectory, "ConversionStyleSheets/ShowChangeLog.xsl"));
StringWriter writer = new StringWriter();
XmlTextWriter xmlWriter = new XmlTextWriter(writer);
xmlWriter.Formatting = Formatting.None;
transform.Transform(Path.Combine(FileUtility.ApplicationRootPath, "doc/ChangeLog.xml"), xmlWriter);
changeLogHtml = writer.ToString().Replace("\n", "\n<br>");
}
builder.Append(changeLogHtml);
} catch (Exception e) {
MessageBox.Show(e.ToString());
}
}
public void RenderSectionHelpWantedBody(StringBuilder builder)
{
try {
builder.Append("<iframe name=\"iframe\" src=\"http://wiki.sharpdevelop.net/FeaturesWeSolicitHelpFor.ashx\" width=\"100%\" height=\"1000\" />");
//
// string html = ConvertXml.ConvertToString(Application.StartupPath +
// Path.DirectorySeparatorChar + ".." +
// Path.DirectorySeparatorChar + "doc" +
// Path.DirectorySeparatorChar + "HowYouCanHelp.xml",
//
// Application.StartupPath +
// Path.DirectorySeparatorChar + ".." +
// Path.DirectorySeparatorChar + "data" +
// Path.DirectorySeparatorChar + "ConversionStyleSheets" +
// Path.DirectorySeparatorChar + "ShowHowYouCanHelp.xsl");
// builder.Append(html);
} catch (Exception e) {
MessageBox.Show(e.ToString());
}
}
public string Render(string section)
{
startPageLocation = FileUtility.Combine(Application.StartupPath, "..", "data", "resources", "startpage");
switch (section.ToLowerInvariant()) {
case "start":
ContentBarText = StringParser.Parse("${res:StartPage.StartMenu.BarNameName}");
break;
case "changelog":
ContentBarText = StringParser.Parse("${res:StartPage.ChangeLogMenu.BarNameName}");
break;
case "authors":
ContentBarText = StringParser.Parse("${res:StartPage.AuthorsMenu.BarNameName}");
break;
case "helpwanted":
ContentBarText = StringParser.Parse("${res:StartPage.HelpWantedMenu.BarNameName}");
break;
}
StringBuilder builder = new StringBuilder(2048);
RenderHeaderSection(builder);
RenderPageTopSection(builder);
RenderFirstPageBodySection(builder);
switch (section.ToLowerInvariant()) {
case "start":
RenderSectionStartBody(builder);
break;
case "changelog":
RenderSectionChangeLogBody(builder);
break;
case "authors":
RenderSectionAuthorBody(builder);
break;
case "helpwanted":
RenderSectionHelpWantedBody(builder);
break;
}
RenderFinalPageBodySection(builder);
RenderPageEndSection(builder);
return builder.ToString();
}
}
}

52
src/AddIns/Misc/StartPage/Project/Src/Main.cs

@ -1,52 +0,0 @@ @@ -1,52 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
// project created on 16.07.2002 at 18:07
using System;
using System.Linq;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.BrowserDisplayBinding;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.StartPage
{
public class ShowStartPageCommand : AbstractMenuCommand
{
static bool isFirstStartPage = true;
public override void Run()
{
if (isFirstStartPage) {
isFirstStartPage = false;
ProjectService.SolutionLoaded += delegate {
// close all start pages when loading a solution
foreach (IViewContent v in WorkbenchSingleton.Workbench.ViewContentCollection.ToArray()) {
BrowserPane b = v as BrowserPane;
if (b != null) {
if (b.Url.Scheme == "startpage") {
b.WorkbenchWindow.CloseWindow(true);
}
}
}
};
}
foreach (IViewContent view in WorkbenchSingleton.Workbench.ViewContentCollection) {
BrowserPane b = view as BrowserPane;
if (b != null) {
if (b.Url.Scheme == "startpage") {
view.WorkbenchWindow.SelectWindow();
return;
}
}
}
WorkbenchSingleton.Workbench.ShowView(new BrowserPane(new Uri("startpage://start/")));
}
}
}

41
src/AddIns/Misc/StartPage/Project/Src/ShowStartPageCommand.cs

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Linq;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.StartPage
{
public class ShowStartPageCommand : AbstractMenuCommand
{
static ShowStartPageCommand()
{
ProjectService.SolutionLoaded += delegate {
// close all start pages when loading a solution
foreach (IViewContent v in WorkbenchSingleton.Workbench.ViewContentCollection.ToArray()) {
if (v is StartPageViewContent) {
v.WorkbenchWindow.CloseWindow(true);
}
}
};
}
public override void Run()
{
foreach (IViewContent view in WorkbenchSingleton.Workbench.ViewContentCollection) {
if (view is StartPageViewContent) {
view.WorkbenchWindow.SelectWindow();
return;
}
}
WorkbenchSingleton.Workbench.ShowView(new StartPageViewContent());
}
}
}

88
src/AddIns/Misc/StartPage/Project/Src/StartPage.cs

@ -1,88 +0,0 @@ @@ -1,88 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using ICSharpCode.SharpDevelop;
using System;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.BrowserDisplayBinding;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.StartPage
{
public class StartPageScheme : DefaultSchemeExtension
{
ICSharpCodePage page;
public override void InterceptNavigate(HtmlViewPane pane, WebBrowserNavigatingEventArgs e)
{
e.Cancel = true;
if (page == null) {
page = new ICSharpCodePage();
page.Title = ICSharpCode.Core.StringParser.Parse("${res:StartPage.StartPageContentName}");
}
string host = e.Url.Host;
if (host == "project") {
string projectFile = page.projectFiles[int.Parse(e.Url.LocalPath.Trim('/'))];
FileUtility.ObservedLoad(new NamedFileOperationDelegate(ProjectService.LoadSolution), projectFile);
} else {
pane.WebBrowser.DocumentText = page.Render(host);
}
}
public override void DocumentCompleted(HtmlViewPane pane, WebBrowserDocumentCompletedEventArgs e)
{
HtmlElement btn;
btn = pane.WebBrowser.Document.GetElementById("opencombine");
if (btn != null) {
LoggingService.Debug("Attached event handler to opencombine button");
btn.Click += delegate {new ICSharpCode.SharpDevelop.Project.Commands.LoadSolution().Run();};
}
btn = pane.WebBrowser.Document.GetElementById("newcombine");
if (btn != null) {
btn.Click += delegate {new ICSharpCode.SharpDevelop.Project.Commands.CreateNewSolution().Run();};
}
pane.WebBrowser.Navigating += pane_WebBrowser_Navigating;
pane.WebBrowser.Navigated += pane_WebBrowser_Navigated;
}
void pane_WebBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
try {
WebBrowser webBrowser = (WebBrowser)sender;
webBrowser.Navigating -= pane_WebBrowser_Navigating;
webBrowser.Navigated -= pane_WebBrowser_Navigated;
} catch (Exception ex) {
MessageService.ShowError(ex);
}
}
void pane_WebBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
try {
if (e.Url.IsFile) {
e.Cancel = true;
string file = e.Url.LocalPath;
IProjectLoader loader = ProjectService.GetProjectLoader(file);
if (loader != null) {
FileUtility.ObservedLoad(new NamedFileOperationDelegate(loader.Load), file);
} else {
FileService.OpenFile(file);
}
}
} catch (Exception ex) {
MessageService.ShowError(ex);
}
}
public override void GoHome(HtmlViewPane pane)
{
pane.Navigate("startpage://start/");
}
}
}

69
src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="ICSharpCode.StartPage.StartPageControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition
Height="72" />
<RowDefinition
Height="*" />
<RowDefinition
Height="Auto" />
</Grid.RowDefinitions>
<DockPanel
Grid.Row="0">
<Image
MaxWidth="292"
DockPanel.Dock="Left"
Stretch="UniformToFill"
Source="../Resources/balken_links.gif" />
<Image
MaxWidth="363"
DockPanel.Dock="Right"
Stretch="UniformToFill"
Source="../Resources/balken_rechts.gif" />
<Image
Stretch="Fill"
Source="../Resources/balken_mitte.gif" />
</DockPanel>
<DockPanel Grid.Row="1" VerticalAlignment="Top">
<Border DockPanel.Dock="Top" Background="#A8C6E3" Margin="4,20,4,0" CornerRadius="15,15,0,0" Padding="15,0,15,0">
<TextBlock Text="{core:Localize StartPage.StartMenu.BarNameName}"
FontSize="11pt"
FontWeight="Bold"
Foreground="White"
Margin="0,0,0,2"/>
</Border>
<Border Background="#DCDDDE" Margin="4,0,4,4" CornerRadius="0,0,15,15">
<StackPanel Orientation="Vertical" Margin="15">
<ListView Name="lastProjectsListView" SelectionMode="Single" MouseDoubleClick="lastProjectsDoubleClick">
<ListView.View>
<GridView>
<GridViewColumn DisplayMemberBinding="{Binding Path=Name}"
Header="{core:Localize Global.Name}" />
<GridViewColumn DisplayMemberBinding="{Binding Path=LastModification}"
Header="{core:Localize StartPage.StartMenu.ModifiedTable}" />
<GridViewColumn DisplayMemberBinding="{Binding Path=Path}"
Header="{core:Localize StartPage.StartMenu.LocationTable}" />
</GridView>
</ListView.View>
</ListView>
<StackPanel Orientation="Horizontal" Margin="0,20,0,0">
<Button Content="{core:Localize StartPage.StartMenu.OpenCombineButton}" Click="openSolutionClick"/>
<Button Content="{core:Localize StartPage.StartMenu.NewCombineButton}" Click="newSolutionClick" Margin="8,0,0,0"/>
</StackPanel>
</StackPanel>
</Border>
</DockPanel>
<TextBlock Background="#A8C6E3" Grid.Row="2" Padding="4,0,4,0">
Copyright ©2000-2008
<Hyperlink NavigateUri="mailto:webmaster@icsharpcode.net">IC#SharpCode</Hyperlink>
<Run Text="{x:Static gui:AboutSharpDevelopTabPage.LicenseSentence}"/>
</TextBlock>
</Grid>
</UserControl>

73
src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml.cs

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.StartPage
{
/// <summary>
/// Interaction logic for StartPageControl.xaml
/// </summary>
public partial class StartPageControl : UserControl
{
public StartPageControl()
{
InitializeComponent();
BuildRecentProjectList();
}
void BuildRecentProjectList()
{
List<RecentOpenItem> items = new List<RecentOpenItem>();
foreach (string path in FileService.RecentOpen.RecentProject) {
FileInfo file = new FileInfo(path);
if (file.Exists) {
items.Add(
new RecentOpenItem {
Name = System.IO.Path.GetFileNameWithoutExtension(path),
LastModification = file.LastWriteTime.ToShortDateString(),
Path = path
});
}
}
lastProjectsListView.ItemsSource = items;
}
class RecentOpenItem
{
public string Name { get; set; }
public string LastModification { get; set; }
public string Path { get; set; }
}
void lastProjectsDoubleClick(object sender, RoutedEventArgs e)
{
RecentOpenItem item = (RecentOpenItem)lastProjectsListView.SelectedItem;
if (item != null) {
ProjectService.LoadSolutionOrProject(item.Path);
}
}
void openSolutionClick(object sender, RoutedEventArgs e)
{
new ICSharpCode.SharpDevelop.Project.Commands.LoadSolution().Run();
}
void newSolutionClick(object sender, RoutedEventArgs e)
{
new ICSharpCode.SharpDevelop.Project.Commands.CreateNewSolution().Run();
}
}
}

29
src/AddIns/Misc/StartPage/Project/Src/StartPageViewContent.cs

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <author name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.StartPage
{
public class StartPageViewContent : AbstractViewContent
{
StartPageControl content = new StartPageControl();
public override object Content {
get {
return content;
}
}
public StartPageViewContent()
{
this.TitleName = StringParser.Parse("${res:StartPage.StartPageContentName}");
}
}
}

28
src/AddIns/Misc/StartPage/Project/StartPage.csproj

@ -39,22 +39,37 @@ @@ -39,22 +39,37 @@
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\ICSharpCodePage.cs" />
<Compile Include="Src\Main.cs" />
<Compile Include="Src\StartPage.cs" />
<Compile Include="Src\ShowStartPageCommand.cs" />
<Resource Include="Resources\balken_links.gif" />
<Resource Include="Resources\balken_mitte.gif" />
<Resource Include="Resources\balken_rechts.gif" />
<None Include="StartPage.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Src\StartPageControl.xaml.cs">
<DependentUpon>StartPageControl.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\StartPageViewContent.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
@ -67,6 +82,13 @@ @@ -67,6 +82,13 @@
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.Core.Presentation\ICSharpCode.Core.Presentation.csproj">
<Project>{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}</Project>
<Name>ICSharpCode.Core.Presentation</Name>
<Private>False</Private>
</ProjectReference>
<Folder Include="Resources" />
<Page Include="Src\StartPageControl.xaml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>

7
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs

@ -113,7 +113,12 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow @@ -113,7 +113,12 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
protected void ShowCompletionWindow()
{
Enabled = true;
this.Show(parentWindow);
// only this.Show() works when running inside a non-interactive Windows Service (e.g. unit tests),
// so only use the Show(owner) overload when there is an owner.
if (parentWindow != null)
this.Show(parentWindow);
else
this.Show();
control.Focus();

7
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs

@ -78,7 +78,12 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow @@ -78,7 +78,12 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
public void ShowDeclarationViewWindow()
{
Show(parentWindow);
// only this.Show() works when running inside a non-interactive Windows Service (e.g. unit tests),
// so only use the Show(owner) overload when there is an owner.
if (parentWindow != null)
this.Show(parentWindow);
else
this.Show();
}
public void CloseDeclarationViewWindow()

18
src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs

@ -8,13 +8,16 @@ @@ -8,13 +8,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Navigation;
using ICSharpCode.Core;
using ICSharpCode.Core.Presentation;
using System.Windows.Input;
namespace ICSharpCode.SharpDevelop.Gui
{
@ -82,12 +85,25 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -82,12 +85,25 @@ namespace ICSharpCode.SharpDevelop.Gui
UpdateMenu();
AddHandler(Hyperlink.RequestNavigateEvent, new RequestNavigateEventHandler(OnRequestNavigate));
requerySuggestedEventHandler = new EventHandler(CommandManager_RequerySuggested);
CommandManager.RequerySuggested += requerySuggestedEventHandler;
StatusBarService.SetMessage("${res:MainWindow.StatusBar.ReadyMessage}");
}
void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
if (e.Uri.Scheme == "mailto") {
try {
Process.Start(e.Uri.ToString());
} catch {}
} else {
FileService.OpenFile(e.Uri.ToString());
}
}
// keep a reference to the event handler to prevent it from being gargabe collected
// (CommandManager.RequerySuggested only keeps weak references to the event handlers)
EventHandler requerySuggestedEventHandler;

11
src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml

@ -6,13 +6,14 @@ @@ -6,13 +6,14 @@
Width="578"
Style="{StaticResource DialogWindow}">
<Grid>
<Label
<TextBlock
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="8,8,8,0"
Content="{core:Localize Dialog.Goto.IntroText}" />
Text="{core:Localize Dialog.Goto.IntroText}"
TextWrapping="Wrap" />
<TextBox
Grid.Column="0"
Grid.Row="1"
@ -53,13 +54,13 @@ @@ -53,13 +54,13 @@
Click="cancelButtonClick" />
<Grid.RowDefinitions>
<RowDefinition
Height="70" />
Height="Auto" />
<RowDefinition
Height="30" />
Height="Auto" />
<RowDefinition
Height="1*" />
<RowDefinition
Height="37" />
Height="Auto" />
</Grid.RowDefinitions>
</Grid>
</Window>

52
src/Setup/Files.wxs

@ -831,58 +831,6 @@ @@ -831,58 +831,6 @@
<File Source="..\..\data\resources\layouts\LayoutConfig.xml" Id="LayoutConfig.xml" Name="LayoutConfig.xml" />
</Component>
</Directory>
<Directory Id="StartPageFolder" Name="startpage">
<Directory Id="StartPageLayoutFolder" Name="Layout">
<Directory Id="LayoutBlueFolder" Name="blue">
<Component Guid="1DFAB472-3E8E-4E0B-908F-0FD1F520792F" Id="StartPageLayoutBlueFiles" DiskId="1">
<File Source="..\..\data\resources\startpage\Layout\blue\balken_rechts.gif" Id="Blue_balken_rechts.gif" Name="balken_rechts.gif" />
<File Source="..\..\data\resources\startpage\Layout\blue\balken_links.gif" Id="Blue_balken_links.gif" Name="balken_links.gif" />
<File Source="..\..\data\resources\startpage\Layout\blue\balken_mitte.gif" Id="Blue_balken_mitte.gif" Name="balken_mitte.gif" />
</Component>
</Directory>
<Directory Id="LayoutBrownFolder" Name="brown">
<Component Guid="3A3A5F7B-0A62-4A53-9DB7-209F4A863EF9" Id="StartPageLayoutBrownFiles" DiskId="1">
<File Source="..\..\data\resources\startpage\Layout\brown\balken_rechts.gif" Id="Brown_balken_rechts.gif" Name="balken_rechts.gif" />
<File Source="..\..\data\resources\startpage\Layout\brown\balken_links.gif" Id="Brown_balken_links.gif" Name="balken_links.gif" />
<File Source="..\..\data\resources\startpage\Layout\brown\balken_mitte.gif" Id="Brown_balken_mitte.gif" Name="balken_mitte.gif" />
</Component>
</Directory>
<Directory Id="LayoutCommonFolder" Name="common">
<Component Guid="B99D6762-087A-49DA-B1BB-F24E08CF4CC2" Id="StartPageLayoutCommonFiles" DiskId="1">
<File Source="..\..\data\resources\startpage\Layout\common\pixel_weiss.gif" Id="pixel_weiss.gif" Name="pixel_weiss.gif" />
<File Source="..\..\data\resources\startpage\Layout\common\blind.gif" Name="blind.gif" Id="blind.gif" />
<File Source="..\..\data\resources\startpage\Layout\common\dot_listing.gif" Id="dot_listing.gif" Name="dot_listing.gif" />
<File Source="..\..\data\resources\startpage\Layout\common\klinker_milestone.gif" Id="klinker_milestone.gif" Name="klinker_milestone.gif" />
<File Source="..\..\data\resources\startpage\Layout\common\line_hor_black.gif" Id="line_hor_black.gif" Name="line_hor_black.gif" />
<File Source="..\..\data\resources\startpage\Layout\common\milestone_col_head.gif" Id="milestone_col_head.gif" Name="milestone_col_head.gif" />
</Component>
</Directory>
<Directory Id="LayoutGreenFolder" Name="green">
<Component Guid="81709CEC-4157-485B-854E-0ACF81D8E53D" Id="StartPageLayoutGreenFiles" DiskId="1">
<File Source="..\..\data\resources\startpage\Layout\green\balken_rechts.gif" Id="Green_balken_rechts.gif" Name="balken_rechts.gif" />
<File Source="..\..\data\resources\startpage\Layout\green\balken_links.gif" Id="Green_balken_links.gif" Name="balken_links.gif" />
<File Source="..\..\data\resources\startpage\Layout\green\balken_mitte.gif" Id="Green_balken_mitte.gif" Name="balken_mitte.gif" />
</Component>
</Directory>
<Directory Id="LayoutOrangeFolder" Name="orange">
<Component Guid="1AADCE06-721C-4F61-945F-42F9920685B6" Id="StartPageLayoutOrangeFiles" DiskId="1">
<File Source="..\..\data\resources\startpage\Layout\orange\balken_rechts.gif" Id="Orange_balken_rechts.gif" Name="balken_rechts.gif" />
<File Source="..\..\data\resources\startpage\Layout\orange\balken_links.gif" Id="Orange_balken_links.gif" Name="balken_links.gif" />
<File Source="..\..\data\resources\startpage\Layout\orange\balken_mitte.gif" Id="Orange_balken_mitte.gif" Name="balken_mitte.gif" />
</Component>
</Directory>
<Directory Id="LayoutRedFolder" Name="red">
<Component Guid="FDDB0436-8AAF-4B76-B2A3-4973567A1D57" Id="StartPageLayoutRedFiles" DiskId="1">
<File Source="..\..\data\resources\startpage\Layout\red\balken_rechts.gif" Id="Red_balken_rechts.gif" Name="balken_rechts.gif" />
<File Source="..\..\data\resources\startpage\Layout\red\balken_links.gif" Id="Red_balken_links.gif" Name="balken_links.gif" />
<File Source="..\..\data\resources\startpage\Layout\red\balken_mitte.gif" Id="Red_balken_mitte.gif" Name="balken_mitte.gif" />
</Component>
</Directory>
<Component Guid="4A3761D8-42D7-4A18-9F7E-4BE31523710B" Id="StartPageLayoutFiles" DiskId="1">
<File Source="..\..\data\resources\startpage\Layout\default.css" Name="default.css" Id="default.css" />
</Component>
</Directory>
</Directory>
<Component Guid="D8322576-2925-4F43-ACB0-05369DC5FC67" Id="StringResourceFiles" DiskId="1">
<File Source="..\..\data\resources\StringResources.tr.resources" Id="StringResources.tr.resources" Name="StringResources.tr.resources" />
<File Source="..\..\data\resources\StringResources.cz.resources" Id="StringResources.cz.resources" Name="StringResources.cz.resources" />

7
src/Setup/Setup.wxs

@ -274,13 +274,6 @@ @@ -274,13 +274,6 @@
<ComponentRef Id="InstallerBitmapFiles"/>
<ComponentRef Id="LanguageBitmapFiles"/>
<ComponentRef Id="LayoutFiles"/>
<ComponentRef Id="StartPageLayoutBlueFiles"/>
<ComponentRef Id="StartPageLayoutBrownFiles"/>
<ComponentRef Id="StartPageLayoutCommonFiles"/>
<ComponentRef Id="StartPageLayoutGreenFiles"/>
<ComponentRef Id="StartPageLayoutOrangeFiles"/>
<ComponentRef Id="StartPageLayoutRedFiles"/>
<ComponentRef Id="StartPageLayoutFiles"/>
<ComponentRef Id="StringResourceFiles"/>
<ComponentRef Id="SchemaFiles"/>
<ComponentRef Id="CSharpFileTemplates"/>

Loading…
Cancel
Save